8#ifndef META_OCEAN_DEVICES_IOS_MOTION_MANAGER_H
9#define META_OCEAN_DEVICES_IOS_MOTION_MANAGER_H
17#include <CoreMotion/CoreMotion.h>
This class implements a container for callback functions.
Definition Callback.h:3454
Callback< void, CMDeviceMotion * > DeviceMotionCallback
Definition of a callback function to subscribe for new device motion samples.
Definition MotionManager.h:48
DeviceMotionListenerMap deviceMotionListenerMap_
Map storing the set of registered listeners.
Definition MotionManager.h:112
unsigned int nextListenerId_
Counter used to produce a new id when addListener is called.
Definition MotionManager.h:115
CMMotionManager * object()
Returns the instance of the CMMotionManager object hold by this singleton.
void start()
Internally starts the main DeviceMotion callback with CMMotionMap.
bool setObject(CMMotionManager *object)
Sets the instance of the CMMotionManager object explicitly as the application holds the instance alre...
CMMotionManager * motionManager_
The instance of the CMMotionManager object this singleton is responsible for.
Definition MotionManager.h:109
std::unordered_map< ListenerId, DeviceMotionCallback > DeviceMotionListenerMap
Type of an unordered map mapping listener ids to callback functions.
Definition MotionManager.h:55
static constexpr ListenerId invalidListenerId()
Returns an invalid listener id.
Definition MotionManager.h:121
ListenerId addListener(const DeviceMotionCallback &callback)
Register a new listener.
MotionManager()=default
Protected default constructor.
Lock lock_
The manager's lock.
Definition MotionManager.h:118
unsigned int ListenerId
Definition of a listener id for a registered callbacks.
Definition MotionManager.h:43
void removeListener(const ListenerId listenerId)
Unregister a given listener.
This class implements a recursive lock object.
Definition Lock.h:31
Namespace of the Devices IOS library.
Definition devices/ios/IOS.h:20
Namespace of the Devices library.
Definition AccelerationSensor3DOF.h:24
The namespace covering the entire Ocean framework.
Definition Accessor.h:15