pocolog_cpp
Classes | Public Member Functions | Static Public Member Functions | List of all members
pocolog_cpp::Index Class Reference

#include <Index.hpp>

Public Member Functions

 Index (std::string indexFileName, size_t streamIdx)
 
 Index (const StreamDescription &desc, off_t posOfStreamDesc)
 
bool matches (const StreamDescription &desc) const
 
off_t writeIndexToFile (std::fstream &indexFile, off_t prologPos, off_t indexDataPos)
 
void addSample (off_t filePosition, const base::Time &sampleTime)
 
std::streampos getSamplePos (size_t sampleNr)
 
base::Time getSampleTime (size_t sampleNr)
 
const base::Time & getFirstSampleTime () const
 
const base::Time & getLastSampleTime () const
 
size_t getNumSamples () const
 
std::streampos getDescriptionPos () const
 
std::string getName ()
 
 ~Index ()
 

Static Public Member Functions

static off_t getPrologueSize ()
 

Constructor & Destructor Documentation

◆ Index() [1/2]

pocolog_cpp::Index::Index ( std::string  indexFileName,
size_t  streamIdx 
)

◆ Index() [2/2]

pocolog_cpp::Index::Index ( const StreamDescription desc,
off_t  posOfStreamDesc 
)

◆ ~Index()

pocolog_cpp::Index::~Index ( )

Member Function Documentation

◆ addSample()

void pocolog_cpp::Index::addSample ( off_t  filePosition,
const base::Time &  sampleTime 
)

◆ getDescriptionPos()

std::streampos pocolog_cpp::Index::getDescriptionPos ( ) const
inline

◆ getFirstSampleTime()

const base::Time& pocolog_cpp::Index::getFirstSampleTime ( ) const
inline

◆ getLastSampleTime()

const base::Time& pocolog_cpp::Index::getLastSampleTime ( ) const
inline

◆ getName()

std::string pocolog_cpp::Index::getName ( )
inline

◆ getNumSamples()

size_t pocolog_cpp::Index::getNumSamples ( ) const
inline

◆ getPrologueSize()

off_t pocolog_cpp::Index::getPrologueSize ( )
static

Returns the size of the prologue written to the file

◆ getSamplePos()

std::streampos pocolog_cpp::Index::getSamplePos ( size_t  sampleNr)

◆ getSampleTime()

base::Time pocolog_cpp::Index::getSampleTime ( size_t  sampleNr)

◆ matches()

bool pocolog_cpp::Index::matches ( const StreamDescription desc) const

◆ writeIndexToFile()

off_t pocolog_cpp::Index::writeIndexToFile ( std::fstream &  indexFile,
off_t  prologPos,
off_t  indexDataPos 
)

Writes the index to the Index File.

Parameters
prologPosposition, from the start of the file, where to write the prologue
indexDataPosposition, from the start of the file, were to write the index data
Returns
the offset from the start of the file, were the index Data ENDS + 1

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