opensurgsim
Public Types | Public Member Functions | List of all members
SurgSim::DataStructures::DataGroupBuilder Class Reference

A class that allows you to build a DataGroup structure. More...

#include <DataGroupBuilder.h>

Public Types

typedef DataGroup::PoseType PoseType
 The type used for poses.
 
typedef DataGroup::VectorType VectorType
 The type used for vectors.
 
typedef DataGroup::DynamicMatrixType DynamicMatrixType
 The type used for matrices.
 
typedef DataGroup::ScalarType ScalarType
 The type used for scalars.
 
typedef DataGroup::IntegerType IntegerType
 The type used for integers.
 
typedef DataGroup::BooleanType BooleanType
 The type used for booleans.
 
typedef DataGroup::StringType StringType
 The type used for strings.
 
typedef Image< float > ImageType
 The type used for images.
 

Public Member Functions

 DataGroupBuilder ()
 Constructs an empty builder object.
 
DataGroup createData () const
 Produces a DataGroup object with an immutable set of names and indices. More...
 
std::shared_ptr< DataGroupcreateSharedData () const
 Produce a shared pointer to an empty DataGroup object with an immutable set of names and indices. More...
 
NamedDataBuilder< PoseType > & poses ()
 Provides access to the pose value entries. More...
 
const NamedDataBuilder< PoseType > & poses () const
 Provides access to the pose value entries. More...
 
NamedDataBuilder< VectorType > & vectors ()
 Provides access to the vector value entries. More...
 
const NamedDataBuilder< VectorType > & vectors () const
 Provides access to the vector value entries. More...
 
NamedDataBuilder< DynamicMatrixType > & matrices ()
 Provides access to the matrix value entries. More...
 
const NamedDataBuilder< DynamicMatrixType > & matrices () const
 Provides access to the matrix value entries. More...
 
NamedDataBuilder< ScalarType > & scalars ()
 Provides access to the scalar value entries. More...
 
const NamedDataBuilder< ScalarType > & scalars () const
 Provides access to the scalar value entries. More...
 
NamedDataBuilder< IntegerType > & integers ()
 Provides access to the integer value entries. More...
 
const NamedDataBuilder< IntegerType > & integers () const
 Provides access to the integer value entries. More...
 
NamedDataBuilder< BooleanType > & booleans ()
 Provides access to the Boolean value entries. More...
 
const NamedDataBuilder< BooleanType > & booleans () const
 Provides access to the Boolean value entries. More...
 
NamedDataBuilder< StringType > & strings ()
 Provides access to the string value entries. More...
 
const NamedDataBuilder< StringType > & strings () const
 Provides access to the string value entries. More...
 
NamedDataBuilder< ImageType > & images ()
 Provides access to the image value entries. More...
 
const NamedDataBuilder< ImageType > & images () const
 Provides access to the image value entries. More...
 
NamedVariantDataBuildercustomData ()
 Provides access to the custom data entries. More...
 
const NamedVariantDataBuildercustomData () const
 Provides access to the custom data entries. More...
 
void addPose (const std::string &name)
 A shortcut for adding a named pose entry. More...
 
void addVector (const std::string &name)
 A shortcut for adding a named vector entry. More...
 
void addMatrix (const std::string &name)
 A shortcut for adding a named matrix entry. More...
 
void addScalar (const std::string &name)
 A shortcut for adding a named scalar entry. More...
 
void addInteger (const std::string &name)
 A shortcut for adding a named integer entry. More...
 
void addBoolean (const std::string &name)
 A shortcut for adding a named boolean entry. More...
 
void addString (const std::string &name)
 A shortcut for adding a named string entry. More...
 
void addImage (const std::string &name)
 A shortcut for adding a named image entry. More...
 
void addCustom (const std::string &name)
 A shortcut for adding a named custom data entry. More...
 
void addEntriesFrom (const DataGroupBuilder &builder)
 Create new entries from another DataGroupBuilder. More...
 
void addEntriesFrom (const DataGroup &data)
 Create new entries from an already initialized DataGroup. More...
 

