![]() |
VRS
A file format for sensor data.
|
Helper class to include DataLayout structs containing a set of DataPieceXXX and DataLayoutStruct while preserving the required uniqueness of the field names. Embedded DataPiece objects will have a name automatically prefixed with the name of the DataLayoutStruct, with a '/' in between. More...
#include <DataLayout.h>
Public Member Functions | |
DataLayoutStruct (const string &structName) | |
Static Public Member Functions | |
static void | dataLayoutStructEnd (const string &structName) |
Helper class to include DataLayout structs containing a set of DataPieceXXX and DataLayoutStruct while preserving the required uniqueness of the field names. Embedded DataPiece objects will have a name automatically prefixed with the name of the DataLayoutStruct, with a '/' in between.
Example:
struct PoseLayout : public DataLayoutStruct { DATA_LAYOUT_STRUCT(PoseLayout)
vrs::DataPieceVector<vrs::Matrix4Dd> orientation{"orientation"}; vrs::DataPieceVector<vrs::Matrix3Dd> translation{"translation"}; };
struct Tracking : public AutoDataLayout { PoseLayout leftHandPose{"left_hand"}; PoseLayout rightHandPose{"right_hand"};
vrs::AutoDataLayoutEnd endLayout; };
Tracking will declare:
It is also possible to nest DataLayoutStruct definitions inside DataLayoutStruct definitions, resulting in names growing in length, nesting namespaces.
Use the alternate macro DATA_LAYOUT_STRUCT_WITH_INIT if you need your DataLayoutStruct to be initialized by an init() method, to assign default values to DataPiece fields for instance.