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.
A templated type containing state and a timestamp for known, specialized report types.
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 > ReportTypeList
A typelist containing all internally-handled report types.
Class to maintain state for an interface for each report (and thus state) type explicitly enumerated...
void getState(util::time::TimeValue ×tamp, traits::StateFromReport_t< ReportType > &state) const
boost::optional< StateMapContents< ReportType >> StateMapValueType
Alias taking a report type and returning a state map value type.
Provides a data structure where a value of heterogeneous data types may be stored at runtime for each...
traits::StateType< ReportType >::type const & reportState(ReportType const &r)
Generic const accessor for the "state" member of a report.
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...