Abstract class which 'handles' a Tree structure. More...
#include <creaImageIOTreeHandler.h>
Public Types | |
typedef tree::Node::AttributeMapType | AttributeMapType |
==================================================================== | |
Public Member Functions | |
TreeHandler () | |
Ctor. | |
virtual | ~TreeHandler () |
Virtual dtor. | |
tree::Tree & | GetTree () |
Returns the Tree handled. | |
const tree::Tree & | GetTree () const |
Returns the Tree handled (const). | |
virtual bool | IsReadable () |
Is the 'source' readable ? | |
virtual bool | IsWritable () |
Is the 'source' writable ? | |
virtual bool | Open (bool writable=false) |
Opens an existing 'source'. | |
virtual bool | Close () |
Closes the 'source'. | |
virtual bool | Create (bool writable=false) |
Creates a new 'source'. | |
virtual bool | Destroy () |
Destroys the 'source'. | |
virtual void | BeginTransaction () |
Begins a transaction. | |
virtual void | EndTransaction () |
Commits results and ends transaction. | |
virtual unsigned int | GetNumberOfChildren (tree::Node *n) |
Returns the number of children of the Node *WITHOUT LOADING THEM*. | |
virtual void | GetAttribute (std::string levelDescriptor, std::string searchParam, std::string searchVal, std::string key, std::string &result) |
Returns the attribute requested. Useful for synchronization. | |
virtual int | LoadChildren (tree::Node *parent, int maxlevel) |
Recursively loads the children of node 'parent' until maxlevel. | |
virtual void | UnLoad (tree::Node *n) |
Unloads the Node and its descendants. | |
virtual void | GetTopLevelNodeId (const std::string &searchParam, const std::string &searchValue, std::string &parent_id) |
Returns the top level node id for the given search param and search value. | |
virtual int | AddBranch (const AttributeMapType &) |
Adds a branch in the tree with the attributes provided. | |
virtual bool | Remove (tree::Node *) |
Removes the node and its descendants. | |
virtual bool | SetAttribute (tree::Node *, const std::string &key, const std::string &value) |
Sets an attribute of a Node. | |
virtual void | SetAttribute (const std::string &levelDescriptor, const std::string &key, const std::string &value, const std::string &searchParam, const std::string &searchVal) |
virtual void | DeleteTuple (std::string levelDescriptor, std::string key, std::string value) |
virtual void | RemoveEntries (const std::string i_table, const std::string i_attribute, const std::string i_operand, const std::string i_val) |
virtual void | getAllAttributes (std::string i_filename, std::map< std::string, std::string > &i_results)=0 |
get all attributes for a file | |
Private Attributes | |
tree::Tree | mTree |
The handled tree. |
Abstract class which 'handles' a Tree structure.
Definition at line 19 of file creaImageIOTreeHandler.h.
====================================================================
Definition at line 123 of file creaImageIOTreeHandler.h.
creaImageIO::TreeHandler::TreeHandler | ( | ) | [inline] |
virtual creaImageIO::TreeHandler::~TreeHandler | ( | ) | [inline, virtual] |
virtual int creaImageIO::TreeHandler::AddBranch | ( | const AttributeMapType & | ) | [inline, virtual] |
Adds a branch in the tree with the attributes provided.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 128 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::TreeHandlerImageAdder::AddFile().
{ return -1; }
virtual void creaImageIO::TreeHandler::BeginTransaction | ( | ) | [inline, virtual] |
Begins a transaction.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 68 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory().
{}
virtual bool creaImageIO::TreeHandler::Close | ( | ) | [inline, virtual] |
Closes the 'source'.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 60 of file creaImageIOTreeHandler.h.
{ return false; }
virtual bool creaImageIO::TreeHandler::Create | ( | bool | writable = false |
) | [inline, virtual] |
Creates a new 'source'.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 64 of file creaImageIOTreeHandler.h.
{ return false; }
virtual void creaImageIO::TreeHandler::DeleteTuple | ( | std::string | levelDescriptor, | |
std::string | key, | |||
std::string | value | |||
) | [inline, virtual] |
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 142 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::Synchronizer::SynchronizeFile().
{}
virtual bool creaImageIO::TreeHandler::Destroy | ( | ) | [inline, virtual] |
Destroys the 'source'.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 66 of file creaImageIOTreeHandler.h.
{ return false; }
virtual void creaImageIO::TreeHandler::EndTransaction | ( | ) | [inline, virtual] |
Commits results and ends transaction.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 70 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory().
{}
virtual void creaImageIO::TreeHandler::getAllAttributes | ( | std::string | i_filename, | |
std::map< std::string, std::string > & | i_results | |||
) | [pure virtual] |
get all attributes for a file
Implemented in creaImageIO::SQLiteTreeHandler.
Referenced by creaImageIO::Gimmick::GetAttributes().
virtual void creaImageIO::TreeHandler::GetAttribute | ( | std::string | levelDescriptor, | |
std::string | searchParam, | |||
std::string | searchVal, | |||
std::string | key, | |||
std::string & | result | |||
) | [inline, virtual] |
Returns the attribute requested. Useful for synchronization.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 88 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::TreeHandlerImageAdder::GetAttributes(), and creaImageIO::Synchronizer::Synchronize().
{}
virtual unsigned int creaImageIO::TreeHandler::GetNumberOfChildren | ( | tree::Node * | n | ) | [inline, virtual] |
Returns the number of children of the Node *WITHOUT LOADING THEM*.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 83 of file creaImageIOTreeHandler.h.
{ return 0; }
virtual void creaImageIO::TreeHandler::GetTopLevelNodeId | ( | const std::string & | searchParam, | |
const std::string & | searchValue, | |||
std::string & | parent_id | |||
) | [inline, virtual] |
Returns the top level node id for the given search param and search value.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 114 of file creaImageIOTreeHandler.h.
{ return; }
const tree::Tree& creaImageIO::TreeHandler::GetTree | ( | ) | const [inline] |
Returns the Tree handled (const).
Definition at line 38 of file creaImageIOTreeHandler.h.
References mTree.
{ return mTree; }
tree::Tree& creaImageIO::TreeHandler::GetTree | ( | ) | [inline] |
Returns the Tree handled.
Definition at line 36 of file creaImageIOTreeHandler.h.
References mTree.
Referenced by creaImageIO::TreeHandlerImageAdder::AddFile(), creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::WxTreeView::CreateCtrl(), creaImageIO::Gimmick::createDB(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBGetParent(), creaImageIO::SQLiteTreeHandler::DBGraftToParent(), creaImageIO::SQLiteTreeHandler::DBImportTreeDescription(), creaImageIO::SQLiteTreeHandler::DBInsert(), creaImageIO::SQLiteTreeHandler::DBLoadChildren(), creaImageIO::SQLiteTreeHandler::DBRecursiveRemoveNode(), creaImageIO::SQLiteTreeHandler::DBSetAttribute(), creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::SQLiteTreeHandler::getAllAttributes(), creaImageIO::WxTreeView::GetAttributes(), creaImageIO::SQLiteTreeHandler::GetNumberOfChildren(), creaImageIO::SQLiteTreeHandler::GetTopLevelNodeId(), creaImageIO::SQLiteTreeHandler::GetUpLevelNodeId(), creaImageIO::TreeHandlerImageAdder::isAttributeExist(), creaImageIO::SQLiteTreeHandler::LoadChildren(), creaImageIO::WxTreeView::OnDumpTags(), creaImageIO::WxTreeView::OnEditField(), creaImageIO::WxTreeView::OnLocalCopy(), creaImageIO::Gimmick::Print(), creaImageIO::WxTreeView::RemoveSelected(), creaImageIO::SQLiteTreeHandler::SetAttribute(), creaImageIO::SQLiteTreeHandler::SQLAppendAttributesDefinition(), creaImageIO::TreeHandlerImageAdder::Synchronize(), and creaImageIO::WxTreeView::WxTreeView().
{ return mTree; }
virtual bool creaImageIO::TreeHandler::IsReadable | ( | ) | [inline, virtual] |
Is the 'source' readable ?
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 44 of file creaImageIOTreeHandler.h.
{ return false; }
virtual bool creaImageIO::TreeHandler::IsWritable | ( | ) | [inline, virtual] |
Is the 'source' writable ?
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 46 of file creaImageIOTreeHandler.h.
{ return false; }
virtual int creaImageIO::TreeHandler::LoadChildren | ( | tree::Node * | parent, | |
int | maxlevel | |||
) | [inline, virtual] |
Recursively loads the children of node 'parent' until maxlevel.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 102 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::WxTreeView::GetFilenamesAsString(), creaImageIO::WxTreeView::RecursiveUpdateLevel(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::TreeHandlerImageAdder::Synchronize().
{ return 0; }
virtual bool creaImageIO::TreeHandler::Open | ( | bool | writable = false |
) | [inline, virtual] |
Opens an existing 'source'.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 58 of file creaImageIOTreeHandler.h.
{ return false; }
virtual bool creaImageIO::TreeHandler::Remove | ( | tree::Node * | ) | [inline, virtual] |
Removes the node and its descendants.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 130 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::TreeHandlerImageAdder::Synchronize().
{ return false; }
virtual void creaImageIO::TreeHandler::RemoveEntries | ( | const std::string | i_table, | |
const std::string | i_attribute, | |||
const std::string | i_operand, | |||
const std::string | i_val | |||
) | [inline, virtual] |
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 144 of file creaImageIOTreeHandler.h.
{}
virtual void creaImageIO::TreeHandler::SetAttribute | ( | const std::string & | levelDescriptor, | |
const std::string & | key, | |||
const std::string & | value, | |||
const std::string & | searchParam, | |||
const std::string & | searchVal | |||
) | [inline, virtual] |
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 136 of file creaImageIOTreeHandler.h.
{}
virtual bool creaImageIO::TreeHandler::SetAttribute | ( | tree::Node * | , | |
const std::string & | key, | |||
const std::string & | value | |||
) | [inline, virtual] |
Sets an attribute of a Node.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 132 of file creaImageIOTreeHandler.h.
Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::TreeHandlerImageAdder::CopyFiles(), and creaImageIO::TreeHandlerImageAdder::EditField().
{ return false; }
virtual void creaImageIO::TreeHandler::UnLoad | ( | tree::Node * | n | ) | [inline, virtual] |
Unloads the Node and its descendants.
Reimplemented in creaImageIO::SQLiteTreeHandler.
Definition at line 109 of file creaImageIOTreeHandler.h.
{ return; }
tree::Tree creaImageIO::TreeHandler::mTree [private] |