creaImageIO_lib
creaImageIO::TreeHandler Class Referenceabstract

Abstract class which 'handles' a Tree structure. More...

#include <creaImageIOTreeHandler.h>

Inheritance diagram for creaImageIO::TreeHandler:
Collaboration diagram for creaImageIO::TreeHandler:

Public Types

typedef
tree::Node::AttributeMapType 
AttributeMapType
 ==================================================================== More...
 

Public Member Functions

 TreeHandler ()
 Ctor. More...
 
virtual ~TreeHandler ()
 Virtual dtor. More...
 
tree::TreeGetTree ()
 Returns the Tree handled. More...
 
const tree::TreeGetTree () const
 Returns the Tree handled (const) More...
 
virtual bool IsReadable ()
 Is the 'source' readable ? More...
 
virtual bool IsWritable ()
 Is the 'source' writable ? More...
 
virtual bool Open (bool writable=false)
 Opens an existing 'source'. More...
 
virtual bool Close ()
 Closes the 'source'. More...
 
virtual bool Create (bool writable=false)
 Creates a new 'source'. More...
 
virtual bool Destroy ()
 Destroys the 'source'. More...
 
virtual void BeginTransaction ()
 Begins a transaction. More...
 
virtual void EndTransaction ()
 Commits results and ends transaction. More...
 
virtual unsigned int GetNumberOfChildren (tree::Node *n)
 Returns the number of children of the Node WITHOUT LOADING THEM More...
 
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. More...
 
virtual int LoadChildren (tree::Node *parent, int maxlevel)
 Recursively loads the children of node 'parent' until maxlevel. More...
 
virtual void UnLoad (tree::Node *n)
 Unloads the Node and its descendants. More...
 
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. More...
 
virtual int AddBranch (const AttributeMapType &)
 Adds a branch in the tree with the attributes provided. More...
 
virtual bool Remove (tree::Node *)
 Removes the node and its descendants. More...
 
virtual bool SetAttribute (tree::Node *, const std::string &key, const std::string &value)
 Sets an attribute of a Node. More...
 
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 More...
 

Private Attributes

tree::Tree mTree
 The handled tree. More...
 

Detailed Description

Abstract class which 'handles' a Tree structure.

Definition at line 46 of file creaImageIOTreeHandler.h.

Member Typedef Documentation

====================================================================

Definition at line 150 of file creaImageIOTreeHandler.h.

Constructor & Destructor Documentation

creaImageIO::TreeHandler::TreeHandler ( )
inline

Ctor.

Definition at line 56 of file creaImageIOTreeHandler.h.

56 {}
virtual creaImageIO::TreeHandler::~TreeHandler ( )
inlinevirtual

Virtual dtor.

Definition at line 58 of file creaImageIOTreeHandler.h.

58 {}

Member Function Documentation

virtual int creaImageIO::TreeHandler::AddBranch ( const AttributeMapType )
inlinevirtual

Adds a branch in the tree with the attributes provided.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 155 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::TreeHandlerImageAdder::AddFile().

155 { return -1; }

Here is the caller graph for this function:

virtual void creaImageIO::TreeHandler::BeginTransaction ( )
inlinevirtual

Begins a transaction.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 95 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory().

95 {}

Here is the caller graph for this function:

virtual bool creaImageIO::TreeHandler::Close ( )
inlinevirtual

Closes the 'source'.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 87 of file creaImageIOTreeHandler.h.

87 { return false; }
virtual bool creaImageIO::TreeHandler::Create ( bool  writable = false)
inlinevirtual

Creates a new 'source'.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 91 of file creaImageIOTreeHandler.h.

91 { return false; }
virtual void creaImageIO::TreeHandler::DeleteTuple ( std::string  levelDescriptor,
std::string  key,
std::string  value 
)
inlinevirtual

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 169 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::Synchronizer::SynchronizeFile().

169 {}

Here is the caller graph for this function:

virtual bool creaImageIO::TreeHandler::Destroy ( )
inlinevirtual

Destroys the 'source'.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 93 of file creaImageIOTreeHandler.h.

93 { return false; }
virtual void creaImageIO::TreeHandler::EndTransaction ( )
inlinevirtual

Commits results and ends transaction.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 97 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::TreeHandlerImageAdder::AddDirectory().

97 {}

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

