#include <creaImageIOTree.h>
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 Tree * | GetTree () |
Returns the descriptor of the tree. | |
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. | |
const Descriptor & | GetDescriptor () const |
Returns the Descriptor of the tree (const). | |
Descriptor & | GetDescriptor () |
Returns the descriptor of the tree. | |
unsigned int | GetNumberOfLevels () |
Returns the number of levels of the tree. | |
const LevelDescriptor & | GetLevelDescriptor (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 LevelDescriptor & | GetLevelDescriptor () const |
Returns the level descriptor of the node. | |
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. | |
std::string | GetLabel () const |
Private Attributes | |
Descriptor | mDescriptor |
Definition at line 27 of file creaImageIOTree.h.
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] |
creaImageIO::tree::Tree::Tree | ( | ) |
Ctor.
virtual creaImageIO::tree::Tree::~Tree | ( | ) | [virtual] |
Virtual destructor.
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.
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.
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.
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; }
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(); }
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); }
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); }
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.
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.
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.
void creaImageIO::tree::Node::SortChildren | ( | const LexicographicalComparator & | ) | [inherited] |
Sorts the children of the node.
std::string creaImageIO::tree::Node::GetLabel | ( | ) | const [inherited] |