X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOSQLiteTreeHandler.h;h=1172298500f114096ee6195b71b0687251853084;hb=e13ea6551e8721b11998dc33ddccf3f89458f173;hp=1c35aac5c6f1c7757ae58c7c05b40c272c9be2a9;hpb=42f7c93a6f8fc2beeb8709be1b3616ec40f4699e;p=creaImageIO.git diff --git a/src2/creaImageIOSQLiteTreeHandler.h b/src2/creaImageIOSQLiteTreeHandler.h index 1c35aac..1172298 100644 --- a/src2/creaImageIOSQLiteTreeHandler.h +++ b/src2/creaImageIOSQLiteTreeHandler.h @@ -55,6 +55,10 @@ namespace creaImageIO virtual bool Create(bool writable = false); /// Destroys the 'source' virtual bool Destroy(); + /// Begins a transaction + virtual void BeginTransaction(); + ///Commits results and ends transaction + virtual void EndTransaction(); //==================================================================== @@ -94,7 +98,13 @@ namespace creaImageIO // WITHOUT altering the source, e.g. the database virtual void UnLoad(tree::Node* n); ///==================================================================== - + + //==================================================================== + /// Returns the top level node id for the given search param and search value + virtual void GetTopLevelNodeId(const std::string& searchParam, + const std::string& searchValue, + std::string& parent_id); + ///==================================================================== //==================================================================== // WRITE METHODS : WORK ONLY IN WRITE MODE @@ -118,6 +128,11 @@ namespace creaImageIO const std::string& searchVal); //Deletes the tuple that matches the parameters given virtual void DeleteTuple(std::string levelDescriptor, std::string key, std::string value); + //Deletes the entries that match the parameters given + virtual void RemoveEntries(const std::string i_table, + const std::string i_attribute, + const std::string i_operand, + const std::string i_val); //==================================================================== @@ -202,47 +217,7 @@ namespace creaImageIO //====================================================================== - /* - /// - int DBQueryNumberOfChildren(tree::Node* n); - - // Insertion - bool DBInsert(tree::Node* alien_node) ; //, UpdateSummary& summary); - - // - std::string DBGetNodeId(tree::Node* node, const std::string& parent_id); - - tree::Node* GetNodeFromTypeId(int level, - const std::string& id); - - // - tree::Node* DBGetOrCreateNode(tree::Node* alien_node, - tree::Node* internal_parent, - std::string parentid, - std::string& created_id); - // UpdateSummary& summary); - - tree::Node* DBGetOrCreateParent(tree::Node* alien_node, - std::string& parent_id); - // UpdateSummary& summary); - - void DBRecursiveGetOrCreateNode(tree::Node* alien_node, - tree::Node* parent, - const std::string& parent_id); - // UpdateSummary& summary); - - - */ - - /* - - void BuildSQLFieldsValues(tree::Node* n, - std::string& str); - - - tree::Node* GetChildrenLike(tree::Node* internal_parent, - tree::Node* alien_node); - */ + private: /// The DB CppSQLite3DB* mDB; @@ -250,25 +225,11 @@ namespace creaImageIO std::string mFileName; /// Is the DB writable ? bool mWritable; - void SetWritable(bool w) { mWritable; } + void SetWritable(bool w) { mWritable = w; } bool GetWritable() const { return mWritable; } bool mIsAdding; - /* - struct TypeId - { - int type; - std::string id; - bool operator< (const TypeId& o) const - { - return ((type TypeIdToNodeMapType; - TypeIdToNodeMapType mTypeIdToNodeMap; - */ + }; // EO class SQLiteTreeHandler //=======================================================================