Remove gmx_unique_ptr from options public headers
[alexxy/gromacs.git] / src / gromacs / options / abstractoption.h
index 4c0153b834b65a72d891c1db069715bc44883ba1..1152081eca90101c5364fd9c271bc40f9bf3cdb2 100644 (file)
@@ -58,7 +58,6 @@
 #include <vector>
 
 #include "../utility/common.h"
-#include "../utility/uniqueptr.h"
 
 #include "optionflags.h"
 
@@ -70,10 +69,6 @@ template <typename T> class OptionStorageTemplate;
 class OptionManagerContainer;
 class Options;
 
-//! Smart pointer for managing an AbstractOptionStorage object.
-typedef gmx_unique_ptr<AbstractOptionStorage>::type
-    AbstractOptionStoragePointer;
-
 /*! \brief
  * Abstract base class for specifying option properties.
  *
@@ -122,8 +117,15 @@ class AbstractOption
          * They should also throw APIError if they detect problems.
          *
          * Should only be called by Options::addOption().
+         *
+         * The ownership of the return value is passed, but is not using a
+         * smart pointer to avoid introducing such a dependency in an installed
+         * header.  The implementation will always consist of a single `new`
+         * call and returning that value, and the caller always immediately
+         * wraps the pointer in a smart pointer, so there is not exception
+         * safety issue.
          */
-        virtual AbstractOptionStoragePointer createStorage(
+        virtual AbstractOptionStorage *createStorage(
             const OptionManagerContainer &managers) const = 0;
 
         //! Sets the description for the option.