OSVR-Core
ClientInterfaceObjectManager.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_ClientInterfaceObjectManager_h_GUID_DEA36722_2353_4980_2CF5_666C5D531004
26 #define INCLUDED_ClientInterfaceObjectManager_h_GUID_DEA36722_2353_4980_2CF5_666C5D531004
27 
28 // Internal Includes
29 #include <osvr/Client/Export.h>
32 #include <osvr/Util/Logger.h>
36 
37 // Library/third-party includes
38 // - none
39 
40 // Standard includes
41 #include <string>
42 
43 namespace osvr {
44 namespace common {
45  class PathTree;
46  class PathTreeOwner;
47 } // namespace common
48 namespace client {
49  class RemoteHandlerFactory;
50 
60  public:
61  OSVR_CLIENT_EXPORT
63  RemoteHandlerFactory &handlerFactory,
65  ClientInterfaceObjectManager &
66  operator=(ClientInterfaceObjectManager const &) = delete;
67 
72  OSVR_CLIENT_EXPORT void
73  addInterface(common::ClientInterfacePtr const &iface,
74  bool verboseFailure = true);
75  OSVR_CLIENT_EXPORT void
76  releaseInterface(common::ClientInterfacePtr const &iface);
77 
79  OSVR_CLIENT_EXPORT void updateHandlers();
80 
81  private:
87  bool m_connectCallbacksOnPath(std::string const &path,
88  bool verboseFailure = true);
89 
92  void m_removeCallbacksOnPath(std::string const &path);
93 
96  void m_connectNeededCallbacks();
97 
99  util::log::LoggerPtr const &logger() const;
100 
103  InterfaceTree m_interfaces;
104 
107  common::PathTree &m_pathTree;
108 
111  common::PathTreeObserverPtr m_treeObserver;
112 
114  RemoteHandlerFactory &m_factory;
115 
117  common::ClientContext *m_ctx;
118  };
119 } // namespace client
120 } // namespace osvr
121 
122 #endif // INCLUDED_ClientInterfaceObjectManager_h_GUID_DEA36722_2353_4980_2CF5_666C5D531004
Definition: RemoteHandlerFactory.h:47
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
shared_ptr< ClientInterface > ClientInterfacePtr
Pointer for holding ClientInterface objects safely.
Definition: ClientInterfacePtr.h:43
A tree representation, with path/url syntax, of the known OSVR system.
Definition: PathTree.h:43
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
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
Holds on to lists of interfaces organized into the tree structure, as well as their associated handle...
Definition: InterfaceTree.h:53
Definition: ClientContext.h:50
Header to include for OSVR-internal usage of the logging mechanism: provides the needed definition of...