25 #ifndef INCLUDED_InterfaceState_h_GUID_FFF8951B_3677_4EB5_373A_3A1A697AECDE 26 #define INCLUDED_InterfaceState_h_GUID_FFF8951B_3677_4EB5_373A_3A1A697AECDE 38 #include <boost/optional.hpp> 55 template <
typename ReportType>
68 template <
typename ReportType>
70 ReportType
const &report) {
73 c.timestamp = timestamp;
74 typepack::get<ReportType, StateMap>(m_states) = c;
78 template <
typename ReportType>
bool hasState()
const {
80 return m_hasState && bool(typepack::cget<ReportType>(m_states));
83 bool hasAnyState()
const {
return m_hasState; }
85 template <
typename ReportType>
88 if (hasState<ReportType>()) {
89 timestamp = typepack::cget<ReportType>(m_states)->timestamp;
90 state = typepack::cget<ReportType>(m_states)->state;
98 bool m_hasState =
false;
104 #endif // INCLUDED_InterfaceState_h_GUID_FFF8951B_3677_4EB5_373A_3A1A697AECDE typepack::t_< StateType< T >> StateFromReport_t
Alias for the StateType associated with a given ReportType.
Definition: ReportTraits.h:83
A templated type containing state and a timestamp for known, specialized report types.
Definition: InterfaceState.h:47
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
Turn a class template or alias template C into a Alias Class.
Definition: Quote.h:46
Class to maintain state for an interface for each report (and thus state) type explicitly enumerated...
Definition: InterfaceState.h:66
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
typepack::list< OSVR_AnalogReport, OSVR_ButtonReport, OSVR_PoseReport, OSVR_PositionReport, OSVR_OrientationReport, OSVR_VelocityReport, OSVR_LinearVelocityReport, OSVR_AngularVelocityReport, OSVR_AccelerationReport, OSVR_LinearAccelerationReport, OSVR_AngularAccelerationReport, OSVR_ImagingReport, OSVR_ImagingReport, OSVR_Location2DReport, OSVR_DirectionReport, OSVR_EyeTracker2DReport, OSVR_EyeTracker3DReport, OSVR_EyeTrackerBlinkReport, OSVR_NaviVelocityReport, OSVR_NaviPositionReport, OSVR_SkeletonReport > ReportTypeList
A typelist containing all internally-handled report types.
Definition: ReportTypes.h:53
boost::optional< StateMapContents< ReportType >> StateMapValueType
Alias taking a report type and returning a state map value type.
Definition: InterfaceState.h:56
Provides a data structure where a value of heterogeneous data types may be stored at runtime for each...
Definition: TypeKeyedTuple.h:48
traits::StateType< ReportType >::type const & reportState(ReportType const &r)
Generic const accessor for the "state" member of a report.
Definition: ReportState.h:115
Header containing a typelist of all special report types.
void getState(util::time::TimeValue ×tamp, traits::StateFromReport_t< ReportType > &state) const
Definition: InterfaceState.h:86
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