Detailed Description

A class that allows you to build a DataGroup structure.

Since the data layout of a DataGroup object cannot be modified, this class is helpful in initially setting up the names and their corresponding indices. You can add entries to the builder using the addPose, addVector, addScalar, addInteger, addBoolean, addString, and addEntriesFrom calls, or using similar calls on one of the type-specific element groups; and then create the DataGroup instance with createData() or createSharedData().

See also
DataGroup

Member Function Documentation

§ addBoolean()

void SurgSim::DataStructures::DataGroupBuilder::addBoolean ( const std::string &  name)

A shortcut for adding a named boolean entry.

Identical to booleans().addEntry(name).

§ addCustom()

void SurgSim::DataStructures::DataGroupBuilder::addCustom ( const std::string &  name)

A shortcut for adding a named custom data entry.

Identical to customData().addEntry(name).

§ addEntriesFrom() [1/2]

void SurgSim::DataStructures::DataGroupBuilder::addEntriesFrom ( const DataGroupBuilder builder)

Create new entries from another DataGroupBuilder.

Parameters
builderThe other builder.

§ addEntriesFrom() [2/2]

void SurgSim::DataStructures::DataGroupBuilder::addEntriesFrom ( const DataGroup data)

Create new entries from an already initialized DataGroup.

Parameters
dataThe data object.

§ addImage()

void SurgSim::DataStructures::DataGroupBuilder::addImage ( const std::string &  name)

A shortcut for adding a named image entry.

Identical to images().addEntry(name).

§ addInteger()

void SurgSim::DataStructures::DataGroupBuilder::addInteger ( const std::string &  name)

A shortcut for adding a named integer entry.

Identical to integers().addEntry(name).

§ addMatrix()

void SurgSim::DataStructures::DataGroupBuilder::addMatrix ( const std::string &  name)

A shortcut for adding a named matrix entry.

Identical to matrices().addEntry(name).

§ addPose()

void SurgSim::DataStructures::DataGroupBuilder::addPose ( const std::string &  name)

A shortcut for adding a named pose entry.

Identical to poses().addEntry(name).

§ addScalar()

void SurgSim::DataStructures::DataGroupBuilder::addScalar ( const std::string &  name)

A shortcut for adding a named scalar entry.

Identical to scalars().addEntry(name).

§ addString()

void SurgSim::DataStructures::DataGroupBuilder::addString ( const std::string &  name)

A shortcut for adding a named string entry.

Identical to strings().addEntry(name).

§ addVector()

void SurgSim::DataStructures::DataGroupBuilder::addVector ( const std::string &  name)

A shortcut for adding a named vector entry.

Identical to vectors().addEntry(name).

§ booleans() [1/2]

NamedDataBuilder< DataGroupBuilder::BooleanType > & SurgSim::DataStructures::DataGroupBuilder::booleans ( )

Provides access to the Boolean value entries.

Returns
a writable reference to the sub-object that contains Boolean value entries.

§ booleans() [2/2]

const NamedDataBuilder< DataGroupBuilder::BooleanType > & SurgSim::DataStructures::DataGroupBuilder::booleans ( ) const

Provides access to the Boolean value entries.

Returns
a read-only reference to the sub-object that contains Boolean value entries.

§ createData()

DataGroup SurgSim::DataStructures::DataGroupBuilder::createData ( ) const

Produces a DataGroup object with an immutable set of names and indices.

None of the values will contain any current data.

Returns
the DataGroup object by value.

§ createSharedData()

std::shared_ptr< DataGroup > SurgSim::DataStructures::DataGroupBuilder::createSharedData ( ) const

Produce a shared pointer to an empty DataGroup object with an immutable set of names and indices.

None of the values will contain any current data.

Returns
a shared pointer to the DataGroup object.

§ customData() [1/2]

NamedVariantDataBuilder & SurgSim::DataStructures::DataGroupBuilder::customData ( )

Provides access to the custom data entries.

Returns
a writable reference to the sub-object that contains custom data entries.

§ customData() [2/2]

const NamedVariantDataBuilder & SurgSim::DataStructures::DataGroupBuilder::customData ( ) const

Provides access to the custom data entries.

Returns
a read-only reference to the sub-object that contains custom data entries.

§ images() [1/2]

NamedDataBuilder< DataGroupBuilder::ImageType > & SurgSim::DataStructures::DataGroupBuilder::images ( )

Provides access to the image value entries.

Returns
a writable reference to the sub-object that contains image value entries.

§ images() [2/2]

const NamedDataBuilder< DataGroupBuilder::ImageType > & SurgSim::DataStructures::DataGroupBuilder::images ( ) const

Provides access to the image value entries.

Returns
a read-only reference to the sub-object that contains image value entries.

§ integers() [1/2]

NamedDataBuilder< DataGroupBuilder::IntegerType > & SurgSim::DataStructures::DataGroupBuilder::integers ( )

Provides access to the integer value entries.

Returns
a writable reference to the sub-object that contains integer value entries.

§ integers() [2/2]

const NamedDataBuilder< DataGroupBuilder::IntegerType > & SurgSim::DataStructures::DataGroupBuilder::integers ( ) const

Provides access to the integer value entries.

Returns
a read-only reference to the sub-object that contains integer value entries.

§ matrices() [1/2]

NamedDataBuilder< DataGroupBuilder::DynamicMatrixType > & SurgSim::DataStructures::DataGroupBuilder::matrices ( )

Provides access to the matrix value entries.

Returns
a writable reference to the sub-object that contains matrix value entries.

§ matrices() [2/2]

const NamedDataBuilder< DataGroupBuilder::DynamicMatrixType > & SurgSim::DataStructures::DataGroupBuilder::matrices ( ) const

Provides access to the matrix value entries.

Returns
a read-only reference to the sub-object that contains matrix value entries.

§ poses() [1/2]

NamedDataBuilder< DataGroupBuilder::PoseType > & SurgSim::DataStructures::DataGroupBuilder::poses ( )

Provides access to the pose value entries.

Returns
a writable reference to the sub-object that contains pose value entries.

§ poses() [2/2]

const NamedDataBuilder< DataGroupBuilder::PoseType > & SurgSim::DataStructures::DataGroupBuilder::poses ( ) const

Provides access to the pose value entries.

Returns
a read-only reference to the sub-object that contains pose value entries.

§ scalars() [1/2]

NamedDataBuilder< DataGroupBuilder::ScalarType > & SurgSim::DataStructures::DataGroupBuilder::scalars ( )

Provides access to the scalar value entries.

Returns
a writable reference to the sub-object that contains scalar value entries.

§ scalars() [2/2]

const NamedDataBuilder< DataGroupBuilder::ScalarType > & SurgSim::DataStructures::DataGroupBuilder::scalars ( ) const

Provides access to the scalar value entries.

Returns
a read-only reference to the sub-object that contains scalar value entries.

§ strings() [1/2]

NamedDataBuilder< DataGroupBuilder::StringType > & SurgSim::DataStructures::DataGroupBuilder::strings ( )

Provides access to the string value entries.

Returns
a writable reference to the sub-object that contains string value entries.

§ strings() [2/2]

const NamedDataBuilder< DataGroupBuilder::StringType > & SurgSim::DataStructures::DataGroupBuilder::strings ( ) const

Provides access to the string value entries.

Returns
a read-only reference to the sub-object that contains string value entries.

§ vectors() [1/2]

NamedDataBuilder< DataGroupBuilder::VectorType > & SurgSim::DataStructures::DataGroupBuilder::vectors ( )

Provides access to the vector value entries.

Returns
a writable reference to the sub-object that contains vector value entries.

§ vectors() [2/2]

const NamedDataBuilder< DataGroupBuilder::VectorType > & SurgSim::DataStructures::DataGroupBuilder::vectors ( ) const

Provides access to the vector value entries.

Returns
a read-only reference to the sub-object that contains vector value entries.

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