creaImageIO::tree::Tree Class Reference
[Attributed tree management]

An attributed Tree structure. More...

#include <creaImageIOTree.h>

Inheritance diagram for creaImageIO::tree::Tree:

Inheritance graph
[legend]
Collaboration diagram for creaImageIO::tree::Tree:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map
< std::string,
std::string > 
AttributeMapType
typedef std::vector
< Node * > 
ChildrenListType
 The type of children container.

Public Member Functions

 Tree ()
 Ctor.
virtual ~Tree ()
 Virtual destructor.
virtual TreeGetTree ()
 Returns the descriptor of the tree.
virtual const TreeGetTree () const
 Returns the tree to which the node belongs.
virtual int GetLevel () const
 Returns the level of the node in the tree.
const DescriptorGetDescriptor () const
 Returns the Descriptor of the tree (const).
DescriptorGetDescriptor ()
 Returns the descriptor of the tree.
unsigned int GetNumberOfLevels ()
 Returns the number of levels of the tree.
const LevelDescriptorGetLevelDescriptor (int level) const
 Returns the LevelDescriptor of a given level (const ref).
const
LevelDescriptor::AttributeDescriptorListType
GetAttributeDescriptorList (int level) const
 Returns the AttributeDescriptorList of a given level (const ref).
virtual void Print () const
void InitializeAttributeMap ()
 Initializes the attribute map i.e. creates the entries.
const LevelDescriptorGetLevelDescriptor () const
 Returns the level descriptor of the node.
NodeGetParent () const
 Returns the parent of the node.
unsigned int GetNumberOfChildren () const
bool GetChildrenLoaded () const
 Returns true iff the node's children are loaded.
void SetChildrenLoaded (bool l)
 Sets the node's children.
ChildrenListTypeGetChildrenList ()
 Returns the list of children.
const ChildrenListTypeGetChildrenList () const
 Returns the list of children (const).
int RemoveChildrenFromList (Node *)
 Remove the given children from the children list.
AttributeMapTypeGetAttributeMap ()
const AttributeMapTypeGetAttributeMap () const
const std::string & GetAttribute (const std::string &k) const
const std::string & GetCleanAttribute (const std::string &k) const
const std::string & UnsafeGetAttribute (const std::string &k) const
void SetAttribute (const std::string &k, const std::string &v)
void UnsafeSetAttribute (const std::string &k, const std::string &v)
const
AttributeDescriptor
GetAttributeDescriptor (const std::string &k) const
bool Matches (const AttributeMapType &) const
 Returns true iff the KEY attributes of the node match those of the map provided.
template<class T>
GetData () const
 Returns the node data casted into the type T.
void SetData (NodeData *d)
 Sets the node data. Deletes existing data if any.
void SortChildren (const LexicographicalComparator &)
 Sorts the children of the node.
std::string GetLabel () const

Private Attributes

Descriptor mDescriptor


Detailed Description

An attributed Tree structure.

Definition at line 27 of file creaImageIOTree.h.


Member Typedef Documentation

typedef std::map<std::string,std::string> creaImageIO::tree::Node::AttributeMapType [inherited]

Definition at line 37 of file creaImageIOTreeNode.h.

typedef std::vector<Node*> creaImageIO::tree::Node::ChildrenListType [inherited]

The type of children container.

Definition at line 77 of file creaImageIOTreeNode.h.


Constructor & Destructor Documentation

creaImageIO::tree::Tree::Tree (  ) 

Ctor.

virtual creaImageIO::tree::Tree::~Tree (  )  [virtual]

Virtual destructor.


Member Function Documentation

virtual Tree* creaImageIO::tree::Tree::GetTree (  )  [inline, virtual]

Returns the descriptor of the tree.

Returns the tree to which the node belongs

Reimplemented from creaImageIO::tree::Node.

Definition at line 38 of file creaImageIOTree.h.

00038 { return this; }

virtual const Tree* creaImageIO::tree::Tree::GetTree (  )  const [inline, virtual]

Returns the tree to which the node belongs.

Reimplemented from creaImageIO::tree::Node.

Definition at line 40 of file creaImageIOTree.h.

00040 { return this; }

virtual int creaImageIO::tree::Tree::GetLevel (  )  const [inline, virtual]

Returns the level of the node in the tree.

Reimplemented from creaImageIO::tree::Node.

Definition at line 42 of file creaImageIOTree.h.

00042 { return 0; }

const Descriptor& creaImageIO::tree::Tree::GetDescriptor (  )  const [inline]

Returns the Descriptor of the tree (const).

Definition at line 45 of file creaImageIOTree.h.

References mDescriptor.

Referenced by GetAttributeDescriptorList(), GetLevelDescriptor(), and GetNumberOfLevels().

00045 { return mDescriptor; }

Here is the caller graph for this function:

Descriptor& creaImageIO::tree::Tree::GetDescriptor (  )  [inline]

Returns the descriptor of the tree.

Definition at line 47 of file creaImageIOTree.h.

References mDescriptor.

00047 { return mDescriptor; }

unsigned int creaImageIO::tree::Tree::GetNumberOfLevels (  )  [inline]

Returns the number of levels of the tree.

Definition at line 50 of file creaImageIOTree.h.

References GetDescriptor(), and creaImageIO::tree::Descriptor::GetNumberOfLevels().

00051       { return GetDescriptor().GetNumberOfLevels(); }

Here is the call graph for this function:

const LevelDescriptor& creaImageIO::tree::Tree::GetLevelDescriptor ( int  level  )  const [inline]

Returns the LevelDescriptor of a given level (const ref).

Definition at line 54 of file creaImageIOTree.h.

References GetDescriptor(), and creaImageIO::tree::Descriptor::GetLevelDescriptor().

00055       { return GetDescriptor().GetLevelDescriptor(level); }

Here is the call graph for this function:

const LevelDescriptor::AttributeDescriptorListType& creaImageIO::tree::Tree::GetAttributeDescriptorList ( int  level  )  const [inline]

Returns the AttributeDescriptorList of a given level (const ref).

Definition at line 59 of file creaImageIOTree.h.

References creaImageIO::tree::Descriptor::GetAttributeDescriptorList(), and GetDescriptor().

00060       { return GetDescriptor().GetAttributeDescriptorList(level); }

Here is the call graph for this function:

virtual void creaImageIO::tree::Tree::Print (  )  const [virtual]

Reimplemented from creaImageIO::tree::Node.

void creaImageIO::tree::Node::InitializeAttributeMap (  )  [inherited]

Initializes the attribute map i.e. creates the entries.

const LevelDescriptor& creaImageIO::tree::Node::GetLevelDescriptor (  )  const [inherited]

Returns the level descriptor of the node.

Node* creaImageIO::tree::Node::GetParent (  )  const [inline, inherited]

Returns the parent of the node.

Definition at line 62 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mParent.

00062 { return mParent; }

unsigned int creaImageIO::tree::Node::GetNumberOfChildren (  )  const [inline, inherited]

Returns the number of children of the node. Warning : if the children are not loaded then might return 0 even if the node has children ! see TreeHandler::GetNumberOfChildren

Definition at line 68 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mChildren.

00068 { return mChildren.size(); }

bool creaImageIO::tree::Node::GetChildrenLoaded (  )  const [inline, inherited]

Returns true iff the node's children are loaded.

Definition at line 71 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mChildrenLoaded.

00071 { return mChildrenLoaded; }

void creaImageIO::tree::Node::SetChildrenLoaded ( bool  l  )  [inline, inherited]

Sets the node's children.

Definition at line 74 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mChildrenLoaded.

00074 { mChildrenLoaded = l; }

ChildrenListType& creaImageIO::tree::Node::GetChildrenList (  )  [inline, inherited]

Returns the list of children.

Definition at line 79 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mChildren.

00079 { return mChildren; }

const ChildrenListType& creaImageIO::tree::Node::GetChildrenList (  )  const [inline, inherited]

Returns the list of children (const).

Definition at line 81 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mChildren.

00081 { return mChildren; }

int creaImageIO::tree::Node::RemoveChildrenFromList ( Node  )  [inherited]

Remove the given children from the children list.

AttributeMapType& creaImageIO::tree::Node::GetAttributeMap (  )  [inline, inherited]

Definition at line 87 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mAttributeMap.

00087 { return mAttributeMap; }

const AttributeMapType& creaImageIO::tree::Node::GetAttributeMap (  )  const [inline, inherited]

Definition at line 88 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mAttributeMap.

00088 { return mAttributeMap; }

const std::string& creaImageIO::tree::Node::GetAttribute ( const std::string &  k  )  const [inherited]

const std::string& creaImageIO::tree::Node::GetCleanAttribute ( const std::string &  k  )  const [inherited]

const std::string& creaImageIO::tree::Node::UnsafeGetAttribute ( const std::string &  k  )  const [inline, inherited]

Definition at line 91 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mAttributeMap.

00092       { return mAttributeMap.find(k)->second; }

void creaImageIO::tree::Node::SetAttribute ( const std::string &  k,
const std::string &  v 
) [inherited]

void creaImageIO::tree::Node::UnsafeSetAttribute ( const std::string &  k,
const std::string &  v 
) [inline, inherited]

Definition at line 94 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mAttributeMap.

00095       { mAttributeMap[k] = v; }

const AttributeDescriptor& creaImageIO::tree::Node::GetAttributeDescriptor ( const std::string &  k  )  const [inherited]

bool creaImageIO::tree::Node::Matches ( const AttributeMapType  )  const [inherited]

Returns true iff the KEY attributes of the node match those of the map provided.

template<class T>
T creaImageIO::tree::Node::GetData (  )  const [inline, inherited]

Returns the node data casted into the type T.

Definition at line 105 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mData.

00106       { if (mData!=0) return dynamic_cast<T>(mData); return 0; }

void creaImageIO::tree::Node::SetData ( NodeData d  )  [inline, inherited]

Sets the node data. Deletes existing data if any.

Definition at line 109 of file creaImageIOTreeNode.h.

References creaImageIO::tree::Node::mData.

00109 { if (mData) delete mData; mData = d; }

void creaImageIO::tree::Node::SortChildren ( const LexicographicalComparator  )  [inherited]

Sorts the children of the node.

std::string creaImageIO::tree::Node::GetLabel (  )  const [inherited]


Member Data Documentation

Descriptor creaImageIO::tree::Tree::mDescriptor [private]

Definition at line 65 of file creaImageIOTree.h.

Referenced by GetDescriptor().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 10:50:10 2009 for CreaImageIO by  doxygen 1.5.3