Recursive FIFF block-tree node: block kind, block ID, directly contained directory entries and child sub-blocks. More...
#include <fiff_dir_node.h>
Public Types | |
| using | SPtr = QSharedPointer<FiffDirNode> |
| using | ConstSPtr = QSharedPointer<const FiffDirNode> |
| using | UPtr = std::unique_ptr<FiffDirNode> |
| using | ConstUPtr = std::unique_ptr<const FiffDirNode> |
Public Member Functions | |
| FiffDirNode () | |
| FiffDirNode (const FiffDirNode *p_FiffDirTree) | |
| ~FiffDirNode () | |
| bool | isEmpty () const |
| QList< FiffDirNode::SPtr > | dir_tree_find (fiff_int_t p_kind) const |
| bool | find_tag (QSharedPointer< FiffStream > &p_pStream, fiff_int_t findkind, std::unique_ptr< FiffTag > &p_pTag) const |
| bool | find_tag (FiffStream *p_pStream, fiff_int_t findkind, std::unique_ptr< FiffTag > &p_pTag) const |
| bool | has_tag (fiff_int_t findkind) |
| bool | has_kind (fiff_int_t p_kind) const |
| void | print (QTextStream &out, int indent=0) const |
| fiff_int_t | nent () const |
| fiff_int_t | nchild () const |
Static Public Member Functions | |
| static bool | copy_tree (QSharedPointer< FiffStream > &p_pStreamIn, const FiffId &in_id, const QList< QSharedPointer< FiffDirNode > > &p_Nodes, QSharedPointer< FiffStream > &p_pStreamOut) |
Public Attributes | |
| fiff_int_t | type |
| FiffId | id |
| QList< FiffDirEntry::SPtr > | dir |
| QList< FiffDirEntry::SPtr > | dir_tree |
| fiff_int_t | nent_tree |
| FiffDirNode::SPtr | parent |
| FiffId | parent_id |
| QList< FiffDirNode::SPtr > | children |
Recursive FIFF block-tree node: block kind, block ID, directly contained directory entries and child sub-blocks.
Each node corresponds to one FIFFB_BLOCK_START ... FIFFB_BLOCK_END pair in the on-disk tag stream. The full tree is built once by FiffStream::make_dir_tree after the directory tag is parsed, and is then traversed by every higher-level reader (FiffInfo, FiffRawData, FiffEvoked, FiffCov, ...) via dir_tree_find. The static copy_tree helper streams an entire sub-tree from one FiffStream to another preserving block IDs, which is how MNE-CPP writes derived files that keep provenance back to the source recording.
Definition at line 83 of file fiff_dir_node.h.
| using FIFFLIB::FiffDirNode::ConstSPtr = QSharedPointer<const FiffDirNode> |
Const shared pointer type for FiffDirNode.
Definition at line 87 of file fiff_dir_node.h.
| using FIFFLIB::FiffDirNode::ConstUPtr = std::unique_ptr<const FiffDirNode> |
Const unique pointer type for FiffDirNode.
Definition at line 89 of file fiff_dir_node.h.
| using FIFFLIB::FiffDirNode::SPtr = QSharedPointer<FiffDirNode> |
Shared pointer type for FiffDirNode.
Definition at line 86 of file fiff_dir_node.h.
| using FIFFLIB::FiffDirNode::UPtr = std::unique_ptr<FiffDirNode> |
Unique pointer type for FiffDirNode.
Definition at line 88 of file fiff_dir_node.h.
| FiffDirNode::FiffDirNode | ( | ) |
Constructors the directory tree structure.
Definition at line 45 of file fiff_dir_node.cpp.
| FiffDirNode::FiffDirNode | ( | const FiffDirNode * | p_FiffDirTree | ) |
Copy constructor.
| [in] | p_FiffDirTree | Directory tree structure which should be copied. |
Definition at line 54 of file fiff_dir_node.cpp.
| FiffDirNode::~FiffDirNode | ( | ) |
Destroys the fiffDirTree.
Definition at line 67 of file fiff_dir_node.cpp.
|
static |
Copies directory subtrees from fidin to fidout
| [in] | p_pStreamIn | fiff file to copy from. |
| [in] | in_id | file id description. |
| [in] | p_Nodes | subtree directories to be copied. |
| [out] | p_pStreamOut | fiff file to write to. |
Definition at line 77 of file fiff_dir_node.cpp.
| QList< FiffDirNode::SPtr > FiffDirNode::dir_tree_find | ( | fiff_int_t | p_kind | ) | const |
Find nodes of the given kind from a directory tree structure
| [in] | p_kind | the given kind. |
Definition at line 158 of file fiff_dir_node.cpp.
| bool FIFFLIB::FiffDirNode::find_tag | ( | FiffStream * | p_pStream, |
| fiff_int_t | findkind, | ||
| std::unique_ptr< FiffTag > & | p_pTag ) const |
Definition of the find_tag function in various files e.g. fiff_read_named_matrix.m,
Founds a tag of a given kind within a tree, and reeds it from file. Note: In difference to mne-matlab this is not a static function. This is a method of the FiffDirNode class, that's why a tree object doesn't need to be handed to the function.
| [in] | p_pStream | the opened fif file. |
| [in] | findkind | the kind which should be found. |
| [out] | p_pTag | the found tag. |
|
inline |
Definition of the find_tag function in various files e.g. fiff_read_named_matrix.m,
Founds a tag of a given kind within a tree, and reeds it from file. Note: In difference to mne-matlab this is not a static function. This is a method of the FiffDirNode class, that's why a tree object doesn't need to be handed to the function.
| [in] | p_pStream | the opened fif file. |
| [in] | findkind | the kind which should be found. |
| [out] | p_pTag | the found tag. |
Definition at line 241 of file fiff_dir_node.h.
| bool FiffDirNode::has_kind | ( | fiff_int_t | p_kind | ) | const |
Checks whether a FiffDirNode has a specific kind
| [in] | p_kind | kind to find. |
Definition at line 199 of file fiff_dir_node.cpp.
| bool FiffDirNode::has_tag | ( | fiff_int_t | findkind | ) |
Definition of the has_tag function in fiff_read_named_matrix.m
| [in] | findkind | kind to find. |
Definition at line 189 of file fiff_dir_node.cpp.
|
inline |
Returns true if directory tree structure contains no data.
Definition at line 130 of file fiff_dir_node.h.
| fiff_int_t FiffDirNode::nchild | ( | ) | const |
Returns the number of child nodes
Definition at line 260 of file fiff_dir_node.cpp.
| fiff_int_t FiffDirNode::nent | ( | ) | const |
Returns the number of entries in this node
Definition at line 253 of file fiff_dir_node.cpp.
| void FiffDirNode::print | ( | QTextStream & | out, |
| int | indent = 0 ) const |
Prints this block and its sub-blocks like MNE-C's fiff_dir_tree: one line per block with its id, one line per run of equal tag kinds with the run length in brackets, sub-blocks indented by five.
| [in] | out | Stream to print to. |
| [in] | indent | Indentation of this block. |
Definition at line 223 of file fiff_dir_node.cpp.
| QList<FiffDirNode::SPtr> FIFFLIB::FiffDirNode::children |
Child nodes.
Definition at line 233 of file fiff_dir_node.h.
| QList<FiffDirEntry::SPtr> FIFFLIB::FiffDirNode::dir |
Directory of tags in this node.
Definition at line 226 of file fiff_dir_node.h.
| QList<FiffDirEntry::SPtr> FIFFLIB::FiffDirNode::dir_tree |
Directory of tags within this node subtrees as well as FIFF_BLOCK_START and FIFF_BLOCK_END
Definition at line 228 of file fiff_dir_node.h.
| FiffId FIFFLIB::FiffDirNode::id |
Id of this block if any.
Definition at line 225 of file fiff_dir_node.h.
| fiff_int_t FIFFLIB::FiffDirNode::nent_tree |
Number of entries in the directory tree node.
Definition at line 230 of file fiff_dir_node.h.
| FiffDirNode::SPtr FIFFLIB::FiffDirNode::parent |
Parent node.
Definition at line 231 of file fiff_dir_node.h.
| FiffId FIFFLIB::FiffDirNode::parent_id |
Newly added to stay consistent with MATLAB implementation.
Definition at line 232 of file fiff_dir_node.h.
| fiff_int_t FIFFLIB::FiffDirNode::type |
Block type for this directory.
Definition at line 224 of file fiff_dir_node.h.