OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
SyncDeviceToken.cpp
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 #define OSVR_DEV_VERBOSE_DISABLE
26 
27 // Internal Includes
28 #include "SyncDeviceToken.h"
30 #include <osvr/Util/Verbosity.h>
32 
33 // Library/third-party includes
34 // - none
35 
36 // Standard includes
37 // - none
38 
39 namespace osvr {
40 namespace connection {
41 
42  SyncDeviceToken::SyncDeviceToken(std::string const &name)
43  : OSVR_DeviceTokenObject(name) {}
44 
45  SyncDeviceToken::~SyncDeviceToken() {}
46 
47  void SyncDeviceToken::m_setUpdateCallback(DeviceUpdateCallback const &cb) {
48  OSVR_DEV_VERBOSE("In SyncDeviceToken::m_setUpdateCallback");
49  m_cb = cb;
50  }
51 
52  void SyncDeviceToken::m_sendData(util::time::TimeValue const &timestamp,
53  MessageType *type, const char *bytestream,
54  size_t len) {
55  m_getConnectionDevice()->sendData(timestamp, type, bytestream, len);
56  }
57 
58  util::GuardPtr SyncDeviceToken::m_getSendGuard() {
59  return util::GuardPtr(new util::DummyGuard);
60  }
61 
62  void SyncDeviceToken::m_connectionInteract() {
63  if (m_cb) {
64  m_cb();
65  }
66  }
67 
68 } // namespace connection
69 } // namespace osvr
A DeviceToken connects the generic device interaction code in PluginKit's C API with the workings of ...
Definition: DeviceToken.h:56
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
Definition: TimeValue.h:48
Internal, configured header file for verbosity macros.