3D Forest
Software for analysis of Lidar data from forest environment.
RecordFile Class Reference

#include <RecordFile.hpp>

Classes

struct  Buffer
 
struct  Header
 

Public Types

enum  Type { TYPE_CUSTOM , TYPE_U32 , TYPE_U64 , TYPE_F64 }
 

Public Member Functions

 RecordFile ()
 
 ~RecordFile ()
 
void create (const std::string &path, const std::string &name, RecordFile::Type recordType, size_t recordSize=0)
 
void open (const std::string &path)
 
void close ()
 
bool open () const
 
RecordFile::Type recordType () const
 
size_t recordSize () const
 
const std::string & name () const
 
uint64_t size () const
 
uint64_t index () const
 
void setIndex (uint64_t index)
 
void fill (uint64_t n)
 
void write (uint32_t data)
 
void write (uint64_t data)
 
void write (double data)
 
void read (uint32_t &data)
 
void read (uint64_t &data)
 
void read (double &data)
 
void readBuffer (uint8_t *buffer, uint64_t nbyte)
 
void writeBuffer (const uint8_t *buffer, uint64_t nbyte)
 
void createBuffer (RecordFile::Buffer &buffer, uint64_t n, bool setZero=false) const
 
void readBuffer (RecordFile::Buffer &buffer, uint64_t n)
 
void writeBuffer (const RecordFile::Buffer &buffer, uint64_t n, uint64_t from=0)
 
void range (uint32_t &min, uint32_t &max, uint64_t n, uint64_t from=0)
 

Protected Member Functions

void init ()
 
void setupRecordType (int recordType, size_t recordSize)
 
void writeHeader (const std::string &name, RecordFile::Type recordType, size_t recordSize)
 
void readHeader ()
 

Protected Attributes

RecordFile::Type recordType_
 
size_t recordSize_
 
uint64_t headerSize_
 
std::string name_
 
File file_
 

Member Enumeration Documentation

◆ Type

Record File Type.

Enumerator
TYPE_CUSTOM 
TYPE_U32 
TYPE_U64 
TYPE_F64 

Constructor & Destructor Documentation

◆ RecordFile()

RecordFile::RecordFile ( )

◆ ~RecordFile()

RecordFile::~RecordFile ( )

Member Function Documentation

◆ close()

void RecordFile::close ( )

◆ create()

void RecordFile::create ( const std::string & path,
const std::string & name,
RecordFile::Type recordType,
size_t recordSize = 0 )

◆ createBuffer()

void RecordFile::createBuffer ( RecordFile::Buffer & buffer,
uint64_t n,
bool setZero = false ) const

Referenced by readBuffer().

◆ fill()

void RecordFile::fill ( uint64_t n)

Fill 'n' file records with zero's.

Referenced by setIndex().

◆ index()

uint64_t RecordFile::index ( ) const

Referenced by setIndex().

◆ init()

void RecordFile::init ( )
protected

Referenced by create(), open(), and RecordFile().

◆ name()

const std::string & RecordFile::name ( ) const
inline

Referenced by create(), readHeader(), and writeHeader().

◆ open() [1/2]

bool RecordFile::open ( ) const
inline

◆ open() [2/2]

void RecordFile::open ( const std::string & path)

◆ range()

void RecordFile::range ( uint32_t & min,
uint32_t & max,
uint64_t n,
uint64_t from = 0 )

◆ read() [1/3]

void RecordFile::read ( double & data)

◆ read() [2/3]

void RecordFile::read ( uint32_t & data)

◆ read() [3/3]

void RecordFile::read ( uint64_t & data)

◆ readBuffer() [1/2]

void RecordFile::readBuffer ( RecordFile::Buffer & buffer,
uint64_t n )

◆ readBuffer() [2/2]

void RecordFile::readBuffer ( uint8_t * buffer,
uint64_t nbyte )

Referenced by readBuffer().

◆ readHeader()

void RecordFile::readHeader ( )
protected

Referenced by open().

◆ recordSize()

size_t RecordFile::recordSize ( ) const
inline

◆ recordType()

◆ setIndex()

void RecordFile::setIndex ( uint64_t index)

Referenced by range().

◆ setupRecordType()

void RecordFile::setupRecordType ( int recordType,
size_t recordSize )
protected

Referenced by readHeader(), and writeHeader().

◆ size()

uint64_t RecordFile::size ( ) const

◆ write() [1/3]

void RecordFile::write ( double data)

◆ write() [2/3]

void RecordFile::write ( uint32_t data)

◆ write() [3/3]

void RecordFile::write ( uint64_t data)

◆ writeBuffer() [1/2]

void RecordFile::writeBuffer ( const RecordFile::Buffer & buffer,
uint64_t n,
uint64_t from = 0 )

◆ writeBuffer() [2/2]

void RecordFile::writeBuffer ( const uint8_t * buffer,
uint64_t nbyte )

Referenced by writeBuffer().

◆ writeHeader()

void RecordFile::writeHeader ( const std::string & name,
RecordFile::Type recordType,
size_t recordSize )
protected

Referenced by create().

Member Data Documentation

◆ file_

◆ headerSize_

uint64_t RecordFile::headerSize_
protected

◆ name_

std::string RecordFile::name_
protected

◆ recordSize_

size_t RecordFile::recordSize_
protected

◆ recordType_

RecordFile::Type RecordFile::recordType_
protected

The documentation for this class was generated from the following files: