IMUEvent.h
Go to the documentation of this file.
1/*
2 * IMUEvent.h
3 *
4 * Created on: Mar 16, 2014
5 * Author: Dr.-Ing. David Israel González Aguirre
6 * Mail: david.gonzalez@kit.edu
7 */
8
9#pragma once
10
11#include "IMUHelpers.h"
12#include "IMUState.h"
13
14namespace IMU
15{
16 class CIMUDevice;
17
19 {
20 public:
22 {
23 eOnIMUStart = 0X0001,
24 eOnIMUStop = 0X0002,
25 eOnIMUCycle = 0X0004,
29 };
30
31 CIMUEvent(const timeval& TimeStamp,
32 const EventType EventType,
33 const CIMUDevice* pIMUDevice,
34 const IMUState& EventState);
35 CIMUEvent(const timeval& TimeStamp,
36 const EventType EventType,
37 const CIMUDevice* pIMUDevice);
38 CIMUEvent(const EventType EventType, const CIMUDevice* pIMUDevice);
39 CIMUEvent(const CIMUEvent& Event);
40 CIMUEvent();
41
42 virtual ~CIMUEvent();
43
44 inline uint32_t
45 GetId() const
46 {
47 return m_Id;
48 }
49
50 inline EventType
52 {
53 return m_EventType;
54 }
55
56 inline const CIMUDevice*
57 GetIMU() const
58 {
59 return m_pIMUDevice;
60 }
61
62 inline const timeval&
64 {
65 return m_TimeStamp;
66 }
67
68 protected:
69 uint32_t m_Id;
70 const timeval m_TimeStamp;
74
75 private:
76 static uint32_t CreatId();
77 static uint32_t s_IdCounter;
78 static pthread_mutex_t s_IdCounterMutex;
79 };
80} // namespace IMU
This class contains the the devices module and the thread for read the measurements.
Definition IMUDevice.h:42
uint32_t m_Id
Definition IMUEvent.h:69
@ eOnIMUIntegratedState
Definition IMUEvent.h:27
const timeval & GetTimeStamp() const
Definition IMUEvent.h:63
CIMUEvent(const timeval &TimeStamp, const EventType EventType, const CIMUDevice *pIMUDevice, const IMUState &EventState)
Definition IMUEvent.cpp:18
EventType GetEventType() const
Definition IMUEvent.h:51
const EventType m_EventType
Definition IMUEvent.h:71
const timeval m_TimeStamp
Definition IMUEvent.h:70
virtual ~CIMUEvent()
uint32_t GetId() const
Definition IMUEvent.h:45
const CIMUDevice * m_pIMUDevice
Definition IMUEvent.h:72
const IMUState m_IMUState
Definition IMUEvent.h:73
const CIMUDevice * GetIMU() const
Definition IMUEvent.h:57