37 #include <json/value.h>
40 #include <unordered_set>
51 const char appId[],
const char host[], vrpn_ConnectionPtr
const &conn,
52 common::ClientContextDeleter del)
54 m_ifaceMgr(m_pathTreeOwner, m_factory,
55 *static_cast<common::ClientContext *>(this)) {
58 populateRemoteHandlerFactory(m_factory, m_vrpnConns);
60 m_vrpnConns.addConnection(m_mainConn,
"localhost");
61 m_vrpnConns.addConnection(m_mainConn, host);
62 std::string sysDeviceName =
64 m_mainConn = m_vrpnConns.getConnection(
71 using DedupJsonFunction =
73 m_systemComponent->registerReplaceTreeHandler(
74 DedupJsonFunction([&](Json::Value nodes) {
76 OSVR_DEV_VERBOSE(
"Got updated path tree, processing");
86 AnalysisClientContext::~AnalysisClientContext() {}
88 void AnalysisClientContext::m_update() {
91 m_systemDevice->update();
96 void AnalysisClientContext::m_sendRoute(std::string
const &route) {
97 m_systemComponent->sendClientRouteUpdate(route);
101 void AnalysisClientContext::m_handleNewInterface(
106 void AnalysisClientContext::m_handleReleasingInterface(
108 m_ifaceMgr.releaseInterface(iface);
111 bool AnalysisClientContext::m_getStatus()
const {
112 return bool(m_pathTreeOwner);
115 common::PathTree
const &AnalysisClientContext::m_getPathTree()
const {
116 return m_pathTreeOwner.
get();
void replaceTree(Json::Value const &nodes)
Replace the entirety of the path tree from the given serialized array of nodes.
shared_ptr< ClientInterface > ClientInterfacePtr
Pointer for holding ClientInterface objects safely.
BaseDevicePtr createClientDevice(std::string const &name, vrpn_ConnectionPtr const &conn)
Factory function for a bare client device with no components/interfaces registered by default...
Header including PathTree.h and all additional headers needed to define related types.
AnalysisClientContext(const char appId[], const char host[], vrpn_ConnectionPtr const &conn, common::ClientContextDeleter del)
static shared_ptr< SystemComponent > create()
Factory method.
void addInterface(common::ClientInterfacePtr const &iface, bool verboseFailure=true)
Internal, configured header file for verbosity macros.
static const char * deviceName()
Get the special device name to be used with this component.
void updateHandlers()
run update on all remote handlers
A wrapper for a unary function that only calls its contained function when the input has changed...
PathTree & get()
Access the path tree object itself.