MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
fiff_dir_node.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef FIFF_DIR_NODE_H
38#define FIFF_DIR_NODE_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fiff_global.h"
45#include "fiff_constants.h"
46#include "fiff_types.h"
47#include "fiff_dir_entry.h"
48#include "fiff_id.h"
49
50//=============================================================================================================
51// QT INCLUDES
52//=============================================================================================================
53
54#include <QList>
55#include <QSharedPointer>
56#include <QStringList>
57
58//=============================================================================================================
59// DEFINE NAMESPACE FIFFLIB
60//=============================================================================================================
61
62namespace FIFFLIB
63{
64
65class FiffStream;
66class FiffTag;
67
68//=============================================================================================================
75public:
76 typedef QSharedPointer<FiffDirNode> SPtr;
77 typedef QSharedPointer<const FiffDirNode> ConstSPtr;
79 //=========================================================================================================
84
85 //=========================================================================================================
91 FiffDirNode(const FiffDirNode* p_FiffDirTree);
92
93 //=========================================================================================================
98
99 //=========================================================================================================
112 static bool copy_tree(QSharedPointer<FiffStream>& p_pStreamIn, const FiffId& in_id, const QList< QSharedPointer<FiffDirNode> >& p_Nodes, QSharedPointer<FiffStream>& p_pStreamOut);
113
114 //=========================================================================================================
120 inline bool isEmpty() const
121 {
122 return this->type < 0;
123 }
124
125 //=========================================================================================================
136 QList<FiffDirNode::SPtr> dir_tree_find(fiff_int_t p_kind) const;
137
138 //=========================================================================================================
153 inline bool find_tag(QSharedPointer<FiffStream>& p_pStream, fiff_int_t findkind, QSharedPointer<FiffTag>& p_pTag) const;
154
155 //=========================================================================================================
170 bool find_tag(FiffStream* p_pStream, fiff_int_t findkind, QSharedPointer<FiffTag>& p_pTag) const;
171
172 //=========================================================================================================
180 bool has_tag(fiff_int_t findkind);
181
182 //=========================================================================================================
190 bool has_kind(fiff_int_t p_kind) const;
191
192 //=========================================================================================================
199 void print(int indent) const;
200
201 //=========================================================================================================
208 static void explain_block(int kind);
209
210 //=========================================================================================================
217 static void explain (int kind);
218
219 //=========================================================================================================
226 static const char *get_tag_explanation (int kind);
227
228 //=========================================================================================================
234 fiff_int_t nent() const;
235
236 //=========================================================================================================
242 fiff_int_t nchild() const;
243
244public:
245 fiff_int_t type;
247 QList<FiffDirEntry::SPtr> dir;
248// fiff_int_t nent; /**< Number of entries in this node. */
249 QList<FiffDirEntry::SPtr> dir_tree;
251 fiff_int_t nent_tree;
254 QList<FiffDirNode::SPtr> children;
255// fiff_int_t nchild; /**< Number of child nodes. */ -> use nchild() instead
256
257 // typedef struct _fiffDirNode {
258 // int type; /**< Block type for this directory *
259 // fiffId id; /**< Id of this block if any *
260 // fiffDirEntry dir; /**< Directory of tags in this node *
261 // int nent; /**< Number of entries in this node *
262 // fiffDirEntry dir_tree; /**< Directory of tags within this node
263 // * subtrees as well as FIFF_BLOCK_START and FIFF_BLOCK_END
264 // * included. NOTE: While dir is allocated separately
265 // * dir_tree is a pointer to the dirtree field
266 // * in the FiffStream structure. The dir_tree and nent_tree
267 // * fields are only used within the library to facilitate
268 // * certain operations. *
269 // int nent_tree; /**< Number of entries in the directory tree node *
270 // struct _fiffDirNode *parent; /**< Parent node *
271 // struct _fiffDirNode **children; /**< Child nodes *
272 // int nchild; /**< Number of child nodes *
273 // } fiffDirNodeRec,*fiffDirNode; /**< Directory tree structure used by the fiff library routines. *
274};
275
276//=============================================================================================================
277// INLINE DEFINITIONS
278//=============================================================================================================
279
280inline bool FiffDirNode::find_tag(QSharedPointer<FiffStream> &p_pStream, fiff_int_t findkind, QSharedPointer<FiffTag> &p_pTag) const
281{
282 return find_tag(p_pStream.data(), findkind, p_pTag);
283}
284} // NAMESPACE
285
286#endif // FIFF_DIR_NODE_H
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:56
Fiff constants.
FiffDirEntry class declaration.
FiffId class declaration.
Definitions for describing the objects in a FIFF file.
Directory Node structure.
QList< FiffDirNode::SPtr > children
QSharedPointer< const FiffDirNode > ConstSPtr
QSharedPointer< FiffDirNode > SPtr
FiffDirNode::SPtr parent
bool find_tag(QSharedPointer< FiffStream > &p_pStream, fiff_int_t findkind, QSharedPointer< FiffTag > &p_pTag) const
bool find_tag(FiffStream *p_pStream, fiff_int_t findkind, QSharedPointer< FiffTag > &p_pTag) const
QList< FiffDirEntry::SPtr > dir
QList< FiffDirEntry::SPtr > dir_tree
Universially unique identifier.
Definition fiff_id.h:68
FIFF File I/O routines.