25 #ifndef INCLUDED_RouteContainer_h_GUID_EA5F3FB5_13E4_4299_5B39_1C986BC8E784 26 #define INCLUDED_RouteContainer_h_GUID_EA5F3FB5_13E4_4299_5B39_1C986BC8E784 29 #include <osvr/Common/Export.h> 46 OSVR_COMMON_EXPORT
explicit RouteContainer(std::string
const &routes);
51 OSVR_COMMON_EXPORT
bool addRoute(std::string
const &routingDirective);
55 OSVR_COMMON_EXPORT std::string
getRoutes(
bool styled =
false)
const;
59 OSVR_COMMON_EXPORT std::string
60 getSource(std::string
const &destination)
const;
62 OSVR_COMMON_EXPORT std::string getSourceAt(
size_t i)
const;
64 OSVR_COMMON_EXPORT std::string getDestinationAt(
size_t i)
const;
69 OSVR_COMMON_EXPORT std::string
73 std::size_t
size()
const {
return m_routingDirectives.size(); }
75 std::vector<std::string>
const &getRouteList()
const {
76 return m_routingDirectives;
81 OSVR_COMMON_EXPORT
static std::string
85 OSVR_COMMON_EXPORT
static std::string
93 bool m_addRoute(std::string
const &destination,
94 std::string
const &directive);
95 std::vector<std::string> m_routingDirectives;
99 #endif // INCLUDED_RouteContainer_h_GUID_EA5F3FB5_13E4_4299_5B39_1C986BC8E784 static OSVR_COMMON_EXPORT std::string getDestinationFromString(std::string const &route)
Gets the destination of a route, given the route in string format.
Definition: RouteContainer.cpp:135
static OSVR_COMMON_EXPORT std::string getSourceFromString(std::string const &route)
Gets the source of a route, given the route in string format.
Definition: RouteContainer.cpp:138
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
OSVR_COMMON_EXPORT RouteContainer()
Empty constructor.
Definition: RouteContainer.cpp:68
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
OSVR_COMMON_EXPORT std::string getRouteForDestination(std::string const &destination) const
Get the full routing JSON string for a given destination path.
Definition: RouteContainer.cpp:120
std::size_t size() const
Gets the number of directives.
Definition: RouteContainer.h:73
OSVR_COMMON_EXPORT std::string getRoutes(bool styled=false) const
Get a JSON array of all routing directives.
Definition: RouteContainer.cpp:89
OSVR_COMMON_EXPORT std::string getSource(std::string const &destination) const
Get the source JSON string for a given destination path.
Definition: RouteContainer.cpp:101
Definition: RouteContainer.h:40
OSVR_COMMON_EXPORT bool addRoute(std::string const &routingDirective)
Register a JSON string as a routing directive.
Definition: RouteContainer.cpp:84