OSVR-Core
Public Types | Public Member Functions | Friends | List of all members
osvr::client::InterfaceTree Class Reference

Holds on to lists of interfaces organized into the tree structure, as well as their associated handlers. More...

#include <InterfaceTree.h>

Public Types

typedef InterfaceTreeValue value_type
 
typedef util::TreeNode< value_typenode_type
 

Public Member Functions

OSVR_CLIENT_EXPORT InterfaceTree ()
 Constructor.
 
OSVR_CLIENT_EXPORT bool addInterface (common::ClientInterfacePtr const &iface)
 Add an interface to the tree. More...
 
OSVR_CLIENT_EXPORT bool removeInterface (common::ClientInterfacePtr const &iface)
 Remove an interface from the tree. More...
 
OSVR_CLIENT_EXPORT common::InterfaceList & getInterfacesForPath (std::string const &path)
 Returns a reference to the list of interfaces registered for a given path. More...
 
OSVR_CLIENT_EXPORT RemoteHandlerPtr getHandlerForPath (std::string const &path)
 Returns the handler for a given path.
 
OSVR_CLIENT_EXPORT RemoteHandlerPtr eraseHandlerForPath (std::string const &path)
 Clears and returns the handler for a given path.
 
OSVR_CLIENT_EXPORT RemoteHandlerPtr replaceHandlerForPath (std::string const &path, RemoteHandlerPtr const &handler)
 Sets the handler for a given path, returning the old handler if any. More...
 
OSVR_CLIENT_EXPORT void updateHandlers ()
 Call the update method on all handlers.
 
OSVR_CLIENT_EXPORT void clearHandlers ()
 Removes all handlers.
 
template<typename F >
void visitPathsWithoutHandlers (F &&func)
 Visit all paths with interfaces in their list but no handler.
 

Friends

class HandlerClearVisitor
 

Detailed Description

Holds on to lists of interfaces organized into the tree structure, as well as their associated handlers.

Member Function Documentation

§ addInterface()

bool osvr::client::InterfaceTree::addInterface ( common::ClientInterfacePtr const &  iface)

Add an interface to the tree.

Returns
true if this is the first interface for that path.

§ getInterfacesForPath()

common::InterfaceList & osvr::client::InterfaceTree::getInterfacesForPath ( std::string const &  path)

Returns a reference to the list of interfaces registered for a given path.

§ removeInterface()

bool osvr::client::InterfaceTree::removeInterface ( common::ClientInterfacePtr const &  iface)

Remove an interface from the tree.

Returns
true if that path no longer has any interfaces.

§ replaceHandlerForPath()

RemoteHandlerPtr osvr::client::InterfaceTree::replaceHandlerForPath ( std::string const &  path,
RemoteHandlerPtr const &  handler 
)

Sets the handler for a given path, returning the old handler if any.


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