Remove gmx_unique_ptr from options public headers
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 7 Jul 2014 04:59:38 +0000 (07:59 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Tue, 8 Jul 2014 13:52:26 +0000 (15:52 +0200)
commite9b414f365bb7662f3f63b72524269946a6b3fc3
treee9ad0e97a11bf7cd3b6686fb250522826877be7d
parent33772581813867cd285fc66c761601a30aa476ec
Remove gmx_unique_ptr from options public headers

There was a single factory function in the generic option interface that
created objects and passed ownership to the caller.  The implementation
for this method always follows the same pattern, and there only a single
caller, so it is easy to make it exception-safe while returning a plain
pointer.  As a side effect, it removes some boilerplate code from all
the implementations for this method.

There are more complicated alternatives that avoid the plain pointer,
based on creating a helper class that can only be forward declared in
the installed headers, but I don't think those are worth the extra code.

This removes the last use of gmx_unique_ptr in an installed header.

Part of #1454

Change-Id: I948973d32042d388341265d5db6efbbcf0f7db8f
12 files changed:
src/gromacs/options/abstractoption.h
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptions.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/options-impl.h
src/gromacs/options/options.cpp
src/gromacs/options/tests/abstractoptionstorage.cpp
src/gromacs/selection/selectionfileoption.h
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoption.h
src/testutils/integrationtests.cpp