@@ -153,8 +153,9 @@ class TiffComponent {
153153 public:
154154 // ! TiffComponent auto_ptr type
155155 using UniquePtr = std::unique_ptr<TiffComponent>;
156+ using SharedPtr = std::shared_ptr<TiffComponent>;
156157 // ! Container type to hold all metadata
157- using Components = std::vector<UniquePtr >;
158+ using Components = std::vector<SharedPtr >;
158159
159160 // ! @name Creators
160161 // @{
@@ -185,7 +186,7 @@ class TiffComponent {
185186 @param tiffComponent Auto pointer to the component to add.
186187 @return Return a pointer to the newly added child element or 0.
187188 */
188- TiffComponent* addChild (UniquePtr tiffComponent);
189+ TiffComponent* addChild (SharedPtr tiffComponent);
189190 /* !
190191 @brief Add a "next" component to the component. Default is to do
191192 nothing.
@@ -295,7 +296,7 @@ class TiffComponent {
295296 // ! Implements addPath(). The default implementation does nothing.
296297 virtual TiffComponent* doAddPath (uint16_t tag, TiffPath& tiffPath, TiffComponent* pRoot, UniquePtr object);
297298 // ! Implements addChild(). The default implementation does nothing.
298- virtual TiffComponent* doAddChild (UniquePtr tiffComponent);
299+ virtual TiffComponent* doAddChild (SharedPtr tiffComponent);
299300 // ! Implements addNext(). The default implementation does nothing.
300301 virtual TiffComponent* doAddNext (UniquePtr tiffComponent);
301302 // ! Implements accept().
@@ -853,7 +854,7 @@ class TiffDirectory : public TiffComponent {
853854 // ! @name Protected Manipulators
854855 // @{
855856 TiffComponent* doAddPath (uint16_t tag, TiffPath& tiffPath, TiffComponent* pRoot, UniquePtr object) override ;
856- TiffComponent* doAddChild (UniquePtr tiffComponent) override ;
857+ TiffComponent* doAddChild (SharedPtr tiffComponent) override ;
857858 TiffComponent* doAddNext (UniquePtr tiffComponent) override ;
858859 void doAccept (TiffVisitor& visitor) override ;
859860 /* !
@@ -952,7 +953,7 @@ class TiffSubIfd : public TiffEntryBase {
952953 // ! @name Protected Manipulators
953954 // @{
954955 TiffComponent* doAddPath (uint16_t tag, TiffPath& tiffPath, TiffComponent* pRoot, UniquePtr object) override ;
955- TiffComponent* doAddChild (UniquePtr tiffComponent) override ;
956+ TiffComponent* doAddChild (SharedPtr tiffComponent) override ;
956957 void doAccept (TiffVisitor& visitor) override ;
957958 void doEncode (TiffEncoder& encoder, const Exifdatum* datum) override ;
958959 /* !
@@ -988,7 +989,7 @@ class TiffSubIfd : public TiffEntryBase {
988989
989990 private:
990991 // ! A collection of TIFF directories (IFDs)
991- using Ifds = std::vector<std::unique_ptr <TiffDirectory>>;
992+ using Ifds = std::vector<std::shared_ptr <TiffDirectory>>;
992993
993994 // DATA
994995 IfdId newGroup_; // !< Start of the range of group numbers for the sub-IFDs
@@ -1019,7 +1020,7 @@ class TiffMnEntry : public TiffEntryBase {
10191020 // ! @name Protected Manipulators
10201021 // @{
10211022 TiffComponent* doAddPath (uint16_t tag, TiffPath& tiffPath, TiffComponent* pRoot, UniquePtr object) override ;
1022- TiffComponent* doAddChild (UniquePtr tiffComponent) override ;
1023+ TiffComponent* doAddChild (SharedPtr tiffComponent) override ;
10231024 TiffComponent* doAddNext (UniquePtr tiffComponent) override ;
10241025 void doAccept (TiffVisitor& visitor) override ;
10251026 void doEncode (TiffEncoder& encoder, const Exifdatum* datum) override ;
@@ -1145,7 +1146,7 @@ class TiffIfdMakernote : public TiffComponent {
11451146 // ! @name Protected Manipulators
11461147 // @{
11471148 TiffComponent* doAddPath (uint16_t tag, TiffPath& tiffPath, TiffComponent* pRoot, UniquePtr object) override ;
1148- TiffComponent* doAddChild (UniquePtr tiffComponent) override ;
1149+ TiffComponent* doAddChild (SharedPtr tiffComponent) override ;
11491150 TiffComponent* doAddNext (UniquePtr tiffComponent) override ;
11501151 void doAccept (TiffVisitor& visitor) override ;
11511152 /* !
@@ -1348,7 +1349,7 @@ class TiffBinaryArray : public TiffEntryBase {
13481349 /* !
13491350 @brief Implements addChild(). Todo: Document it!
13501351 */
1351- TiffComponent* doAddChild (UniquePtr tiffComponent) override ;
1352+ TiffComponent* doAddChild (SharedPtr tiffComponent) override ;
13521353 void doAccept (TiffVisitor& visitor) override ;
13531354 void doEncode (TiffEncoder& encoder, const Exifdatum* datum) override ;
13541355 /* !
@@ -1471,7 +1472,7 @@ class TiffBinaryElement : public TiffEntryBase {
14711472 @brief Compare two TIFF component pointers by tag. Return true if the tag
14721473 of component lhs is less than that of rhs.
14731474 */
1474- bool cmpTagLt (const TiffComponent::UniquePtr & lhs, const TiffComponent::UniquePtr & rhs);
1475+ bool cmpTagLt (const TiffComponent::SharedPtr & lhs, const TiffComponent::SharedPtr & rhs);
14751476
14761477// ! Function to create and initialize a new TIFF entry
14771478TiffComponent::UniquePtr newTiffEntry (uint16_t tag, IfdId group);
0 commit comments