]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOTreeNode.h
_T
[creaImageIO.git] / src2 / creaImageIOTreeNode.h
index 55d6ab570b36a46c7adad26c00419fb0e5ccf284..2905c1a8a0e2784d201da383fe54c2697919afd7 100644 (file)
@@ -3,9 +3,11 @@
 
 #include <creaImageIOTreeDescriptor.h>
 #include <creaImageIOTreeComparators.h>
+#include<boost/filesystem/operations.hpp>
 #include <vector>
 #include <map>
 
+
 namespace creaImageIO
 {
 
@@ -58,6 +60,7 @@ namespace creaImageIO
       /// Returns the level of the node in the tree
       virtual int GetLevel() const { return mParent->GetLevel()+1; }
 
+        
       /// Returns the parent of the node
       Node* GetParent() const { return mParent; }
 
@@ -115,7 +118,7 @@ namespace creaImageIO
       { if (mData!=0) return dynamic_cast<T>(mData); return 0; }
 
       /// Sets the node data. Deletes existing data if any.
-      void SetData(NodeData* d) { if (mData) delete mData; mData = d; }
+         void SetData(boost::shared_ptr<NodeData> d) {mData.reset(); mData = d; }//{ if (mData) delete mData; mData = d; }
 
       /// Sorts the children of the node 
       void SortChildren(const LexicographicalComparator&);
@@ -135,7 +138,7 @@ namespace creaImageIO
       /// The map of attributes
       AttributeMapType mAttributeMap;
       /// User data
-      NodeData* mData;
+      boost::shared_ptr<NodeData> mData;
       /// Are the children loaded ?
       bool mChildrenLoaded;
       /// The number of children