25 #ifndef INCLUDED_InterfaceCallbacks_h_GUID_0CE1EE79_D74A_4EAA_CF16_3AABDA3A1B6A 26 #define INCLUDED_InterfaceCallbacks_h_GUID_0CE1EE79_D74A_4EAA_CF16_3AABDA3A1B6A 48 template <
typename ReportType>
49 using apply = std::vector<
50 std::function<void(const OSVR_TimeValue *, const ReportType *)>>;
59 template <
typename CallbackType>
60 void addCallback(CallbackType cb,
void *userdata) {
62 typepack::get<ReportType>(m_callbacks)
65 ReportType
const *report) {
66 cb(userdata, timestamp, report);
70 template <
typename ReportType>
72 ReportType
const &report)
const {
73 for (
auto const &f : typepack::cget<ReportType>(m_callbacks)) {
74 f(×tamp, &report);
78 template <
typename ReportType>
79 std::size_t getNumCallbacksFor(ReportType
const &)
const {
80 return typepack::cget<ReportType>(m_callbacks).
size();
90 #endif // INCLUDED_InterfaceCallbacks_h_GUID_0CE1EE79_D74A_4EAA_CF16_3AABDA3A1B6A Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
typepack::t_< ReportFromCallback< T >> ReportFromCallback_t
Alias for the ReportType associated with a given CallbackType.
Definition: ReportTraits.h:88
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
Header providing common::traits::ReportFromCallback.
Trait computing the storage for callbacks for a report type.
Definition: InterfaceCallbacks.h:47
Header containing a typelist of all special report types.
Header providing a C++ wrapper around TimeValueC.h.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
Class to maintain callbacks for an interface for each report type explicitly enumerated.
Definition: InterfaceCallbacks.h:57