@@ -54,16 +54,14 @@ class CiffComponent {
5454 // ! CiffComponent auto_ptr type
5555 using UniquePtr = std::unique_ptr<CiffComponent>;
5656 // ! Container type to hold all metadata
57- using Components = std::vector<CiffComponent* >;
57+ using Components = std::vector<UniquePtr >;
5858
5959 // ! @name Creators
6060 // @{
6161 // ! Default constructor
6262 CiffComponent () = default ;
6363 // ! Constructor taking a tag and directory
6464 CiffComponent (uint16_t tag, uint16_t dir);
65- CiffComponent (const CiffComponent&) = delete ;
66- CiffComponent& operator =(const CiffComponent&) = delete ;
6765 // ! Virtual destructor.
6866 virtual ~CiffComponent () = default ;
6967 // @}
@@ -73,7 +71,7 @@ class CiffComponent {
7371 // Default assignment operator is fine
7472
7573 // ! Add a component to the composition
76- CiffComponent* add (UniquePtr component);
74+ const UniquePtr& add (UniquePtr component);
7775 /* !
7876 @brief Add \em crwTagId to the parse tree, if it doesn't exist
7977 yet. \em crwDirs contains the path of subdirectories, starting
@@ -87,7 +85,7 @@ class CiffComponent {
8785
8886 @return A pointer to the newly added component.
8987 */
90- CiffComponent* add (CrwDirs& crwDirs, uint16_t crwTagId);
88+ const UniquePtr& add (CrwDirs& crwDirs, uint16_t crwTagId);
9189 /* !
9290 @brief Remove \em crwTagId from the parse tree, if it exists yet. \em
9391 crwDirs contains the path of subdirectories, starting with the
@@ -231,9 +229,9 @@ class CiffComponent {
231229 // ! @name Manipulators
232230 // @{
233231 // ! Implements add()
234- virtual CiffComponent* doAdd (UniquePtr component) = 0;
232+ virtual const UniquePtr& doAdd (UniquePtr component) = 0;
235233 // ! Implements add(). The default implementation does nothing.
236- virtual CiffComponent* doAdd (CrwDirs& crwDirs, uint16_t crwTagId);
234+ virtual const UniquePtr& doAdd (CrwDirs& crwDirs, uint16_t crwTagId);
237235 // ! Implements remove(). The default implementation does nothing.
238236 virtual void doRemove (CrwDirs& crwDirs, uint16_t crwTagId);
239237 // ! Implements read(). The default implementation reads a directory entry.
@@ -291,7 +289,7 @@ class CiffEntry : public CiffComponent {
291289 // @{
292290 using CiffComponent::doAdd;
293291 // See base class comment
294- CiffComponent* doAdd (UniquePtr component) override ;
292+ const UniquePtr& doAdd (UniquePtr component) override ;
295293 /* !
296294 @brief Implements write(). Writes only the value data of the entry,
297295 using writeValueData().
@@ -312,15 +310,6 @@ class CiffDirectory : public CiffComponent {
312310 using CiffComponent::CiffComponent;
313311
314312 public:
315- // ! @name Creators
316- // @{
317- // ! Virtual destructor
318- ~CiffDirectory () override ;
319- // @}
320-
321- CiffDirectory (const CiffDirectory&) = delete ;
322- CiffDirectory& operator =(const CiffDirectory&) = delete ;
323-
324313 // ! @name Manipulators
325314 // @{
326315 // Default assignment operator is fine
@@ -339,9 +328,9 @@ class CiffDirectory : public CiffComponent {
339328 // ! @name Manipulators
340329 // @{
341330 // See base class comment
342- CiffComponent* doAdd (UniquePtr component) override ;
331+ const UniquePtr& doAdd (UniquePtr component) override ;
343332 // See base class comment
344- CiffComponent* doAdd (CrwDirs& crwDirs, uint16_t crwTagId) override ;
333+ const UniquePtr& doAdd (CrwDirs& crwDirs, uint16_t crwTagId) override ;
345334 // See base class comment
346335 void doRemove (CrwDirs& crwDirs, uint16_t crwTagId) override ;
347336 /* !
0 commit comments