Change some gmx_unique_ptr to shared_ptr in public headers
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 6 Jul 2014 19:46:13 +0000 (22:46 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 8 Jul 2014 13:05:18 +0000 (15:05 +0200)
commit3720cc21a629bdc5b3cb16405b75a2ead1090a51
tree455c2cb7e100bae193fa0f4cedf0c64d5f0c4850
parent5a43144bca06eb71e597e54c4369bfede45893d0
Change some gmx_unique_ptr to shared_ptr in public headers

Change "trivial" occurrences of gmx_unique_ptr to boost::shared_ptr in
cases where there is a simple factory or a sink function where the
ownership of the object passes in or out from the library.

The main advantages:
 - Removes GMX_CXX11 dependencies from installed headers.
 - Improves memory management, where the memory is deallocated in the
   same library/executable that allocated it (through the shared_ptr
   deleter that gets created during construction).
The only disadvantage is that this blurs the ownership of the objects
slightly.

There are only two other instances of gmx_unique_ptr left in installed
headers, and those should be relatively easy to remove as well with a
bit of refactoring.

Related to #1454.

Change-Id: I1f694b30e4f8129f5d010115c0968a444e927ca0
src/gromacs/analysisdata/modules/histogram.h
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/cmdlineprogramcontext.h
src/gromacs/commandline/tests/cmdlineprogramcontext.cpp
src/gromacs/trajectoryanalysis/analysismodule.h