creaImageIO_lib
|
An attributed Tree structure. More...
#include <creaImageIOTree.h>
Public Types | |
typedef std::map< std::string, std::string > | AttributeMapType |
typedef std::vector< Node * > | ChildrenListType |
The type of children container. More... | |
Public Member Functions | |
Tree () | |
Ctor. More... | |
virtual | ~Tree () |
Virtual destructor. More... | |
virtual Tree * | GetTree () |
Returns the descriptor of the tree. More... | |
virtual const Tree * | GetTree () const |
Returns the tree to which the node belongs. More... | |
virtual int | GetLevel () const |
Returns the level of the node in the tree. More... | |
const Descriptor & | GetDescriptor () const |
Returns the Descriptor of the tree (const) More... | |
Descriptor & | GetDescriptor () |
Returns the descriptor of the tree. More... | |
unsigned int | GetNumberOfLevels () |
Returns the number of levels of the tree. More... | |
const LevelDescriptor & | GetLevelDescriptor (int level) const |
Returns the LevelDescriptor of a given level (const ref) More... | |
const LevelDescriptor::AttributeDescriptorListType & | GetAttributeDescriptorList (int level, int type=0) const |
virtual void | Print () const |
Print the node. More... | |
void | CopyAttributeDescriptorList (int level) |
Copy descriptor list without ID tag. More... | |
const std::string | isAttributeExist (const std::string i_attr) |
Test if this attribute is available in this tree description. More... | |
void | InitializeAttributeMap () |
Initializes the attribute map i.e. creates the entries. More... | |
const LevelDescriptor & | GetLevelDescriptor () const |
Returns the level descriptor of the node. More... | |
Node * | GetParent () const |
Returns the parent of the node. More... | |
unsigned int | GetNumberOfChildren () const |
bool | GetChildrenLoaded () const |
Returns true iff the node's children are loaded. More... | |
void | SetChildrenLoaded (bool l) |
Sets the node's children. More... | |
ChildrenListType & | GetChildrenList () |
Returns the list of children. More... | |
const ChildrenListType & | GetChildrenList () const |
Returns the list of children (const) More... | |
int | RemoveChildrenFromList (Node *) |
Remove the given children from the children list. More... | |
AttributeMapType & | GetAttributeMap () |
Get the Attributes Map. More... | |
const AttributeMapType & | GetAttributeMap () const |
Get the Attributes Map. More... | |
const std::string & | GetAttribute (const std::string &k) const |
Get the Attribute for a specific key. More... | |
const std::string & | GetCleanAttribute (const std::string &k) const |
Get the Attribute for a specific key without OS dependance (not implemented) More... | |
void | SetAttribute (const std::string &k, const std::string &v) |
Set an Attribute for a specific key. More... | |
void | UnsafeSetAttribute (const std::string &k, const std::string &v) |
Set an Attribute for a specific key(unsafe mode) More... | |
const AttributeDescriptor & | GetAttributeDescriptor (const std::string &k) const |
Get Descriptor for an Attribute. More... | |
bool | Matches (const AttributeMapType &) const |
Returns true if the KEY attributes of the node match those of the map provided. More... | |
template<class T > | |
T | GetData () const |
Returns the node data casted into the type T. More... | |
void | SetData (boost::shared_ptr< NodeData > d) |
Sets the node data. Deletes existing data if any. More... | |
void | SortChildren (const LexicographicalComparator &) |
Sorts the children of the node. More... | |
std::string | GetLabel () const |
Get the Label of the node. More... | |
Private Attributes | |
Descriptor | mDescriptor |
An attributed Tree structure.
Definition at line 55 of file creaImageIOTree.h.
|
inherited |
Definition at line 67 of file creaImageIOTreeNode.h.
|
inherited |
The type of children container.
Definition at line 108 of file creaImageIOTreeNode.h.
creaImageIO::tree::Tree::Tree | ( | ) |
|
virtual |
|
inline |
Copy descriptor list without ID tag.
Definition at line 96 of file creaImageIOTree.h.
References creaImageIO::tree::Descriptor::CopyAttributeDescriptorList(), and GetDescriptor().
Referenced by creaImageIO::SQLiteTreeHandler::DBCreate(), and creaImageIO::SQLiteTreeHandler::DBImportTreeDescription().
|
inherited |
Get the Attribute for a specific key.
Definition at line 172 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::Node::mAttributeMap.
Referenced by creaImageIO::WxGimmickView::CreateTreeView(), creaImageIO::SQLiteTreeHandler::DBGraftToParent(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::SQLiteTreeHandler::DBSetAttribute(), creaImageIO::TreeHandlerImageAdder::FindNode(), creaImageIO::TreeHandlerImageAdder::FindNodePartial(), creaImageIO::SQLiteTreeHandler::GetNumberOfChildren(), creaImageIO::WxEditFieldsPanel::OnComboChange(), creaImageIO::WxTreeView::OnDumpTags(), creaImageIO::WxTreeView::OnPopupFilter(), creaImageIO::TreeHandlerImageAdder::remove(), creaImageIO::TimestampDatabaseHandler::RemoveNode(), creaImageIO::GimmickView::RequestReading(), and creaImageIO::WxEditFieldsPanel::WxEditFieldsPanel().
|
inherited |
Get Descriptor for an Attribute.
Returns the attribute descriptor of the passed parameter.
Definition at line 139 of file creaImageIOTreeNode.cpp.
References GetAttributeDescriptorList(), creaImageIO::tree::Node::GetLevel(), and creaImageIO::tree::Node::GetTree().
Referenced by creaImageIO::WxTreeView::SortLevel().
|
inline |
Returns the AttributeDescriptorList of a given level (const ref) type = 0 all attributes type = 1 without ID and PATIENT_ID
Definition at line 89 of file creaImageIOTree.h.
References creaImageIO::tree::Descriptor::GetAttributeDescriptorList(), and GetDescriptor().
Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::WxTreeView::CreateCtrl(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), creaImageIO::SQLiteTreeHandler::getAllAttributes(), creaImageIO::tree::Node::GetAttributeDescriptor(), creaImageIO::WxTreeView::GetAttributes(), creaImageIO::tree::Node::InitializeAttributeMap(), creaImageIO::tree::Node::Node(), creaImageIO::WxTreeView::OnDumpTags(), creaImageIO::WxTreeView::OnEditField(), creaImageIO::SQLiteTreeHandler::SQLAppendAttributesDefinition(), and creaImageIO::WxTreeView::WxTreeView().
|
inlineinherited |
Get the Attributes Map.
Definition at line 119 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mAttributeMap.
Referenced by creaImageIO::SQLiteTreeHandler::SQLAppendAttributesValues().
|
inlineinherited |
Get the Attributes Map.
Definition at line 122 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mAttributeMap.
|
inlineinherited |
Returns the list of children.
Definition at line 110 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mChildren.
Referenced by creaImageIO::SQLiteTreeHandler::DBGetParent(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::TreeHandlerImageAdder::FindNode(), creaImageIO::TreeHandlerImageAdder::FindNodePartial(), creaImageIO::tree::Node::Node(), Print(), creaImageIO::tree::Node::Print(), creaImageIO::tree::Node::RemoveChildrenFromList(), creaImageIO::TreeHandlerImageAdder::RemoveFile(), creaImageIO::TimestampDatabaseHandler::RemoveNode(), creaImageIO::TreeHandlerImageAdder::Synchronize(), and creaImageIO::tree::Node::~Node().
|
inlineinherited |
Returns the list of children (const)
Definition at line 112 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mChildren.
|
inlineinherited |
Returns true iff the node's children are loaded.
Definition at line 102 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mChildrenLoaded.
Referenced by creaImageIO::SQLiteTreeHandler::DBLoadChildren().
|
inherited |
Get the Attribute for a specific key without OS dependance (not implemented)
|
inlineinherited |
Returns the node data casted into the type T.
Definition at line 145 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mData.
|
inline |
Returns the Descriptor of the tree (const)
Definition at line 73 of file creaImageIOTree.h.
References mDescriptor.
Referenced by creaImageIO::TreeHandlerImageAdder::AddFile(), creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), CopyAttributeDescriptorList(), creaImageIO::Gimmick::createDB(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), GetAttributeDescriptorList(), GetLevelDescriptor(), and GetNumberOfLevels().
|
inline |
Returns the descriptor of the tree.
Definition at line 75 of file creaImageIOTree.h.
References mDescriptor.
|
inherited |
Get the Label of the node.
Definition at line 239 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::LevelDescriptor::GetLabelList(), creaImageIO::tree::Node::GetLevelDescriptor(), GimmickDebugMessage, GimmickError, and creaImageIO::tree::Node::mAttributeMap.
Referenced by creaImageIO::WxGimmickView::CreateEditFieldsDialog(), creaImageIO::SQLiteTreeHandler::DBInsert(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBSetAttribute(), creaImageIO::tree::Node::Matches(), Print(), and creaImageIO::tree::Node::Print().
|
inlinevirtual |
Returns the level of the node in the tree.
Reimplemented from creaImageIO::tree::Node.
Definition at line 70 of file creaImageIOTree.h.
|
inherited |
Returns the level descriptor of the node.
Definition at line 130 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::Node::GetLevel(), GetLevelDescriptor(), and creaImageIO::tree::Node::GetTree().
Referenced by creaImageIO::tree::Node::GetLabel(), and creaImageIO::tree::Node::Matches().
|
inline |
Returns the LevelDescriptor of a given level (const ref)
Definition at line 82 of file creaImageIOTree.h.
References GetDescriptor(), and creaImageIO::tree::Descriptor::GetLevelDescriptor().
Referenced by creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), creaImageIO::SQLiteTreeHandler::DBInsert(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::SQLiteTreeHandler::DBSetAttribute(), creaImageIO::SQLiteTreeHandler::getAllAttributes(), creaImageIO::tree::Node::GetLevelDescriptor(), creaImageIO::SQLiteTreeHandler::GetNumberOfChildren(), creaImageIO::SQLiteTreeHandler::GetUpLevelNodeId(), creaImageIO::WxTreeView::OnLocalCopy(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::WxTreeView::WxTreeView().
|
inlineinherited |
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 99 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mChildren.
Referenced by creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::TreeHandlerImageAdder::RemoveFile(), and creaImageIO::TimestampDatabaseHandler::RemoveNode().
|
inline |
Returns the number of levels of the tree.
Definition at line 78 of file creaImageIOTree.h.
References GetDescriptor(), and creaImageIO::tree::Descriptor::GetNumberOfLevels().
Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBGraftToParent(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::SQLiteTreeHandler::getAllAttributes(), creaImageIO::SQLiteTreeHandler::GetTopLevelNodeId(), and creaImageIO::WxTreeView::WxTreeView().
|
inlineinherited |
Returns the parent of the node.
Definition at line 93 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mParent.
Referenced by creaImageIO::SQLiteTreeHandler::Remove().
|
inlinevirtual |
Returns the descriptor of the tree.
Returns the tree to which the node belongs
Reimplemented from creaImageIO::tree::Node.
Definition at line 66 of file creaImageIOTree.h.
Referenced by creaImageIO::SQLiteTreeHandler::DBGetParent(), creaImageIO::SQLiteTreeHandler::LoadChildren(), and creaImageIO::SQLiteTreeHandler::SetAttribute().
|
inlinevirtual |
Returns the tree to which the node belongs.
Reimplemented from creaImageIO::tree::Node.
Definition at line 68 of file creaImageIOTree.h.
|
inherited |
Initializes the attribute map i.e. creates the entries.
Definition at line 115 of file creaImageIOTreeNode.cpp.
References GetAttributeDescriptorList(), creaImageIO::tree::Node::GetLevel(), creaImageIO::tree::Node::GetTree(), and creaImageIO::tree::Node::UnsafeSetAttribute().
Referenced by creaImageIO::SQLiteTreeHandler::DBCreate(), and creaImageIO::tree::Node::Node().
|
inline |
Test if this attribute is available in this tree description.
Definition at line 102 of file creaImageIOTree.h.
References creaImageIO::tree::Descriptor::isExist(), and mDescriptor.
Referenced by creaImageIO::TreeHandlerImageAdder::isAttributeExist().
|
inherited |
Returns true if the KEY attributes of the node match those of the map provided.
Definition at line 204 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::LevelDescriptor::GetIdentifierList(), creaImageIO::tree::Node::GetLabel(), creaImageIO::tree::Node::GetLevelDescriptor(), GimmickDebugMessage, and creaImageIO::tree::Node::mAttributeMap.
|
virtual |
Print the node.
Reimplemented from creaImageIO::tree::Node.
Definition at line 50 of file creaImageIOTree.cpp.
References creaImageIO::tree::Node::GetChildrenList(), creaImageIO::tree::Node::GetLabel(), and GimmickMessage.
Referenced by creaImageIO::Gimmick::Print().
|
inherited |
Remove the given children from the children list.
Definition at line 158 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::Node::GetChildrenList().
Referenced by creaImageIO::SQLiteTreeHandler::Remove().
|
inherited |
Set an Attribute for a specific key.
Definition at line 188 of file creaImageIOTreeNode.cpp.
References creaImageIO::tree::Node::mAttributeMap.
Referenced by creaImageIO::SQLiteTreeHandler::DBGraftToParent(), creaImageIO::SQLiteTreeHandler::DBInsert(), creaImageIO::SQLiteTreeHandler::DBSetAttribute(), and creaImageIO::TreeHandlerImageAdder::EditField().
|
inlineinherited |
Sets the node's children.
Definition at line 105 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mChildrenLoaded.
Referenced by creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBGraftToParent(), and creaImageIO::SQLiteTreeHandler::DBLoadChildren().
|
inlineinherited |
Sets the node data. Deletes existing data if any.
Definition at line 149 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mData.
|
inherited |
Sorts the children of the node.
|
inlineinherited |
Set an Attribute for a specific key(unsafe mode)
Definition at line 135 of file creaImageIOTreeNode.h.
References creaImageIO::tree::Node::mAttributeMap.
Referenced by creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::tree::Node::InitializeAttributeMap(), and creaImageIO::tree::Node::Node().
|
private |
Definition at line 108 of file creaImageIOTree.h.
Referenced by GetDescriptor(), and isAttributeExist().