OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
68 
71 
74  void update();
75 
79  Interface getInterface(const std::string &path);
80 
85  std::string getStringParameter(const std::string &path);
86 
89  void free(Interface &iface);
90 
97  bool checkStatus() const;
98 
100  OSVR_ClientContext get();
101 
106  void log(OSVR_LogLevel severity, const char* message);
107 
108  private:
109  OSVR_ClientContext m_context;
110  };
111 
112 } // end namespace clientkit
113 
114 } // end namespace osvr
115 #endif // INCLUDED_ClientContext_decl_h_GUID_1EFFF79A_3D9F_4794_9F98_37010949F386
ClientContext(const char applicationIdentifier[], uint32_t flags=0u)
Initialize the library.
Definition: Context.h:45
Interface handle object. Typically acquired from a ClientContext.
Client context object: Create and keep one in your application. Handles lifetime management and provi...
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:115
bool checkStatus() const
Checks to see if the client context is properly and fully started up.
Definition: Context.h:111
The main namespace for all C++ elements of the framework, internal and external.
Definition: ClientKit.h:31
void free(Interface &iface)
Frees an interface before it would normally be freed (at context close).
Definition: Context.h:99
Interface getInterface(const std::string &path)
Get the interface associated with the given path.
Definition: Context.h:61
struct OSVR_ClientContextObject * OSVR_ClientContext
Opaque handle that should be retained by your application. You need only and exactly one...
OSVR_LogLevel
Log message severity levels.
Definition: LogLevelC.h:44
void update()
Updates the state of the context - call regularly in your mainloop.
Definition: Context.h:54
~ClientContext()
Destructor: Shutdown the library.
Definition: Context.h:52
Header.
std::string getStringParameter(const std::string &path)
Get a string parameter value from the given path.
Definition: Context.h:74