VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
vrs::internal::DataLayouter Class Reference

Helper class to manage the registration of DataPiece objects within a single DataLayout. More...

Public Member Functions

void dataLayoutBegin (DataLayout &layout) DISABLE_THREAD_SAFETY_ANALYSIS
 
DataLayoutregisterDataPiece (DataPiece *dataPiece)
 
void dataLayoutEnd () DISABLE_THREAD_SAFETY_ANALYSIS
 
void dataLayoutStructStart (const string &structName)
 
string dataLayoutPieceLabel (const string &label)
 
void dataLayoutStructEnd (const string &structName)
 

Static Public Member Functions

static DataLayouterget ()
 

Detailed Description

Helper class to manage the registration of DataPiece objects within a single DataLayout.

C++ doesn't support a form of introspection that would allow objects to "find their parent". This technique allows the automatic registration of DataPiece objects.

Member Function Documentation

◆ dataLayoutBegin()

void vrs::internal::DataLayouter::dataLayoutBegin ( DataLayout layout)
inline

Start auto-registration of DataPiece objects in the provided DataLayout. Attention! This function acquires a global DataLayout creation lock to prevent mixups if two DataLayouts were to be created concurrently in two threads. You must guarantee that this call is matched by a call to data dataLayoutEnd() to release the global lock. This is called by the constructors of AutoDataLayout and ManualDataLayout.

Parameters
layoutDataLayout all DataPieces created will register themselves with.

◆ dataLayoutEnd()

void vrs::internal::DataLayouter::dataLayoutEnd ( )
inline

End the construction of a DataLayout. This is called by AutoDataLayoutEnd's constructor, and on demand by ManualDataLayout.

◆ dataLayoutPieceLabel()

string vrs::internal::DataLayouter::dataLayoutPieceLabel ( const string &  label)
inline

Get the actual label of a DataPiece. This method adds a prefix to the label, if the DataPiece belongs to a DataLayoutStruct.

Parameters
labelname requested for the DataPiece.
Returns
The full label for the DataPiece, which may have been prepended with a suffix.

◆ dataLayoutStructEnd()

void vrs::internal::DataLayouter::dataLayoutStructEnd ( const string &  structName)
inline

End the construction of a DataPieceStruct.

Parameters
stuctNamename of the structName which construction is being ended.

◆ dataLayoutStructStart()

void vrs::internal::DataLayouter::dataLayoutStructStart ( const string &  structName)
inline

Start a sub-structure within a DataLayout, with its own "namespace". The DataPiece objects within that struct will have a label prepended with the namespace. The "namespaces" may be nested, so that you may have a DataLayoutStruct within a DataLayoutStruct.

Parameters
structNamename of the sub-struct, to be added to the prefix namespace.

◆ registerDataPiece()

DataLayout & vrs::internal::DataLayouter::registerDataPiece ( DataPiece dataPiece)
inline

Called by DataPiece constructor to register themselves in the DataLayout currently constructed.

Parameters
dataPieceReference to the DataPiece to register.
Returns
A reference to the DataLayout being constructed.

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