JEMRIS  2.8.1
open-source MRI simulations
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
SequenceTree Class Reference

Tree representation of the sequence. More...

#include <SequenceTree.h>

+ Collaboration diagram for SequenceTree:

Public Member Functions

 SequenceTree ()
 
 ~SequenceTree ()
 
void Initialize (string seqFile)
 
DOMNodeList * GetChildNodes (DOMNode *node)
 
DOMNode * GetParentNode (DOMNode *node)
 
DOMNamedNodeMap * GetAttributes (DOMNode *node)
 
ModuleGetModule (DOMNode *node)
 
unsigned int AddModule (string name)
 
int RunTree (DOMNode *node, void *ptr, unsigned int(*fun)(void *, DOMNode *), int depth=0)
 
unsigned int Populate ()
 
ModuleGetParent (DOMNode *node)
 
vector< Module * > GetChildren (DOMNode *node)
 
ModuleGetChild (DOMNode *node, unsigned int position)
 
ConcatSequenceGetRootConcatSequence ()
 
ContainerSequenceGetContainerSequence ()
 
ModuleGetModuleByAttributeValue (string name, string value)
 
DOMDocument * GetDOMDocument ()
 
ModulePrototypeFactoryGetMPF ()
 
map< DOMNode *, Module * > * GetModuleMap ()
 
int GetDepth ()
 
string GetSequenceDirectory ()
 
void SerializeModules (string xml_file)
 
ParametersGetParameters ()
 
bool GetStatus ()
 Get my status of parsing XML.
 

Static Public Member Functions

static unsigned int CreateModule (void *ptr, DOMNode *node)
 
static vector< string > Tokenize (const string &str, const string &delimiters=",")
 

Private Attributes

bool m_state
 
int m_depth
 
Parametersm_parameters
 
ConcatSequencem_root_seq
 
DOMDocument * m_dom_doc
 
ModulePrototypeFactorym_mpf
 
XMLIOm_xio
 
map< DOMNode *, Module * > m_Modules
 
string m_seq_file
 

Friends

class Container
 

Detailed Description

Tree representation of the sequence.

Constructor & Destructor Documentation

SequenceTree::SequenceTree ( )

default constructor

SequenceTree::~SequenceTree ( )

public virtual default destructor

Member Function Documentation

unsigned int SequenceTree::AddModule ( string  name)

Get a puls based on its name

Parameters
nameUnique name of the Module to be added
unsigned int SequenceTree::CreateModule ( void *  ptr,
DOMNode *  node 
)
static

A static function to create modules. Called by SequenceTree::Populate() as function pointer argument to SequenceTree::RunTree() .

Parameters
ptrPointer to the SequenceTree object.
nodeMore elaborate description here please.
Returns
Error code.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DOMNamedNodeMap * SequenceTree::GetAttributes ( DOMNode *  node)

Get the attributes of the given node

Parameters
nodethe node for which the attributes are requested
Module * SequenceTree::GetChild ( DOMNode *  node,
unsigned int  position 
)

Get child at position

@param node The node referred to.
@param position The position in the vector of children

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DOMNodeList * SequenceTree::GetChildNodes ( DOMNode *  node)

Get the child nodes of the given node

Parameters
nodethe node for which the child nodes are requested
Returns
pointer to DOMNodeList including the children of the node for which the children are requested
vector< Module * > SequenceTree::GetChildren ( DOMNode *  node)

Get vector of chilren

@param node The node referred to.

+ Here is the caller graph for this function:

ContainerSequence * SequenceTree::GetContainerSequence ( )

Get the ContainerSequence module.

Returns
The ContainerSequence module.

+ Here is the caller graph for this function:

int SequenceTree::GetDepth ( )
inline

Get the depth of the tree

Returns
the depth

+ Here is the call graph for this function:

DOMDocument* SequenceTree::GetDOMDocument ( )
inline

Get the DOM document

Returns
the requested DOM document

+ Here is the caller graph for this function:

Module * SequenceTree::GetModule ( DOMNode *  node)

Get a Module based on its DOMNode

Parameters
nodeThe DOMNode
Module * SequenceTree::GetModuleByAttributeValue ( string  name,
string  value 
)

Get first module in the tree, which has a matching attribute (name,value) pair in its DOMNode.

Parameters
nameThe name of the attribute.
valueThe value of the attribute.
Returns
The module.

+ Here is the caller graph for this function:

map<DOMNode*, Module*>* SequenceTree::GetModuleMap ( )
inline

Get the map of clonable modules

Returns
Map of DOM nodes and modules

+ Here is the caller graph for this function:

ModulePrototypeFactory* SequenceTree::GetMPF ( )
inline

Get the module prototype factory

Returns
the requested prototype factory

+ Here is the caller graph for this function:

Parameters* SequenceTree::GetParameters ( )
inline

Get pointer to the sole instance of the 'Parameters' module.

+ Here is the caller graph for this function:

Module * SequenceTree::GetParent ( DOMNode *  node)

Get the parent module

Parameters
nodeThe node referred to.

+ Here is the caller graph for this function:

DOMNode * SequenceTree::GetParentNode ( DOMNode *  node)

Get the Parent node of the given node

Parameters
nodethe node for which the parent node is requested
Returns
pointer to the requested parent node
ConcatSequence * SequenceTree::GetRootConcatSequence ( )

Get the root ConcatSequence module.

Returns
The root ConcatSequence module.

+ Here is the caller graph for this function:

string SequenceTree::GetSequenceDirectory ( )

Get the directory of the sequence file

Returns
the directory

+ Here is the caller graph for this function:

void SequenceTree::Initialize ( string  seqFile)

Initialize the sole instance

Parameters
seqFileuri to the xml file representing the sequence tree to to Initialize from
Returns
error code (0: ok, 1: file io error, 2: dtd validation error)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int SequenceTree::Populate ( )

Populate sequence

Populate sequence with the given XML by cloning all needed objects.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int SequenceTree::RunTree ( DOMNode *  node,
void *  ptr,
unsigned int(*)(void *, DOMNode *)  fun,
int  depth = 0 
)

Run through the sequence tree starting with a given node and perform on its children

Parameters
nodeThe given DOM node
ptrMore elaborate description here please
funPointer to the performing function
depthDepth of run (default=0).
Returns
The depth of the tree

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SequenceTree::SerializeModules ( string  xml_file)

Write xml file containing all modules of the sequence framework.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vector<string> SequenceTree::Tokenize ( const string &  str,
const string &  delimiters = "," 
)
static

A static string tokenizer. Needed for setting module dependencies.

Parameters
strThe string to tokenize.
delimitersThe delimiters to split the string.
Returns
The vector of tokenized sub-strings.

Member Data Documentation

int SequenceTree::m_depth
private

The depth of the tree

DOMDocument* SequenceTree::m_dom_doc
private

The DOM document containing the whole sequence

Parameters* SequenceTree::m_parameters
private

Pointer to the sole instance of the Parameter Module

ConcatSequence* SequenceTree::m_root_seq
private

Pointer to the root ConcatSequence

string SequenceTree::m_seq_file
private

path of sequence file

bool SequenceTree::m_state
private

My status


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

-- last change 17.06.2016 | Tony Stoecker | Imprint --