v2.0.0
Loading...
Searching...
No Matches
fiff_time.h
Go to the documentation of this file.
1//=============================================================================================================
20
21#ifndef FIFF_TIME_H
22#define FIFF_TIME_H
23
24//=============================================================================================================
25// INCLUDES
26//=============================================================================================================
27
28#include "fiff_global.h"
29
30#include <QtGlobal>
31
32//=============================================================================================================
33// DEFINE NAMESPACE FIFFLIB
34//=============================================================================================================
35
36namespace FIFFLIB
37{
38
39//=============================================================================================================
48
50{
51public:
52 //=========================================================================================================
57 : secs(0)
58 , usecs(0)
59 {
60 }
61
62 //=========================================================================================================
69 FiffTime(qint32 p_secs, qint32 p_usecs)
70 : secs(p_secs)
71 , usecs(p_usecs)
72 {
73 }
74
75 //=========================================================================================================
79 ~FiffTime() = default;
80
81 //=========================================================================================================
87 inline static qint32 storageSize();
88
89public:
90 qint32 secs;
91 qint32 usecs;
92};
93
94//=============================================================================================================
95// INLINE DEFINITIONS
96//=============================================================================================================
97
98inline qint32 FiffTime::storageSize()
99{
100 return sizeof(FiffTime::secs) + sizeof(FiffTime::usecs);
101}
102
103//=============================================================================================================
104
113inline bool operator==(const FiffTime& a, const FiffTime& b)
114{
115 return (a.secs == b.secs && a.usecs == b.usecs);
116}
117
118//=============================================================================================================
119
128inline bool operator!=(const FiffTime& a, const FiffTime& b)
129{
130 return !(a == b);
131}
132
133} // NAMESPACE FIFFLIB
134
135#endif // FIFF_TIME_H
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:44
FIFF file I/O, in-memory data structures and high-level readers/writers.
bool operator!=(const FiffTime &a, const FiffTime &b)
Definition fiff_time.h:128
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
FIFF time stamp: Unix seconds plus a microsecond fraction matching the on-disk fiffTimeRec record.
Definition fiff_time.h:50
~FiffTime()=default
static qint32 storageSize()
Definition fiff_time.h:98
FiffTime(qint32 p_secs, qint32 p_usecs)
Definition fiff_time.h:69