OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::common::RouteContainer Class Reference

Public Member Functions

 RouteContainer ()
 Empty constructor.
 
 RouteContainer (std::string const &routes)
 Constructor from a JSON array of routes.
 
bool addRoute (std::string const &routingDirective)
 Register a JSON string as a routing directive. More...
 
std::string getRoutes (bool styled=false) const
 Get a JSON array of all routing directives. More...
 
std::string getSource (std::string const &destination) const
 Get the source JSON string for a given destination path. More...
 
std::string getSourceAt (size_t i) const
 
std::string getDestinationAt (size_t i) const
 
std::string getRouteForDestination (std::string const &destination) const
 Get the full routing JSON string for a given destination path. More...
 
std::size_t size () const
 Gets the number of directives.
 
std::vector< std::string > const & getRouteList () const
 

Static Public Member Functions

static std::string getDestinationFromString (std::string const &route)
 Gets the destination of a route, given the route in string format.
 
static std::string getSourceFromString (std::string const &route)
 Gets the source of a route, given the route in string format.
 

Detailed Description

Definition at line 40 of file RouteContainer.h.

Member Function Documentation

bool osvr::common::RouteContainer::addRoute ( std::string const &  routingDirective)

Register a JSON string as a routing directive.

Returns
true if the route was new, false if it replaced a previous route for that destination.

Definition at line 84 of file RouteContainer.cpp.

std::string osvr::common::RouteContainer::getRoutes ( bool  styled = false) const

Get a JSON array of all routing directives.

Parameters
styledPass true if you want the result pretty-printed.

Definition at line 89 of file RouteContainer.cpp.

std::string osvr::common::RouteContainer::getSource ( std::string const &  destination) const

Get the source JSON string for a given destination path.

Returns
an empty string if the destination was not found.

Definition at line 101 of file RouteContainer.cpp.

std::string osvr::common::RouteContainer::getRouteForDestination ( std::string const &  destination) const

Get the full routing JSON string for a given destination path.

Returns
an empty string if the destination was not found.

Definition at line 120 of file RouteContainer.cpp.


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