OSVR-Core
JointClientContext.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_JointClientContext_h_GUID_A27BCE12_7FFD_4FA8_C320_5D61AE94BC50
26 #define INCLUDED_JointClientContext_h_GUID_A27BCE12_7FFD_4FA8_C320_5D61AE94BC50
27 
28 // Internal Includes
29 #include "../Client/VRPNConnectionCollection.h"
36 #include <osvr/Common/PathTree.h>
39 #include <osvr/Common/Transform.h>
40 #include <osvr/Server/ServerPtr.h>
42 
43 // Library/third-party includes
44 #include <json/value.h>
45 #include <vrpn_ConnectionPtr.h>
46 
47 // Standard includes
48 #include <string>
49 
50 namespace osvr {
51 namespace client {
52 
54  public:
55  JointClientContext(const char appId[],
56  common::ClientContextDeleter del);
57  virtual ~JointClientContext();
58 
59  server::Server &getServer() {
60  auto pin = m_server;
61  return *pin;
62  }
63  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
64  private:
65  void m_update() override;
66  void m_sendRoute(std::string const &route) override;
67 
70  void
71  m_handleNewInterface(common::ClientInterfacePtr const &iface) override;
72 
76  void m_handleReleasingInterface(
77  common::ClientInterfacePtr const &iface) override;
78 
79  common::PathTree const &m_getPathTree() const override;
80 
81  common::Transform const &m_getRoomToWorldTransform() const override {
82  return m_roomToWorld;
83  }
84 
85  void
86  m_setRoomToWorldTransform(common::Transform const &xform) override {
87  m_roomToWorld = xform;
88  }
89 
90  bool m_getStatus() const override;
91 
93  vrpn_ConnectionPtr m_mainConn;
94 
95  server::ServerPtr m_server;
96 
98  common::BaseDevicePtr m_systemDevice;
99 
102  common::SystemComponent *m_systemComponent;
103 
105  VRPNConnectionCollection m_vrpnConns;
106 
108  common::PathTreeOwner m_pathTreeOwner;
109 
111  RemoteHandlerFactory m_factory;
112 
114  common::Transform m_roomToWorld;
115 
118  ClientInterfaceObjectManager m_ifaceMgr;
119  };
120 } // namespace client
121 } // namespace osvr
122 #endif // INCLUDED_JointClientContext_h_GUID_A27BCE12_7FFD_4FA8_C320_5D61AE94BC50
Definition: RemoteHandlerFactory.h:47
shared_ptr< ClientInterface > ClientInterfacePtr
Pointer for holding ClientInterface objects safely.
Definition: ClientInterfacePtr.h:43
Header.
A tree representation, with path/url syntax, of the known OSVR system.
Definition: PathTree.h:43
Header.
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Class handling a run-loop with a registration context and connection.
Definition: Server.h:67
Class hiding the details of the interaction of the path tree and interface objects/osvr::client::Inte...
Definition: ClientInterfaceObjectManager.h:59
Object responsible for owning a path tree (specifically a "downstream"/client path tree)...
Definition: PathTreeOwner.h:48
JointClientContext(const char appId[], common::ClientContextDeleter del)
Definition: JointClientContext.cpp:53
Header.
shared_ptr< Server > ServerPtr
How one should hold a Server.
Definition: ServerPtr.h:39
Definition: ClientContext.h:50
Definition: VRPNConnectionCollection.h:42
Definition: JointClientContext.h:53
BaseDevice component, to be used only with the "OSVR" special device.
Definition: SystemComponent.h:76
Header forward-declaring TimeValue C++ API.
Spatial transformation, consisting of both pre and post components.
Definition: Transform.h:44