34 #ifndef INCLUDED_PathElementTypes_h_GUID_5CC817E5_C7CB_45AE_399D_0B0D39579374 35 #define INCLUDED_PathElementTypes_h_GUID_5CC817E5_C7CB_45AE_399D_0B0D39579374 38 #include <osvr/Common/Export.h> 43 #include <boost/mpl/contains.hpp> 44 #include <boost/operators.hpp> 45 #include <boost/variant/variant.hpp> 46 #include <json/value.h> 50 #include <type_traits> 56 #ifndef OSVR_DOXYGEN_EXTERNAL 70 const char *getTypeName()
const;
83 template <
typename Type>
85 boost::operators<Type> {
114 boost::operators<DeviceElement> {
118 std::string
const &server)
119 : m_devName(deviceName), m_server(server) {}
122 createVRPNDeviceElement(std::string
const &deviceName,
123 std::string
const &server);
128 createDeviceElement(std::string
const &deviceName,
129 std::string
const &server,
130 int port = util::UseDefaultPort);
132 OSVR_COMMON_EXPORT std::string &getDeviceName();
133 OSVR_COMMON_EXPORT std::string
const &getDeviceName()
const;
134 OSVR_COMMON_EXPORT std::string &getServer();
135 OSVR_COMMON_EXPORT std::string
const &getServer()
const;
136 OSVR_COMMON_EXPORT std::string getFullDeviceName()
const;
138 OSVR_COMMON_EXPORT Json::Value &getDescriptor();
139 OSVR_COMMON_EXPORT Json::Value
const &getDescriptor()
const;
143 return m_devName == other.m_devName &&
144 m_server == other.m_server &&
145 m_descriptor == other.m_descriptor;
149 std::string m_devName;
150 std::string m_server;
151 Json::Value m_descriptor;
174 boost::operators<DeviceElement> {
178 AliasElement(std::string
const &source, AliasPriority priority);
182 AliasElement(std::string
const &source);
192 OSVR_COMMON_EXPORT
void setSource(std::string
const &source);
195 OSVR_COMMON_EXPORT std::string &getSource();
197 OSVR_COMMON_EXPORT std::string
const &getSource()
const;
201 OSVR_COMMON_EXPORT AliasPriority &priority();
203 OSVR_COMMON_EXPORT AliasPriority priority()
const;
207 return m_priority == rhs.m_priority && m_source == rhs.m_source;
211 std::string m_source;
212 AliasPriority m_priority;
225 StringElement(std::string
const &s);
228 OSVR_COMMON_EXPORT std::string &getString();
231 OSVR_COMMON_EXPORT std::string
const &getString()
const;
235 return m_val == other.m_val;
245 boost::operators<ArticulationElement> {
249 std::string
const &boneName,
250 std::string
const &trackerPath)
251 : m_articulationType(articulationType), m_boneName(boneName),
252 m_trackerPath(trackerPath) {}
255 OSVR_COMMON_EXPORT
void 256 setArticulationType(std::string
const &articulationType);
259 OSVR_COMMON_EXPORT
void setBoneName(std::string
const &boneName);
262 OSVR_COMMON_EXPORT
void 263 setTrackerPath(std::string
const &trackerPath);
265 OSVR_COMMON_EXPORT std::string &getArticulationType();
266 OSVR_COMMON_EXPORT std::string
const &getArticulationType()
const;
267 OSVR_COMMON_EXPORT std::string &getBoneName();
268 OSVR_COMMON_EXPORT std::string
const &getBoneName()
const;
269 OSVR_COMMON_EXPORT std::string &getTrackerPath();
270 OSVR_COMMON_EXPORT std::string
const &getTrackerPath()
const;
274 return m_articulationType == other.m_articulationType &&
275 m_boneName == other.m_boneName &&
276 m_trackerPath == other.m_trackerPath;
280 std::string m_articulationType;
281 std::string m_boneName;
282 std::string m_trackerPath;
297 static_assert(std::is_base_of<base_type, type>::value,
298 "ElementBase<T> must be the base of an element " 299 "type T (the CRTP)!");
304 boost::mpl::contains<PathElement::types, type>::type::value,
305 "Every element type must be a part of the PathElement variant " 306 "type's bounded type list!");
314 #endif // INCLUDED_PathElementTypes_h_GUID_5CC817E5_C7CB_45AE_399D_0B0D39579374 The element type corresponding to a articulation element.
Definition: PathElementTypes.h:244
EmptyElementBase()
Protected constructor to force subclassing.
Definition: PathElementTypes.h:95
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
bool operator==(StringElement const &other) const
Equality comparison operator.
Definition: PathElementTypes.h:234
The element type corresponding to a path alias, with a priority level for sorting out whether automat...
Definition: PathElementTypes.h:173
Header defining some special values that may be passed to some functions that request a port number t...
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
The element type corresponding to a particular sensor of an interface.
Definition: PathElementTypes.h:163
The element type corresponding to a plugin.
Definition: PathElementTypes.h:106
bool operator==(ArticulationElement const &other) const
Equality comparison operator.
Definition: PathElementTypes.h:273
bool operator==(DeviceElement const &other) const
Equality comparison operator.
Definition: PathElementTypes.h:142
The element type corresponding to a device, which implements 0 or more interfaces.
Definition: PathElementTypes.h:113
bool operator==(AliasElement const &rhs) const
Equality comparison operator.
Definition: PathElementTypes.h:206
bool operator==(EmptyElementBase< Type > const &) const
Trivial equality comparison operator.
Definition: PathElementTypes.h:89
Namespace for the various element types that may constitute a node in the path tree.
Definition: PathElementTools.h:78
Base, using the CRTP, of "empty" path elements (those that don't store additional data but derive the...
Definition: PathElementTypes.h:84
The element type corresponding to a string value such as a JSON string.
Definition: PathElementTypes.h:217
AliasElement()
default constructor
Definition: PathElementTypes.h:185
The element type corresponding to an interface, which often may have one or more sensors.
Definition: PathElementTypes.h:156
ElementBase()
Protected constructor to force subclassing.
Definition: PathElementTypes.h:289
Header forward-declaring the types in PathElementTypes.h and including the PathElement typedef...
Base, using the CRTP, providing some basic functionality for path elements.
Definition: PathElementTypes.h:65
The element type created when requesting a path that isn't yet in the tree.
Definition: PathElementTypes.h:100