OSVR-Core
Context_decl.h
Go to the documentation of this file.
1 
11 // Copyright 2014 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_ClientContext_decl_h_GUID_1EFFF79A_3D9F_4794_9F98_37010949F386
26 #define INCLUDED_ClientContext_decl_h_GUID_1EFFF79A_3D9F_4794_9F98_37010949F386
27 
28 // Internal Includes
29 // - none
30 
31 // Library/third-party includes
32 // - none
33 
34 // Standard includes
35 // - none
36 
37 // Internal Includes
39 #include <osvr/Util/LogLevelC.h>
40 
41 // Library/third-party includes
42 #include <boost/noncopyable.hpp>
43 
44 // Standard includes
45 #include <string>
46 
47 namespace osvr {
48 
49 namespace clientkit {
50  // Forward declaration
51  class Interface;
52 
57  class ClientContext : private boost::noncopyable {
58  public:
63  ClientContext(const char applicationIdentifier[], uint32_t flags = 0u);
64 
70  ClientContext(const char applicationIdentifier[], const char host[], uint32_t flags = 0u);
71 
75 
78 
81  void update();
82 
86  Interface getInterface(const std::string &path);
87 
92  std::string getStringParameter(const std::string &path);
93 
96  void free(Interface &iface);
97 
104  bool checkStatus() const;
105 
107  OSVR_ClientContext get();
108 
113  void log(OSVR_LogLevel severity, const char* message);
114 
115  private:
116  OSVR_ClientContext m_context;
117  };
118 
119 } // end namespace clientkit
120 
121 } // end namespace osvr
122 #endif // INCLUDED_ClientContext_decl_h_GUID_1EFFF79A_3D9F_4794_9F98_37010949F386
bool checkStatus() const
Checks to see if the client context is properly and fully started up.
Definition: Context.h:116
ClientContext(const char applicationIdentifier[], uint32_t flags=0u)
Initialize the library.
Definition: Context.h:45
Interface handle object.
Definition: Interface_decl.h:54
Client context object: Create and keep one in your application.
Definition: Context_decl.h:57
Header.
void log(OSVR_LogLevel severity, const char *message)
Log a message to the plugin-specific channel.
Definition: Context.h:120
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
void free(Interface &iface)
Frees an interface before it would normally be freed (at context close).
Definition: Context.h:104
Interface getInterface(const std::string &path)
Get the interface associated with the given path.
Definition: Context.h:66
OSVR_LogLevel
Log message severity levels.
Definition: LogLevelC.h:44
Definition: ClientContext.h:50
void update()
Updates the state of the context - call regularly in your mainloop.
Definition: Context.h:59
~ClientContext()
Destructor: Shutdown the library.
Definition: Context.h:57
Header.
std::string getStringParameter(const std::string &path)
Get a string parameter value from the given path.
Definition: Context.h:79