MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
fiff_id.h
Go to the documentation of this file.
1//=============================================================================================================
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//=============================================================================================================
69
70public:
71 typedef QSharedPointer<FiffId> SPtr;
72 typedef QSharedPointer<const FiffId> ConstSPtr;
74 //=========================================================================================================
78 FiffId();
79
80 //=========================================================================================================
86 FiffId(const FiffId& p_FiffId);
87
88 //=========================================================================================================
92 ~FiffId();
93
94 //=========================================================================================================
99 static FiffId new_file_id();
100
101 //=========================================================================================================
105 void clear();
106
107 //=========================================================================================================
112 static bool get_machid(int *fixed_id);
113
114 //=========================================================================================================
118 static FiffId& getDefault();
119
120 //=========================================================================================================
125 void print() const;
126
127 //=========================================================================================================
133 inline bool isEmpty() const;
134
135 //=========================================================================================================
141 inline static qint32 storageSize();
142
143 //=========================================================================================================
147 QString toMachidString() const;
148
149 friend bool operator== (const FiffId &f1, const FiffId &f2);
150
151public:
152 fiff_int_t version;
153 fiff_int_t machid[2];
156// ### OLD STRUCT ###
158//* A file ID.
159//*
160//* These universially unique identifiers are also
161//* used to identify blocks within fthe files.
162//*/
163//typedef struct _fiffIdRec {
164// fiff_int_t version; /**< File version. */
165// fiff_int_t machid[2]; /**< Unique machine ID. */
166// fiffTimeRec time; /**< Time of the ID creation. */
167//} fiffIdRec,*fiffId; /**< This is the file identifier. */
168//typedef fiffIdRec fiff_id_t;
169};
170
171//=============================================================================================================
172// INLINE DEFINITIONS
173//=============================================================================================================
174
175inline bool FiffId::isEmpty() const
176{
177 return this->version <= 0;
178}
179
180//=============================================================================================================
181
182inline qint32 FiffId::storageSize()
183{
184 return 20;
185}
186
187//=============================================================================================================
188
189inline bool operator== (const FiffId &a, const FiffId &b)
190{
191 return (a.version == b.version &&
192 a.machid == b.machid &&
193 a.time.secs == b.time.secs &&
194 a.time.usecs == b.time.usecs);
195}
196} // NAMESPACE
197
198#endif // FIFF_ID_H
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:56
Definitions for describing the objects in a FIFF file.
Universially unique identifier.
Definition fiff_id.h:68
fiff_int_t machid[2]
Definition fiff_id.h:153
QSharedPointer< FiffId > SPtr
Definition fiff_id.h:71
bool isEmpty() const
Definition fiff_id.h:175
fiffTimeRec time
Definition fiff_id.h:154
QSharedPointer< const FiffId > ConstSPtr
Definition fiff_id.h:72
static qint32 storageSize()
Definition fiff_id.h:182
fiff_int_t version
Definition fiff_id.h:152