OSVR-Core
Classes | Typedefs | Functions
osvr::common::elements Namespace Reference

Namespace for the various element types that may constitute a node in the path tree. More...

Classes

class  AliasElement
 The element type corresponding to a path alias, with a priority level for sorting out whether automatic routes should replace or update it. More...
 
class  ArticulationElement
 The element type corresponding to a articulation element. More...
 
class  DeviceElement
 The element type corresponding to a device, which implements 0 or more interfaces. More...
 
class  ElementBase
 Base, using the CRTP, providing some basic functionality for path elements. More...
 
class  EmptyElementBase
 Base, using the CRTP, of "empty" path elements (those that don't store additional data but derive their meaning from their path) More...
 
class  InterfaceElement
 The element type corresponding to an interface, which often may have one or more sensors. More...
 
class  NullElement
 The element type created when requesting a path that isn't yet in the tree. More...
 
class  PluginElement
 The element type corresponding to a plugin. More...
 
class  SensorElement
 The element type corresponding to a particular sensor of an interface. More...
 
class  StringElement
 The element type corresponding to a string value such as a JSON string. More...
 

Typedefs

typedef boost::variant< NullElement, AliasElement, ArticulationElement, SensorElement, InterfaceElement, DeviceElement, PluginElement, StringElementPathElement
 The variant type containing a particular kind of path element. More...
 

Functions

OSVR_COMMON_EXPORT const char * getTypeName (PathElement const &elt)
 Gets a string that indicates the type of path element. More...
 
template<typename ElementType >
const char * getTypeName ()
 Gets the string that represents the templated type.
 
void ifNullReplaceWith (PathElement &dest, PathElement const &src)
 If dest is a NullElement, replace it with the provided src element. More...
 
bool isNull (PathElement const &elt)
 Returns true if the path element provided is a NullElement.
 
OSVR_COMMON_EXPORT size_t getMaxTypeNameLength ()
 Gets the length of the longest type name.
 

Detailed Description

Namespace for the various element types that may constitute a node in the path tree.

Note that any changes that add/remove data members should result in corresponding serialization changes in src/osvr/Common/PathTreeSerialization.cpp

Typedef Documentation

§ PathElement

The variant type containing a particular kind of path element.

NOTE: if you add an element type here, you must make sure it's:

Note that while most lists of these types are not order sensitive, and so have been sorted, order does matter for the types in this typedef. Above all, NullElement must remain first.

Function Documentation

§ getTypeName()

const char * osvr::common::elements::getTypeName ( PathElement const &  elt)

Gets a string that indicates the type of path element.

Do not use this for conditionals/comparisons unless there's really no better way! (There probably is a better way with a variant static_visitor)

Parameters
eltThe element to investigate.

§ ifNullReplaceWith()

void osvr::common::elements::ifNullReplaceWith ( PathElement dest,
PathElement const &  src 
)

If dest is a NullElement, replace it with the provided src element.

Parameters
destItem to inquire about, and update if needed.
srcReplacement for dest if dest is a NullElement.