Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions site_scons/site_tools/cxxtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@

from SCons.Script import *
from SCons.Builder import Builder
from SCons.Util import PrependPath, unique, uniquer
from SCons.Util import PrependPath, unique, uniquer_hashables
import os

# A warning class to notify users of problems
class ToolCxxTestWarning(SCons.Warnings.Warning):
class ToolCxxTestWarning(SCons.Warnings.SConsWarning):
pass

SCons.Warnings.enableWarningClass(ToolCxxTestWarning)
Expand Down Expand Up @@ -105,7 +105,7 @@ def prepend_ld_library_path(env, overrides, **kwargs):
"""Prepend LD_LIBRARY_PATH with LIBPATH to run successfully programs that
were linked against local shared libraries."""
# make it unique but preserve order ...
libpath = uniquer(Split(kwargs.get('CXXTEST_LIBPATH', [])) +
libpath = uniquer_hashables(Split(kwargs.get('CXXTEST_LIBPATH', [])) +
Split(env.get( 'CXXTEST_LIBPATH', [])))
if len(libpath) > 0:
libpath = env.arg2nodes(libpath, env.fs.Dir)
Expand Down
6 changes: 5 additions & 1 deletion src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ if env['tool'] == 'intelc':

fast_linkflags = ['-s']

# libobjcryst is built with double precision for ObjCryst's REAL type.
# Match that ABI in all consumers of ObjCryst headers.
env.PrependUnique(CPPDEFINES={'REAL': 'double'})

# Specify minimum C++ standard. Allow later standard from sconscript.local.
# In case of multiple `-std` options the last option holds.
env.PrependUnique(CXXFLAGS='-std=c++11', delete_existing=1)
env.PrependUnique(CXXFLAGS='-std=c++23', delete_existing=1)

# Platform specific intricacies.
if env['PLATFORM'] == 'darwin':
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/Attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <set>
#include <map>
#include <stdexcept>
#include <boost/shared_ptr.hpp>
#include <memory>

namespace diffpy {
namespace attributes {
Expand Down Expand Up @@ -109,7 +109,7 @@ class Attributes

// types
typedef std::map<std::string,
boost::shared_ptr<attributes::BaseDoubleAttribute> >
std::shared_ptr<attributes::BaseDoubleAttribute> >
DoubleAttributeStorage;
// data
DoubleAttributeStorage mdoubleattrs;
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/HasClassRegistry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <stdexcept>
#include <set>
#include <map>
#include <boost/shared_ptr.hpp>
#include <memory>

namespace diffpy {

Expand All @@ -42,7 +42,7 @@ class HasClassRegistry
public:

// types
typedef boost::shared_ptr<TBase> SharedPtr;
typedef std::shared_ptr<TBase> SharedPtr;

// Contains virtual methods
virtual ~HasClassRegistry() { }
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/mathutils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool eps_lt(const double& x, const double& y, double eps=SQRT_DOUBLE_EPS);

// binary functor for round-off aware less-than comparison

class EpsilonLess : public std::binary_function<double, double, bool>
class EpsilonLess
{
public:

Expand Down Expand Up @@ -77,7 +77,7 @@ class EpsilonLess : public std::binary_function<double, double, bool>

// binary functor for round-off aware equality comparison

class EpsilonEqual : public std::binary_function<double, double, bool>
class EpsilonEqual
{
public:

Expand Down
8 changes: 4 additions & 4 deletions src/diffpy/serialization.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* diffpy::serialization_fromstring
*
* Definition of macros for explicit instantiation of serialization_tostring
* and serialization_fromstring for type C or type boost::shared_ptr<C>.
* and serialization_fromstring for type C or type std::shared_ptr<C>.
*
* DIFFPY_INSTANTIATE_SERIALIZATION(C)
* DIFFPY_INSTANTIATE_PTR_SERIALIZATION(C)
Expand All @@ -29,7 +29,7 @@
#define SERIALIZATION_IPP_INCLUDED

#include <sstream>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <diffpy/serialization.hpp>

namespace diffpy {
Expand Down Expand Up @@ -70,9 +70,9 @@ void serialization_fromstring(T& tobj, const std::string& s)
diffpy::serialization_fromstring<C>(C&, const std::string&); \

/// Insert explicit instantiations for serialization_tostring and
/// serialization_fromstring for type boost::shared_ptr<C>.
/// serialization_fromstring for type std::shared_ptr<C>.

#define DIFFPY_INSTANTIATE_PTR_SERIALIZATION(C) \
DIFFPY_INSTANTIATE_SERIALIZATION(boost::shared_ptr<C>)
DIFFPY_INSTANTIATE_SERIALIZATION(std::shared_ptr<C>)

#endif // SERIALIZATION_IPP_INCLUDED
4 changes: 2 additions & 2 deletions src/diffpy/srreal/AtomicStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ AtomicStructureAdapter::diff(StructureAdapterConstPtr other) const
using std::min;
StructureDifference sd = this->StructureAdapter::diff(other);
if (sd.stru0 == sd.stru1) return sd;
typedef boost::shared_ptr<const class AtomicStructureAdapter> APtr;
APtr pother = boost::dynamic_pointer_cast<APtr::element_type>(other);
typedef std::shared_ptr<const class AtomicStructureAdapter> APtr;
APtr pother = std::dynamic_pointer_cast<APtr::element_type>(other);
if (!pother) return sd;
// try fast side-by-side comparison
sd.diffmethod = StructureDifference::Method::SIDEBYSIDE;
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/AtomicStructureAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class AtomicStructureAdapter : public StructureAdapter

};

typedef boost::shared_ptr<AtomicStructureAdapter> AtomicStructureAdapterPtr;
typedef std::shared_ptr<AtomicStructureAdapter> AtomicStructureAdapterPtr;

// Complementary comparison function

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/BVParametersTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace diffpy {
namespace srreal {

typedef boost::shared_ptr<class BVParametersTable> BVParametersTablePtr;
typedef std::shared_ptr<class BVParametersTable> BVParametersTablePtr;

class BVParametersTable
{
Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/srreal/ConstantRadiiTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sstream>
#include <stdexcept>
#include <vector>
#include <boost/make_shared.hpp>
#include <memory>

#include <diffpy/serialization.ipp>
#include <diffpy/srreal/ConstantRadiiTable.hpp>
Expand All @@ -43,13 +43,13 @@ ConstantRadiiTable::ConstantRadiiTable() : mdefaultradius(0.0)

AtomRadiiTablePtr ConstantRadiiTable::create() const
{
return boost::make_shared<ConstantRadiiTable>();
return std::make_shared<ConstantRadiiTable>();
}


AtomRadiiTablePtr ConstantRadiiTable::clone() const
{
return boost::make_shared<ConstantRadiiTable>(*this);
return std::make_shared<ConstantRadiiTable>(*this);
}


Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srreal/CrystalStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ CrystalStructureAdapter::diff(StructureAdapterConstPtr other) const
{
StructureDifference sd = this->StructureAdapter::diff(other);
if (sd.stru0 == sd.stru1) return sd;
typedef boost::shared_ptr<const class CrystalStructureAdapter> CPtr;
CPtr cother = boost::dynamic_pointer_cast<CPtr::element_type>(other);
typedef std::shared_ptr<const class CrystalStructureAdapter> CPtr;
CPtr cother = std::dynamic_pointer_cast<CPtr::element_type>(other);
if (!cother) return sd;
// compare symmetry operations in both adapters
assert(cother == sd.stru1);
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/CrystalStructureAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CrystalStructureAdapter : public PeriodicStructureAdapter
};


typedef boost::shared_ptr<CrystalStructureAdapter> CrystalStructureAdapterPtr;
typedef std::shared_ptr<CrystalStructureAdapter> CrystalStructureAdapterPtr;

// Comparison functions

Expand Down
6 changes: 3 additions & 3 deletions src/diffpy/srreal/EmptyStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*****************************************************************************/

#include <boost/make_shared.hpp>
#include <memory>

#include <diffpy/serialization.ipp>
#include <diffpy/srreal/StructureAdapter.hpp>
Expand Down Expand Up @@ -45,14 +45,14 @@ class EmptyStructureAdapter : public StructureAdapter
virtual StructureAdapterPtr clone() const
{
StructureAdapterPtr rv =
boost::const_pointer_cast<StructureAdapter>(shared_from_this());
std::const_pointer_cast<StructureAdapter>(shared_from_this());
return rv;
}


virtual BaseBondGeneratorPtr createBondGenerator() const
{
return boost::make_shared<BaseBondGenerator>(shared_from_this());
return std::make_shared<BaseBondGenerator>(shared_from_this());
}


Expand Down
12 changes: 6 additions & 6 deletions src/diffpy/srreal/NoMetaStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace srreal {
NoMetaStructureAdapter::NoMetaStructureAdapter(
StructureAdapterPtr srcstructure)
{
boost::shared_ptr<NoMetaStructureAdapter> nmptr =
boost::dynamic_pointer_cast<NoMetaStructureAdapter>(srcstructure);
std::shared_ptr<NoMetaStructureAdapter> nmptr =
std::dynamic_pointer_cast<NoMetaStructureAdapter>(srcstructure);
if (nmptr) srcstructure = nmptr->getSourceStructure();
msrcstructure = srcstructure.get() ?
srcstructure : emptyStructureAdapter();
Expand All @@ -49,7 +49,7 @@ NoMetaStructureAdapter::NoMetaStructureAdapter(

StructureAdapterPtr NoMetaStructureAdapter::clone() const
{
boost::shared_ptr<NoMetaStructureAdapter> rv(new NoMetaStructureAdapter);
std::shared_ptr<NoMetaStructureAdapter> rv(new NoMetaStructureAdapter);
if (msrcstructure) rv->msrcstructure = msrcstructure->clone();
return rv;
}
Expand Down Expand Up @@ -122,8 +122,8 @@ NoMetaStructureAdapter::diff(StructureAdapterConstPtr other) const
{
StructureDifference sd = this->StructureAdapter::diff(other);
if (sd.stru0 == sd.stru1) return sd;
typedef boost::shared_ptr<const class NoMetaStructureAdapter> PPtr;
PPtr pother = boost::dynamic_pointer_cast<PPtr::element_type>(other);
typedef std::shared_ptr<const class NoMetaStructureAdapter> PPtr;
PPtr pother = std::dynamic_pointer_cast<PPtr::element_type>(other);
if (!pother) return sd;
sd = this->getSourceStructure()->diff(pother->getSourceStructure());
assert(sd.stru0 == this->getSourceStructure());
Expand Down Expand Up @@ -152,7 +152,7 @@ NoMetaStructureAdapter::getSourceStructure() const
StructureAdapterPtr nometa(StructureAdapterPtr stru)
{
StructureAdapterPtr rv =
boost::dynamic_pointer_cast<NoMetaStructureAdapter>(stru) ? stru :
std::dynamic_pointer_cast<NoMetaStructureAdapter>(stru) ? stru :
StructureAdapterPtr(new NoMetaStructureAdapter(stru));
return rv;
}
Expand Down
12 changes: 6 additions & 6 deletions src/diffpy/srreal/NoSymmetryStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ namespace srreal {
NoSymmetryStructureAdapter::NoSymmetryStructureAdapter(
StructureAdapterPtr srcstructure)
{
boost::shared_ptr<NoSymmetryStructureAdapter> nmptr =
boost::dynamic_pointer_cast<NoSymmetryStructureAdapter>(srcstructure);
std::shared_ptr<NoSymmetryStructureAdapter> nmptr =
std::dynamic_pointer_cast<NoSymmetryStructureAdapter>(srcstructure);
if (nmptr) srcstructure = nmptr->getSourceStructure();
msrcstructure = srcstructure.get() ?
srcstructure : emptyStructureAdapter();
Expand All @@ -51,7 +51,7 @@ NoSymmetryStructureAdapter::NoSymmetryStructureAdapter(

StructureAdapterPtr NoSymmetryStructureAdapter::clone() const
{
boost::shared_ptr<NoSymmetryStructureAdapter>
std::shared_ptr<NoSymmetryStructureAdapter>
rv(new NoSymmetryStructureAdapter);
if (msrcstructure) rv->msrcstructure = msrcstructure->clone();
return rv;
Expand Down Expand Up @@ -119,8 +119,8 @@ NoSymmetryStructureAdapter::diff(StructureAdapterConstPtr other) const
{
StructureDifference sd = this->StructureAdapter::diff(other);
if (sd.stru0 == sd.stru1) return sd;
typedef boost::shared_ptr<const class NoSymmetryStructureAdapter> PPtr;
PPtr pother = boost::dynamic_pointer_cast<PPtr::element_type>(other);
typedef std::shared_ptr<const class NoSymmetryStructureAdapter> PPtr;
PPtr pother = std::dynamic_pointer_cast<PPtr::element_type>(other);
if (!pother) return sd;
sd = this->getSourceStructure()->diff(pother->getSourceStructure());
assert(sd.stru0 == this->getSourceStructure());
Expand Down Expand Up @@ -149,7 +149,7 @@ NoSymmetryStructureAdapter::getSourceStructure() const
StructureAdapterPtr nosymmetry(StructureAdapterPtr stru)
{
StructureAdapterPtr rv =
boost::dynamic_pointer_cast<NoSymmetryStructureAdapter>(stru) ? stru :
std::dynamic_pointer_cast<NoSymmetryStructureAdapter>(stru) ? stru :
StructureAdapterPtr(new NoSymmetryStructureAdapter(stru));
return rv;
}
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/ObjCrystStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fetchSymmetryOperations(const ObjCryst::SpaceGroup& spacegroup)
assert(nbtran * last <= nbsym);
for (int nt = 0; nt < nbtran; ++nt)
{
const float* pt = sgtrans[nt].tr;
const REAL* pt = sgtrans[nt].tr;
R3::Vector sgt(pt[0], pt[1], pt[2]);
for (int i = 0; i < last; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/OverlapCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ vector< unordered_set<int> > OverlapCalculator::neighborhoods() const
{
int cntsites = this->countSites();
typedef unordered_set<int> SiteSet;
typedef std::vector< boost::shared_ptr<SiteSet> > SiteSetPointers;
typedef std::vector< std::shared_ptr<SiteSet> > SiteSetPointers;
SiteSetPointers rvptr(cntsites);
int n = this->count();
for (int index = 0; index < n; ++index)
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srreal/PQEvaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef PQEVALUATOR_HPP_INCLUDED
#define PQEVALUATOR_HPP_INCLUDED

#include <boost/shared_ptr.hpp>
#include <memory>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/assume_abstract.hpp>
#include <boost/serialization/export.hpp>
Expand All @@ -40,7 +40,7 @@ class PairQuantity;

/// shared pointer to PQEvaluatorBasic

typedef boost::shared_ptr<class PQEvaluatorBasic> PQEvaluatorPtr;
typedef std::shared_ptr<class PQEvaluatorBasic> PQEvaluatorPtr;

enum PQEvaluatorType {NONE, BASIC, OPTIMIZED, CHECK};

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/PairQuantity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void PairQuantity::setEvaluatorType(PQEvaluatorType evtp)
{
pqev->validate(*this);
}
catch (logic_error e)
catch (const logic_error& e)
{
string emsg("EvaluatorType not supported. ");
emsg += e.what();
Expand Down
4 changes: 2 additions & 2 deletions src/diffpy/srreal/PeriodicStructureAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ PeriodicStructureAdapter::diff(StructureAdapterConstPtr other) const
{
StructureDifference sd = this->StructureAdapter::diff(other);
if (sd.stru0 == sd.stru1) return sd;
typedef boost::shared_ptr<const class PeriodicStructureAdapter> PPtr;
PPtr pother = boost::dynamic_pointer_cast<PPtr::element_type>(other);
typedef std::shared_ptr<const class PeriodicStructureAdapter> PPtr;
PPtr pother = std::dynamic_pointer_cast<PPtr::element_type>(other);
if (!pother) return sd;
assert(pother == sd.stru1);
if (this->getLattice() != pother->getLattice()) return sd;
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/PeriodicStructureAdapter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class PeriodicStructureAdapter : public AtomicStructureAdapter

};

typedef boost::shared_ptr<PeriodicStructureAdapter> PeriodicStructureAdapterPtr;
typedef std::shared_ptr<PeriodicStructureAdapter> PeriodicStructureAdapterPtr;

// Comparison functions

Expand Down
Loading