/// returns the Level in the tree where the branch was connected
/// (-1 for error, 0 for top level, etc. )
/// Of course the branch is loaded on exit
- virtual int AddBranch
- ( const std::map<std::string,std::string>& attr );
+ virtual int AddBranch( const AttributeMapType& attr );
/// Removes the node and its descendants
virtual bool Remove(tree::Node*);
- ///====================================================================
-
-
+ //====================================================================
+
+
protected:
- // Open
+ //======================================================================
+ /// Open the database
bool DBOpen();
- void DBImportTreeDescription();
-
+ /// Import the Tree::Description from database (verifies the structure)
+ bool DBImportTreeDescription();
+ //======================================================================
+ //======================================================================
// Creation
/// Creates a new database on disk and the tables
bool DBCreate();
- /// Creates the default tree description for a new database
- void BuildDefaultTreeDescription();
/// Appends to string s the SQL command to create the attributes of a given level
void AppendAttributesSQLDefinition(int level, std::string& s);
- void DBExportTreeDescription();
- //
+ //======================================================================
- // Test
- bool DBStructureIsValid();
+ //======================================================================
+ tree::Node* DBGetParent( const AttributeMapType& attr);
+ //======================================================================
+ //======================================================================
+ int DBLoadChildren( tree::Node* parent, int numberoflevels = 1);
+ //======================================================================
+
+ /*
+ ///
int DBQueryNumberOfChildren(tree::Node* n);
// Insertion
tree::Node* GetChildrenLike(tree::Node* internal_parent,
tree::Node* alien_node);
-
+ */
private:
/// The DB
CppSQLite3DB* mDB;
void SetWritable(bool w) { mWritable; }
bool GetWritable() const { return mWritable; }
+ /*
struct TypeId
{
int type;
typedef std::map<TypeId,tree::Node*> TypeIdToNodeMapType;
TypeIdToNodeMapType mTypeIdToNodeMap;
+ */
};
// EO class SQLiteTreeHandler
//=======================================================================