#include <creaImageIOTreeNode.h>
Public Types | |
typedef std::map < std::string, std::string > | AttributeMapType |
typedef std::vector < Node * > | ChildrenListType |
The type of children container. | |
Public Member Functions | |
Node (Node *parent) | |
Ctor with parent. | |
Node (Node *parent, const AttributeMapType &) | |
Ctor with parent and attributes map. | |
virtual | ~Node () |
Virtual destructor. | |
void | InitializeAttributeMap () |
Initializes the attribute map i.e. creates the entries. | |
const LevelDescriptor & | GetLevelDescriptor () const |
Returns the level descriptor of the node. | |
virtual Tree * | GetTree () |
Returns the tree to which the node belongs. | |
virtual const Tree * | GetTree () const |
Returns the tree to which the node belongs. | |
virtual int | GetLevel () const |
Returns the level of the node in the tree. | |
Node * | GetParent () 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. | |
ChildrenListType & | GetChildrenList () |
Returns the list of children. | |
const ChildrenListType & | GetChildrenList () const |
Returns the list of children (const). | |
int | RemoveChildrenFromList (Node *) |
Remove the given children from the children list. | |
AttributeMapType & | GetAttributeMap () |
const AttributeMapType & | GetAttributeMap () 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> | |
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. | |
virtual void | Print () const |
std::string | GetLabel () const |
Private Attributes | |
Node * | mParent |
The parent of the node. | |
ChildrenListType | mChildren |
The list of children. | |
AttributeMapType | mAttributeMap |
The map of attributes. | |
NodeData * | mData |
User data. | |
bool | mChildrenLoaded |
Are the children loaded ? |
Definition at line 34 of file creaImageIOTreeNode.h.
typedef std::map<std::string,std::string> creaImageIO::tree::Node::AttributeMapType |
Definition at line 37 of file creaImageIOTreeNode.h.
typedef std::vector<Node*> creaImageIO::tree::Node::ChildrenListType |
creaImageIO::tree::Node::Node | ( | Node * | parent | ) |
Ctor with parent.
creaImageIO::tree::Node::Node | ( | Node * | parent, | |
const AttributeMapType & | ||||
) |
Ctor with parent and attributes map.
virtual creaImageIO::tree::Node::~Node | ( | ) | [virtual] |
Virtual destructor.
void creaImageIO::tree::Node::InitializeAttributeMap | ( | ) |
Initializes the attribute map i.e. creates the entries.
const LevelDescriptor& creaImageIO::tree::Node::GetLevelDescriptor | ( | ) | const |
Returns the level descriptor of the node.
virtual Tree* creaImageIO::tree::Node::GetTree | ( | ) | [inline, virtual] |
Returns the tree to which the node belongs.
Reimplemented in creaImageIO::tree::Tree.
Definition at line 55 of file creaImageIOTreeNode.h.
References GetTree(), and mParent.
Referenced by GetTree().
00055 { return mParent->GetTree(); }
virtual const Tree* creaImageIO::tree::Node::GetTree | ( | ) | const [inline, virtual] |
Returns the tree to which the node belongs.
Reimplemented in creaImageIO::tree::Tree.
Definition at line 57 of file creaImageIOTreeNode.h.
References GetTree(), and mParent.
00057 { return mParent->GetTree(); }
virtual int creaImageIO::tree::Node::GetLevel | ( | ) | const [inline, virtual] |
Returns the level of the node in the tree.
Reimplemented in creaImageIO::tree::Tree.
Definition at line 59 of file creaImageIOTreeNode.h.
References GetLevel(), and mParent.
Referenced by GetLevel().
00059 { return mParent->GetLevel()+1; }
Node* creaImageIO::tree::Node::GetParent | ( | ) | const [inline] |
Returns the parent of the node.
Definition at line 62 of file creaImageIOTreeNode.h.
References mParent.
00062 { return mParent; }
unsigned int creaImageIO::tree::Node::GetNumberOfChildren | ( | ) | const [inline] |
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 mChildren.
00068 { return mChildren.size(); }
bool creaImageIO::tree::Node::GetChildrenLoaded | ( | ) | const [inline] |
Returns true iff the node's children are loaded.
Definition at line 71 of file creaImageIOTreeNode.h.
References mChildrenLoaded.
00071 { return mChildrenLoaded; }
void creaImageIO::tree::Node::SetChildrenLoaded | ( | bool | l | ) | [inline] |
Sets the node's children.
Definition at line 74 of file creaImageIOTreeNode.h.
References mChildrenLoaded.
00074 { mChildrenLoaded = l; }
ChildrenListType& creaImageIO::tree::Node::GetChildrenList | ( | ) | [inline] |
Returns the list of children.
Definition at line 79 of file creaImageIOTreeNode.h.
References mChildren.
00079 { return mChildren; }
const ChildrenListType& creaImageIO::tree::Node::GetChildrenList | ( | ) | const [inline] |
Returns the list of children (const).
Definition at line 81 of file creaImageIOTreeNode.h.
References mChildren.
00081 { return mChildren; }
int creaImageIO::tree::Node::RemoveChildrenFromList | ( | Node * | ) |
Remove the given children from the children list.
AttributeMapType& creaImageIO::tree::Node::GetAttributeMap | ( | ) | [inline] |
Definition at line 87 of file creaImageIOTreeNode.h.
References mAttributeMap.
00087 { return mAttributeMap; }
const AttributeMapType& creaImageIO::tree::Node::GetAttributeMap | ( | ) | const [inline] |
Definition at line 88 of file creaImageIOTreeNode.h.
References mAttributeMap.
00088 { return mAttributeMap; }
const std::string& creaImageIO::tree::Node::GetAttribute | ( | const std::string & | k | ) | const |
const std::string& creaImageIO::tree::Node::GetCleanAttribute | ( | const std::string & | k | ) | const |
const std::string& creaImageIO::tree::Node::UnsafeGetAttribute | ( | const std::string & | k | ) | const [inline] |
Definition at line 91 of file creaImageIOTreeNode.h.
References mAttributeMap.
00092 { return mAttributeMap.find(k)->second; }
void creaImageIO::tree::Node::SetAttribute | ( | const std::string & | k, | |
const std::string & | v | |||
) |
void creaImageIO::tree::Node::UnsafeSetAttribute | ( | const std::string & | k, | |
const std::string & | v | |||
) | [inline] |
Definition at line 94 of file creaImageIOTreeNode.h.
References mAttributeMap.
00095 { mAttributeMap[k] = v; }
const AttributeDescriptor& creaImageIO::tree::Node::GetAttributeDescriptor | ( | const std::string & | k | ) | const |
bool creaImageIO::tree::Node::Matches | ( | const AttributeMapType & | ) | const |
Returns true iff the KEY attributes of the node match those of the map provided.
T creaImageIO::tree::Node::GetData | ( | ) | const [inline] |
Returns the node data casted into the type T.
Definition at line 105 of file creaImageIOTreeNode.h.
References mData.
void creaImageIO::tree::Node::SetData | ( | NodeData * | d | ) | [inline] |
void creaImageIO::tree::Node::SortChildren | ( | const LexicographicalComparator & | ) |
Sorts the children of the node.
virtual void creaImageIO::tree::Node::Print | ( | ) | const [virtual] |
Reimplemented in creaImageIO::tree::Tree.
std::string creaImageIO::tree::Node::GetLabel | ( | ) | const |
Node* creaImageIO::tree::Node::mParent [private] |
The parent of the node.
Definition at line 125 of file creaImageIOTreeNode.h.
Referenced by GetLevel(), GetParent(), and GetTree().
The list of children.
Definition at line 127 of file creaImageIOTreeNode.h.
Referenced by GetChildrenList(), and GetNumberOfChildren().
The map of attributes.
Definition at line 129 of file creaImageIOTreeNode.h.
Referenced by GetAttributeMap(), UnsafeGetAttribute(), and UnsafeSetAttribute().
NodeData* creaImageIO::tree::Node::mData [private] |
bool creaImageIO::tree::Node::mChildrenLoaded [private] |
Are the children loaded ?
Definition at line 133 of file creaImageIOTreeNode.h.
Referenced by GetChildrenLoaded(), and SetChildrenLoaded().