int ServerImpl::m_handleUpdatedRoute(void *userdata, vrpn_HANDLERPARAM p) { auto self = static_cast<ServerImpl *>(userdata); BOOST_ASSERT_MSG( self->m_inServerThread(), "This callback should never happen outside the server thread!"); self->m_log->info() << "Got an updated route from a client."; self->m_addRoute(std::string(p.buffer, p.payload_len)); return 0; }
RouteContainer::RouteContainer(std::string const &routes) { Json::Reader reader; Json::Value routesVal; if (!reader.parse(routes, routesVal)) { throw std::runtime_error("Invalid JSON routing directive array: " + routes); } for (Json::ArrayIndex i = 0, e = routesVal.size(); i < e; ++i) { const Json::Value thisRoute = routesVal[i]; m_addRoute(getDestinationFromJson(thisRoute), toFastString(thisRoute)); } }
int ServerImpl::m_handleUpdatedRoute(void *userdata, vrpn_HANDLERPARAM p) { auto self = static_cast<ServerImpl *>(userdata); OSVR_DEV_VERBOSE("Got an updated route from a client."); self->m_addRoute(std::string(p.buffer, p.payload_len)); return 0; }
bool ServerImpl::addRoute(std::string const &routingDirective) { bool wasNew; m_callControlled([&] { wasNew = m_addRoute(routingDirective); }); return wasNew; }
bool RouteContainer::addRoute(std::string const &routingDirective) { auto route = parseRoutingDirective(routingDirective); return m_addRoute(getDestinationFromJson(route), routingDirective); }