v2.0.0
Loading...
Searching...
No Matches
fiff_id.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FIFF_ID_H
38#define FIFF_ID_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fiff_global.h"
45#include "fiff_types.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QSharedPointer>
52
53//=============================================================================================================
54// DEFINE NAMESPACE FIFFLIB
55//=============================================================================================================
56
57namespace FIFFLIB
58{
59
60//=============================================================================================================
66
68
69public:
70 typedef QSharedPointer<FiffId> SPtr;
71 typedef QSharedPointer<const FiffId> ConstSPtr;
72
73 //=========================================================================================================
77 FiffId();
78
79 //=========================================================================================================
85 FiffId(const FiffId& p_FiffId);
86
87 //=========================================================================================================
91 ~FiffId();
92
93 //=========================================================================================================
99 static FiffId new_file_id();
100
101 //=========================================================================================================
105 void clear();
106
107 //=========================================================================================================
115 static bool get_machid(int *fixed_id);
116
117 //=========================================================================================================
123 static FiffId& getDefault();
124
125 //=========================================================================================================
129 void print() const;
130
131 //=========================================================================================================
137 inline bool isEmpty() const;
138
139 //=========================================================================================================
145 inline static qint32 storageSize();
146
147 //=========================================================================================================
153 QString toMachidString() const;
154
163 friend bool operator== (const FiffId &f1, const FiffId &f2);
164
165public:
169
170};
171
172//=============================================================================================================
173// INLINE DEFINITIONS
174//=============================================================================================================
175
176inline bool FiffId::isEmpty() const
177{
178 return this->version <= 0;
179}
180
181//=============================================================================================================
182
183inline qint32 FiffId::storageSize()
184{
185 return sizeof(FiffId::version) + sizeof(FiffId::machid) + FiffTime::storageSize();
186}
187
188//=============================================================================================================
189
190inline bool operator== (const FiffId &a, const FiffId &b)
191{
192 return (a.version == b.version &&
193 a.machid[0] == b.machid[0] &&
194 a.machid[1] == b.machid[1] &&
195 a.time.secs == b.time.secs &&
196 a.time.usecs == b.time.usecs);
197}
198} // NAMESPACE
199
200#endif // FIFF_ID_H
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:52
Old fiff_type declarations - replace them.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
qint32 fiff_int_t
Definition fiff_types.h:89
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
fiff_int_t machid[2]
Definition fiff_id.h:167
QSharedPointer< FiffId > SPtr
Definition fiff_id.h:70
bool isEmpty() const
Definition fiff_id.h:176
QString toMachidString() const
Definition fiff_id.cpp:175
FiffTime time
Definition fiff_id.h:168
static bool get_machid(int *fixed_id)
Definition fiff_id.cpp:126
QSharedPointer< const FiffId > ConstSPtr
Definition fiff_id.h:71
static qint32 storageSize()
Definition fiff_id.h:183
static FiffId new_file_id()
Definition fiff_id.cpp:85
fiff_int_t version
Definition fiff_id.h:166
void print() const
Definition fiff_id.cpp:164
static FiffId & getDefault()
Definition fiff_id.cpp:210
Time stamp record storing seconds and microseconds since epoch.
Definition fiff_time.h:61
static qint32 storageSize()
Definition fiff_time.h:109