Helper class to manage the registration of DataPiece objects within a single DataLayout.
More...
|
|
static DataLayouter & | get () |
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.
- call dataLayoutBegin(layout) to start registering DataPiece objects with a layout object.
- create DataPiece objects, which will automatically call registerDataPiece(dataPiece).
- call dataLayoutEnd() to end the registration. Each thread has its own DataLayouter instance, so DataLayout objects can be constructed concurrently in different threads, but the construction of a DataLayout must begin and end in the same thread. This class is purely internal to VRS, and nothing outside of VRS should ever rely on it. This is one of the reasons why it's only declared & defined in the same cpp file.
◆ dataLayoutBegin()
| void vrs::internal::DataLayouter::dataLayoutBegin |
( |
DataLayout & | layout | ) |
|
|
inline |
◆ dataLayoutEnd()
| void vrs::internal::DataLayouter::dataLayoutEnd |
( |
| ) |
|
|
inline |
◆ dataLayoutPieceLabel()
| string vrs::internal::DataLayouter::dataLayoutPieceLabel |
( |
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
-
- 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
-
| stuctName | name 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
-
| structName | name of the sub-struct, to be added to the prefix namespace. |
◆ registerDataPiece()
Called by DataPiece constructor to register themselves in the DataLayout currently constructed.
- Parameters
-
| dataPiece | Reference to the DataPiece to register. |
- Returns
- A reference to the DataLayout being constructed.
The documentation for this class was generated from the following file: