MNE-CPP  beta 1.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FIFFLIB::FiffDirTree Class Reference

Directory tree structure. More...

#include <fiff_dir_tree.h>

Public Types

typedef QSharedPointer< FiffDirTreeSPtr
 
typedef QSharedPointer< const FiffDirTreeConstSPtr
 

Public Member Functions

 FiffDirTree ()
 
 FiffDirTree (const FiffDirTree &p_FiffDirTree)
 
 ~FiffDirTree ()
 
void clear ()
 
bool isEmpty () const
 
QList< FiffDirTreedir_tree_find (fiff_int_t p_kind) const
 
bool find_tag (FiffStream *p_pStream, fiff_int_t findkind, QSharedPointer< FiffTag > &p_pTag) const
 
bool has_tag (fiff_int_t findkind)
 
bool has_kind (fiff_int_t p_kind) const
 

Static Public Member Functions

static bool copy_tree (QSharedPointer< FiffStream > p_pStreamIn, FiffId &in_id, QList< FiffDirTree > &p_Nodes, QSharedPointer< FiffStream > p_pStreamOut)
 
static qint32 make_dir_tree (FiffStream *p_pStream, QList< FiffDirEntry > &p_Dir, FiffDirTree &p_Tree, qint32 start=0)
 

Public Attributes

fiff_int_t block
 
FiffId id
 
FiffId parent_id
 
QList< FiffDirEntrydir
 
fiff_int_t nent
 
fiff_int_t nent_tree
 
QList< FiffDirTreechildren
 
fiff_int_t nchild
 

Detailed Description

Directory tree structure.

Replaces _fiffDirNode struct

Definition at line 80 of file fiff_dir_tree.h.

Member Typedef Documentation

typedef QSharedPointer<const FiffDirTree> FIFFLIB::FiffDirTree::ConstSPtr

Const shared pointer type for FiffDirTree.

Definition at line 84 of file fiff_dir_tree.h.

typedef QSharedPointer<FiffDirTree> FIFFLIB::FiffDirTree::SPtr

Shared pointer type for FiffDirTree.

Definition at line 83 of file fiff_dir_tree.h.

Constructor & Destructor Documentation

FiffDirTree::FiffDirTree ( )

Constructors the directory tree structure.

Definition at line 62 of file fiff_dir_tree.cpp.

FiffDirTree::FiffDirTree ( const FiffDirTree p_FiffDirTree)

Copy constructor.

Parameters
[in]p_FiffDirTreeDirectory tree structure which should be copied

Definition at line 73 of file fiff_dir_tree.cpp.

FiffDirTree::~FiffDirTree ( )

Destroys the fiffDirTree.

Definition at line 89 of file fiff_dir_tree.cpp.

Member Function Documentation

void FiffDirTree::clear ( )

Initializes directory tree structure.

Definition at line 100 of file fiff_dir_tree.cpp.

bool FiffDirTree::copy_tree ( QSharedPointer< FiffStream p_pStreamIn,
FiffId in_id,
QList< FiffDirTree > &  p_Nodes,
QSharedPointer< FiffStream p_pStreamOut 
)
static

MNE toolbox root function ###: Implementation of the fiff_copy_tree function

Copies directory subtrees from fidin to fidout

Parameters
[in]p_pStreamInfiff file to copy from
[in]in_idfile id description
[out]p_Nodessubtree directories to be copied
[in]p_pStreamOutfiff file to write to
Returns
true if succeeded, false otherwise

Definition at line 115 of file fiff_dir_tree.cpp.

QList< FiffDirTree > FiffDirTree::dir_tree_find ( fiff_int_t  p_kind) const

MNE toolbox root function ###: implementation of the fiff_dir_tree_find function

Find nodes of the given kind from a directory tree structure

Parameters
[in]p_kindthe given kind
Returns
list of the found nodes

Definition at line 293 of file fiff_dir_tree.cpp.

bool FiffDirTree::find_tag ( FiffStream p_pStream,
fiff_int_t  findkind,
QSharedPointer< FiffTag > &  p_pTag 
) const

Implementation 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 FiffDirTree class, that's why a tree object doesn't need to be handed to the function.

Parameters
[in]p_pStreamthe opened fif file
[in]findkindthe kind which should be found
[out]p_pTagthe found tag
Returns
true if found, false otherwise

Definition at line 309 of file fiff_dir_tree.cpp.

bool FiffDirTree::has_kind ( fiff_int_t  p_kind) const

Checks whether a DirTree has a specific kind

Parameters
[in]findkindkind to find
Returns
true when fiff_dir_tree contains kind

Definition at line 338 of file fiff_dir_tree.cpp.

bool FiffDirTree::has_tag ( fiff_int_t  findkind)

Implementation of the has_tag function in fiff_read_named_matrix.m

Parameters
[in]findkindkind to find
Returns
true when fiff_dir_tree contains kind

Definition at line 328 of file fiff_dir_tree.cpp.

bool FIFFLIB::FiffDirTree::isEmpty ( ) const
inline

Returns true if directory tree structure contains no data.

Returns
true if directory tree structure is empty.

Definition at line 133 of file fiff_dir_tree.h.

qint32 FiffDirTree::make_dir_tree ( FiffStream p_pStream,
QList< FiffDirEntry > &  p_Dir,
FiffDirTree p_Tree,
qint32  start = 0 
)
static

MNE toolbox root function ###: Implementation of the fiff_make_dir_tree function

Create the directory tree structure

Parameters
[in]p_pStreamthe opened fiff file
[in]p_Dirthe dir entries of which the tree should be constructed
[out]p_Treethe created dir tree
[in]startdir entry to start (optional, by default 0)
Returns
index of the last read dir entry

Definition at line 200 of file fiff_dir_tree.cpp.

Member Data Documentation

fiff_int_t FIFFLIB::FiffDirTree::block

Block type for this directory

Definition at line 202 of file fiff_dir_tree.h.

QList<FiffDirTree> FIFFLIB::FiffDirTree::children

Child nodes

Definition at line 208 of file fiff_dir_tree.h.

QList<FiffDirEntry> FIFFLIB::FiffDirTree::dir

Directory of tags in this node

Definition at line 205 of file fiff_dir_tree.h.

FiffId FIFFLIB::FiffDirTree::id

Id of this block if any

Definition at line 203 of file fiff_dir_tree.h.

fiff_int_t FIFFLIB::FiffDirTree::nchild

Number of child nodes

Definition at line 209 of file fiff_dir_tree.h.

fiff_int_t FIFFLIB::FiffDirTree::nent

Number of entries in this node

Definition at line 206 of file fiff_dir_tree.h.

fiff_int_t FIFFLIB::FiffDirTree::nent_tree

Number of entries in the directory tree node

Definition at line 207 of file fiff_dir_tree.h.

FiffId FIFFLIB::FiffDirTree::parent_id

Newly added to stay consistent with MATLAB implementation

Definition at line 204 of file fiff_dir_tree.h.


The documentation for this class was generated from the following files: