X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeNode.h;h=2905c1a8a0e2784d201da383fe54c2697919afd7;hb=14519c4ab5669030fb5f657368190b876e4be3b3;hp=55d6ab570b36a46c7adad26c00419fb0e5ccf284;hpb=96ca5a0d7b7ccd6b4291160c19afd48e3207db2a;p=creaImageIO.git diff --git a/src2/creaImageIOTreeNode.h b/src2/creaImageIOTreeNode.h index 55d6ab5..2905c1a 100644 --- a/src2/creaImageIOTreeNode.h +++ b/src2/creaImageIOTreeNode.h @@ -3,9 +3,11 @@ #include #include +#include #include #include + 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(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 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 mData; /// Are the children loaded ? bool mChildrenLoaded; /// The number of children