Always use std::shared_ptr
Since we compile as c++11, std::shared_ptr is guaranteed to exist.
This commit is contained in:
parent
e131766b71
commit
f335350c35
17 changed files with 5 additions and 75 deletions
16
SConstruct
16
SConstruct
|
|
@ -818,22 +818,6 @@ boost_version_source = get_expression_value(['<boost/version.hpp>'], 'BOOST_LIB_
|
|||
retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp')
|
||||
env['BOOST_LIB_VERSION'] = boost_lib_version.strip()
|
||||
|
||||
# Find shared pointer implementation
|
||||
configh['CT_USE_STD_SHARED_PTR'] = None
|
||||
configh['CT_USE_TR1_SHARED_PTR'] = None
|
||||
configh['CT_USE_MSFT_SHARED_PTR'] = None
|
||||
configh['CT_USE_BOOST_SHARED_PTR'] = None
|
||||
if conf.CheckStatement('std::shared_ptr<int> x', '#include <memory>'):
|
||||
configh['CT_USE_STD_SHARED_PTR'] = 1
|
||||
elif conf.CheckStatement('std::tr1::shared_ptr<int> x', '#include <tr1/memory>'):
|
||||
configh['CT_USE_TR1_SHARED_PTR'] = 1
|
||||
elif conf.CheckStatement('std::tr1::shared_ptr<int> x', '#include <memory>'):
|
||||
configh['CT_USE_MSFT_SHARED_PTR'] = 1
|
||||
elif conf.CheckStatement('boost::shared_ptr<int> x', '#include <boost/shared_ptr.hpp>'):
|
||||
configh['CT_USE_BOOST_SHARED_PTR'] = 1
|
||||
else:
|
||||
config_error("Couldn't find a working shared_ptr implementation.")
|
||||
|
||||
import SCons.Conftest, SCons.SConf
|
||||
context = SCons.SConf.CheckContext(conf)
|
||||
ret = SCons.Conftest.CheckLib(context,
|
||||
|
|
|
|||
|
|
@ -55,12 +55,6 @@ typedef int ftnlen; // Fortran hidden string length type
|
|||
%(LAPACK_NAMES_LOWERCASE)s
|
||||
%(LAPACK_FTN_TRAILING_UNDERSCORE)s
|
||||
|
||||
//--------- shared_ptr implementation ---------
|
||||
%(CT_USE_STD_SHARED_PTR)s
|
||||
%(CT_USE_TR1_SHARED_PTR)s
|
||||
%(CT_USE_MSFT_SHARED_PTR)s
|
||||
%(CT_USE_BOOST_SHARED_PTR)s
|
||||
|
||||
//-------- BOOST --------
|
||||
%(USE_BOOST_MATH)s
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
/**
|
||||
* Namespace for the Cantera kernel.
|
||||
|
|
@ -36,6 +37,8 @@ namespace Cantera
|
|||
#define DATA_PTR(vec) &vec[0]
|
||||
#endif
|
||||
|
||||
using std::shared_ptr;
|
||||
|
||||
/*!
|
||||
* All physical constants are stored here.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef CT_SMART_PTR
|
||||
#define CT_SMART_PTR
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined CT_USE_STD_SHARED_PTR
|
||||
#include <memory>
|
||||
namespace Cantera
|
||||
{
|
||||
using std::shared_ptr;
|
||||
}
|
||||
|
||||
#elif defined CT_USE_TR1_SHARED_PTR
|
||||
#include <tr1/memory>
|
||||
namespace Cantera
|
||||
{
|
||||
using std::tr1::shared_ptr;
|
||||
}
|
||||
|
||||
#elif defined CT_USE_MSFT_SHARED_PTR
|
||||
#include <memory>
|
||||
namespace Cantera
|
||||
{
|
||||
using std::tr1::shared_ptr;
|
||||
}
|
||||
|
||||
#elif defined CT_USE_BOOST_SHARED_PTR
|
||||
#include <boost/shared_ptr.hpp>
|
||||
namespace Cantera
|
||||
{
|
||||
using boost::shared_ptr;
|
||||
}
|
||||
|
||||
#else
|
||||
#error "No shared_ptr implementation available"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -13,8 +13,6 @@
|
|||
#include "cantera/base/ctexceptions.h"
|
||||
#include "cantera/thermo/ThermoPhase.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "cantera/base/FactoryBase.h"
|
||||
#include "cantera/base/ct_thread.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
#include "cantera/kinetics/Falloff.h"
|
||||
|
||||
namespace Cantera
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include "cantera/thermo/mix_defs.h"
|
||||
#include "cantera/kinetics/Reaction.h"
|
||||
#include "cantera/base/global.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#define CT_REACTION_H
|
||||
|
||||
#include "cantera/base/utilities.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
#include "cantera/kinetics/RxnRates.h"
|
||||
#include "cantera/kinetics/Falloff.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#define CT_SPECIES_H
|
||||
|
||||
#include "cantera/base/ct_defs.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#define CT_SPECIESTHERMO_H
|
||||
|
||||
#include "cantera/base/ct_defs.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#define CT_TRANSPORTDATA_H
|
||||
|
||||
#include "cantera/base/ct_defs.h"
|
||||
#include "cantera/base/smart_ptr.h"
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ cdef extern from "cantera/cython/funcWrapper.h":
|
|||
CxxFunc1(callback_wrapper, void*)
|
||||
double eval(double) except +translate_exception
|
||||
|
||||
cdef extern from "cantera/base/smart_ptr.h":
|
||||
cppclass shared_ptr "Cantera::shared_ptr" [T]:
|
||||
cdef extern from "<memory>":
|
||||
cppclass shared_ptr "std::shared_ptr" [T]:
|
||||
T* get()
|
||||
void reset(T*)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "cantera/base/logger.h"
|
||||
|
||||
#include <set>
|
||||
#include <memory>
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "cantera/thermo.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <memory>
|
||||
|
||||
using namespace Cantera;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#include "cantera/transport.h"
|
||||
#include "cantera/transport/DustyGasTransport.h"
|
||||
|
||||
#include <memory>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include "cantera/thermo/HMWSoln.h"
|
||||
#include "cantera/transport/SimpleTransport.h"
|
||||
|
||||
#include <memory>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "cantera/thermo/IonsFromNeutralVPSSTP.h"
|
||||
#include "cantera/IdealGasMix.h"
|
||||
|
||||
#include <memory>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue