25 #ifndef INCLUDED_InterfaceTree_h_GUID_7F88FD57_3657_4AA6_B725_A1C69AA21ED2
26 #define INCLUDED_InterfaceTree_h_GUID_7F88FD57_3657_4AA6_B725_A1C69AA21ED2
48 RemoteHandlerPtr handler;
49 common::InterfaceList interfaces;
56 typedef util::TreeNode<value_type> node_type;
63 OSVR_CLIENT_EXPORT
bool
69 OSVR_CLIENT_EXPORT
bool
74 OSVR_CLIENT_EXPORT common::InterfaceList &
78 OSVR_CLIENT_EXPORT RemoteHandlerPtr
82 OSVR_CLIENT_EXPORT RemoteHandlerPtr
88 std::string
const &path, RemoteHandlerPtr
const &handler);
99 if (!node.value().handler && !node.value().interfaces.empty()) {
108 node_type &m_getNodeForPath(std::string
const &path);
111 RemoteHandlerPtr m_removeHandler(node_type &node);
114 RemoteHandlerPtr m_setHandler(node_type &node,
115 RemoteHandlerPtr
const &handler);
116 node_type::ptr_type m_root;
123 #endif // INCLUDED_InterfaceTree_h_GUID_7F88FD57_3657_4AA6_B725_A1C69AA21ED2
shared_ptr< ClientInterface > ClientInterfacePtr
Pointer for holding ClientInterface objects safely.
InterfaceTree()
Constructor.
RemoteHandlerPtr getHandlerForPath(std::string const &path)
Returns the handler for a given path.
RemoteHandlerPtr eraseHandlerForPath(std::string const &path)
Clears and returns the handler for a given path.
std::string getTreeNodeFullPath(util::TreeNode< T > const &node, const char pathSeparator[])
Given a tree node and a path separator, get the full path identifying that tree node.
bool addInterface(common::ClientInterfacePtr const &iface)
Add an interface to the tree.
RemoteHandlerPtr replaceHandlerForPath(std::string const &path, RemoteHandlerPtr const &handler)
Sets the handler for a given path, returning the old handler if any.
void traverseWith(T &node, F &&functor)
A method to handle visiting every node in a tree with a lambda or other by-value function object...
void updateHandlers()
Call the update method on all handlers.
common::InterfaceList & getInterfacesForPath(std::string const &path)
Returns a reference to the list of interfaces registered for a given path.
bool removeInterface(common::ClientInterfacePtr const &iface)
Remove an interface from the tree.
Holds on to lists of interfaces organized into the tree structure, as well as their associated handle...
void visitPathsWithoutHandlers(F &&func)
Visit all paths with interfaces in their list but no handler.
void clearHandlers()
Removes all handlers.
Wrapper for a container of handlers.
const char * getPathSeparator()
Gets the path separator - a slash - as a null-terminated string.
Automatically-generated export header - do not edit!