virtual void creaImageIO::TreeHandler::GetAttribute ( std::string  levelDescriptor,
std::string  searchParam,
std::string  searchVal,
std::string  key,
std::string &  result 
)
inlinevirtual

Returns the attribute requested. Useful for synchronization.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 115 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::TreeHandlerImageAdder::GetAttributes(), and creaImageIO::Synchronizer::Synchronize().

119  {}

Here is the caller graph for this function:

virtual unsigned int creaImageIO::TreeHandler::GetNumberOfChildren ( tree::Node n)
inlinevirtual

Returns the number of children of the Node WITHOUT LOADING THEM

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 110 of file creaImageIOTreeHandler.h.

110 { return 0; }
virtual void creaImageIO::TreeHandler::GetTopLevelNodeId ( const std::string &  searchParam,
const std::string &  searchValue,
std::string &  parent_id 
)
inlinevirtual

Returns the top level node id for the given search param and search value.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 141 of file creaImageIOTreeHandler.h.

143  { return; }
tree::Tree& creaImageIO::TreeHandler::GetTree ( )
inline

Returns the Tree handled.

Definition at line 63 of file creaImageIOTreeHandler.h.

References mTree.

Referenced by creaImageIO::TreeHandlerImageAdder::AddFile(), creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::WxTreeView::CreateCtrl(), creaImageIO::Gimmick::createDB(), creaImageIO::WxGimmickView::CreateTreeView(), 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().

63 { return mTree; }

Here is the caller graph for this function:

const tree::Tree& creaImageIO::TreeHandler::GetTree ( ) const
inline

Returns the Tree handled (const)

Definition at line 65 of file creaImageIOTreeHandler.h.

References mTree.

65 { return mTree; }
virtual bool creaImageIO::TreeHandler::IsReadable ( )
inlinevirtual

Is the 'source' readable ?

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 71 of file creaImageIOTreeHandler.h.

71 { return false; }
virtual bool creaImageIO::TreeHandler::IsWritable ( )
inlinevirtual

Is the 'source' writable ?

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 73 of file creaImageIOTreeHandler.h.

73 { return false; }
virtual int creaImageIO::TreeHandler::LoadChildren ( tree::Node parent,
int  maxlevel 
)
inlinevirtual

Recursively loads the children of node 'parent' until maxlevel.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 129 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::WxTreeView::GetFilenamesAsString(), main(), creaImageIO::WxTreeView::RecursiveUpdateLevel(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::TreeHandlerImageAdder::Synchronize().

130  { return 0; }

Here is the caller graph for this function:

virtual bool creaImageIO::TreeHandler::Open ( bool  writable = false)
inlinevirtual

Opens an existing 'source'.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 85 of file creaImageIOTreeHandler.h.

85 { return false; }
virtual bool creaImageIO::TreeHandler::Remove ( tree::Node )
inlinevirtual

Removes the node and its descendants.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 157 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::TreeHandlerImageAdder::DeleteDriveFromMainDB(), creaImageIO::WxTreeView::RemoveSelected(), and creaImageIO::TreeHandlerImageAdder::Synchronize().

157 { return false; }

Here is the caller graph for this function:

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 
)
inlinevirtual

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 171 of file creaImageIOTreeHandler.h.

174  {}
virtual bool creaImageIO::TreeHandler::SetAttribute ( tree::Node ,
const std::string &  key,
const std::string &  value 
)
inlinevirtual

Sets an attribute of a Node.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 159 of file creaImageIOTreeHandler.h.

Referenced by creaImageIO::Synchronizer::AttributesMatch(), creaImageIO::TreeHandlerImageAdder::CheckAttributes(), creaImageIO::TreeHandlerImageAdder::CopyFiles(), and creaImageIO::TreeHandlerImageAdder::EditField().

161  { return false; }

Here is the caller graph for this function:

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 
)
inlinevirtual

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 163 of file creaImageIOTreeHandler.h.

167  {}
virtual void creaImageIO::TreeHandler::UnLoad ( tree::Node n)
inlinevirtual

Unloads the Node and its descendants.

Reimplemented in creaImageIO::SQLiteTreeHandler.

Definition at line 136 of file creaImageIOTreeHandler.h.

136 { return; }

Member Data Documentation

tree::Tree creaImageIO::TreeHandler::mTree
private

The handled tree.

Definition at line 182 of file creaImageIOTreeHandler.h.

Referenced by GetTree().


The documentation for this class was generated from the following file: