DataGroupBuilder.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2012-2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
17 #define SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
18 
22 #include <Eigen/Core>
23 
24 namespace SurgSim
25 {
26 namespace DataStructures
27 {
28 
39 {
40 public:
55 
58 
62  DataGroup createData() const;
63 
67  std::shared_ptr<DataGroup> createSharedData() const;
68 
72 
75  const NamedDataBuilder<PoseType>& poses() const;
76 
80 
84 
88 
92 
96 
100 
104 
108 
112 
116 
120 
123  const NamedDataBuilder<StringType>& strings() const;
124 
128 
131  const NamedVariantDataBuilder& customData() const;
132 
135  void addPose(const std::string& name);
136 
139  void addVector(const std::string& name);
140 
143  void addMatrix(const std::string& name);
144 
147  void addScalar(const std::string& name);
148 
151  void addInteger(const std::string& name);
152 
155  void addBoolean(const std::string& name);
156 
159  void addString(const std::string& name);
160 
163  void addCustom(const std::string& name);
164 
167  void addEntriesFrom(const DataGroupBuilder& builder);
168 
171  void addEntriesFrom(const DataGroup& data);
172 
173 private:
174  // Prevent copy construction and copy assignment.
177 
180 
183 
186 
189 
192 
195 
198 
201 };
202 
203 }; // namespace Input
204 }; // namespace SurgSim
205 
206 #endif // SURGSIM_DATASTRUCTURES_DATAGROUPBUILDER_H
void addPose(const std::string &name)
A shortcut for adding a named pose entry.
Definition: DataGroupBuilder.cpp:127
void addString(const std::string &name)
A shortcut for adding a named string entry.
Definition: DataGroupBuilder.cpp:157
Definition: DriveElementFromInputBehavior.cpp:27
NamedDataBuilder< DynamicMatrixType > & matrices()
Provides access to the matrix value entries.
Definition: DataGroupBuilder.cpp:67
NamedVariantDataBuilder m_customData
The subsidiary builder used for custom data.
Definition: DataGroupBuilder.h:200
DataGroupBuilder()
Constructs an empty builder object.
Definition: DataGroupBuilder.cpp:24
void addMatrix(const std::string &name)
A shortcut for adding a named matrix entry.
Definition: DataGroupBuilder.cpp:137
NamedDataBuilder< ScalarType > m_scalars
The subsidiary builder used for scalar values.
Definition: DataGroupBuilder.h:188
void addInteger(const std::string &name)
A shortcut for adding a named integer entry.
Definition: DataGroupBuilder.cpp:147
NamedDataBuilder< StringType > m_strings
The subsidiary builder used for string values.
Definition: DataGroupBuilder.h:197
NamedDataBuilder< PoseType > m_poses
The subsidiary builder used for pose values.
Definition: DataGroupBuilder.h:179
NamedDataBuilder< VectorType > m_vectors
The subsidiary builder used for vector values.
Definition: DataGroupBuilder.h:182
SurgSim::Math::RigidTransform3d PoseType
The type used for poses.
Definition: DataGroup.h:70
double ScalarType
The type used for scalars.
Definition: DataGroup.h:76
SurgSim::Math::Vector3d VectorType
The type used for vectors.
Definition: DataGroup.h:72
NamedDataBuilder< DynamicMatrixType > m_matrices
The subsidiary builder used for matrix values.
Definition: DataGroupBuilder.h:185
DataGroup::StringType StringType
The type used for strings.
Definition: DataGroupBuilder.h:54
NamedVariantDataBuilder & customData()
Provides access to the custom data entries.
Definition: DataGroupBuilder.cpp:117
NamedDataBuilder< ScalarType > & scalars()
Provides access to the scalar value entries.
Definition: DataGroupBuilder.cpp:77
DataGroup::VectorType VectorType
The type used for vectors.
Definition: DataGroupBuilder.h:44
DataGroup::IntegerType IntegerType
The type used for integers.
Definition: DataGroupBuilder.h:50
DataGroup::PoseType PoseType
The type used for poses.
Definition: DataGroupBuilder.h:42
NamedDataBuilder< PoseType > & poses()
Provides access to the pose value entries.
Definition: DataGroupBuilder.cpp:47
NamedDataBuilder< StringType > & strings()
Provides access to the string value entries.
Definition: DataGroupBuilder.cpp:107
void addEntriesFrom(const DataGroupBuilder &builder)
Create new entries from another DataGroupBuilder.
Definition: DataGroupBuilder.cpp:168
void addCustom(const std::string &name)
A shortcut for adding a named custom data entry.
Definition: DataGroupBuilder.cpp:162
void addScalar(const std::string &name)
A shortcut for adding a named scalar entry.
Definition: DataGroupBuilder.cpp:142
DataGroup::BooleanType BooleanType
The type used for booleans.
Definition: DataGroupBuilder.h:52
DataGroup::DynamicMatrixType DynamicMatrixType
The type used for matrices.
Definition: DataGroupBuilder.h:46
A collection of NamedData objects.
Definition: DataGroup.h:66
NamedDataBuilder< BooleanType > m_booleans
The subsidiary builder used for boolean values.
Definition: DataGroupBuilder.h:194
DataGroup::ScalarType ScalarType
The type used for scalars.
Definition: DataGroupBuilder.h:48
void addVector(const std::string &name)
A shortcut for adding a named vector entry.
Definition: DataGroupBuilder.cpp:132
bool BooleanType
The type used for booleans.
Definition: DataGroup.h:80
NamedDataBuilder< BooleanType > & booleans()
Provides access to the Boolean value entries.
Definition: DataGroupBuilder.cpp:97
std::string StringType
The type used for strings.
Definition: DataGroup.h:82
NamedDataBuilder< IntegerType > m_integers
The subsidiary builder used for integer values.
Definition: DataGroupBuilder.h:191
std::shared_ptr< DataGroup > createSharedData() const
Produce a shared pointer to an empty DataGroup object with an immutable set of names and indices...
Definition: DataGroupBuilder.cpp:42
DataGroupBuilder & operator=(const DataGroupBuilder &)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DynamicMatrixType
The type used for matrices.
Definition: DataGroup.h:74
NamedDataBuilder< VectorType > & vectors()
Provides access to the vector value entries.
Definition: DataGroupBuilder.cpp:57
void addBoolean(const std::string &name)
A shortcut for adding a named boolean entry.
Definition: DataGroupBuilder.cpp:152
DataGroup createData() const
Produces a DataGroup object with an immutable set of names and indices.
Definition: DataGroupBuilder.cpp:28
A class that allows you to build a DataGroup structure.
Definition: DataGroupBuilder.h:38
NamedDataBuilder< IntegerType > & integers()
Provides access to the integer value entries.
Definition: DataGroupBuilder.cpp:87
int IntegerType
The type used for integers.
Definition: DataGroup.h:78