CASM
AClustersApproachtoStatisticalMechanics
|
Non-std smart pointer classes and functions.
Classes | |
class | Cloneable |
class | cloneable_ptr |
A 'cloneable_ptr' can be used in place of 'unique_ptr'. More... | |
struct | GetSecond |
struct | GetSecondConst |
struct | GetSecondDereferenced |
struct | GetSecondDereferencedConst |
struct | has_clone |
Base type inherits from std::false_type if T does not have clone method. More... | |
struct | has_clone< T, CASM::CASM_TMP::void_t< decltype(std::declval< T & >().clone())> > |
Specialized case inherits from std::true_type if T does have clone method. More... | |
class | unique_map |
std::map wrapper to enforce a 1-1 ValueType->KeyType relationship More... | |
class | UniqueMapIterator |
An iterator over a UniqueMap. More... | |
Typedefs | |
template<typename KeyType , typename ValueType , typename MapType = std::map<KeyType, cloneable_ptr<ValueType> >> | |
using | unique_cloneable_map = unique_map< KeyType, ValueType, MapType, GetSecondDereferenced< MapType >, GetSecondDereferencedConst< MapType > > |
Enable use of unique_map of cloneable_ptr<ValueType> via references to ValueType. More... | |
Functions | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | make_unique (Args &&...args) |
c++11 does not include 'make_unique' More... | |
template<typename T , typename... Args> | |
cloneable_ptr< T > | make_cloneable (Args &&...args) |
make a cloneable_ptr<T> via T(Args... args) More... | |
template<typename T > | |
std::unique_ptr< T > | clone (const T &obj, typename std::enable_if< has_clone< T >::value, T >::type *=nullptr) |
template<typename T > | |
std::unique_ptr< T > | clone (const T &obj, typename std::enable_if< !has_clone< T >::value, T >::type *=nullptr) |
template<typename Type > | |
void | swap (cloneable_ptr< Type > &A, cloneable_ptr< Type > &B) |
template<typename Type > | |
bool | operator< (const cloneable_ptr< Type > &A, const cloneable_ptr< Type > &B) |
template<typename Type > | |
bool | operator== (const cloneable_ptr< Type > &A, const cloneable_ptr< Type > &B) |
template<typename Type > | |
bool | operator!= (const cloneable_ptr< Type > &A, const cloneable_ptr< Type > &B) |
using notstd::unique_cloneable_map = typedef unique_map<KeyType, ValueType, MapType, GetSecondDereferenced<MapType>, GetSecondDereferencedConst<MapType> > |
Enable use of unique_map of cloneable_ptr<ValueType> via references to ValueType.
Definition at line 46 of file unique_cloneable_map.hh.
std::unique_ptr<T> notstd::clone | ( | const T & | obj, |
typename std::enable_if< has_clone< T >::value, T >::type * | = nullptr |
||
) |
Definition at line 46 of file cloneable_ptr.hh.
std::unique_ptr<T> notstd::clone | ( | const T & | obj, |
typename std::enable_if< !has_clone< T >::value, T >::type * | = nullptr |
||
) |
Definition at line 51 of file cloneable_ptr.hh.
cloneable_ptr<T> notstd::make_cloneable | ( | Args &&... | args | ) |
make a cloneable_ptr<T> via T(Args... args)
Definition at line 32 of file cloneable_ptr.hh.
std::unique_ptr<T> notstd::make_unique | ( | Args &&... | args | ) |
c++11 does not include 'make_unique'
Definition at line 14 of file cloneable_ptr.hh.
bool notstd::operator!= | ( | const cloneable_ptr< Type > & | A, |
const cloneable_ptr< Type > & | B | ||
) |
Definition at line 208 of file cloneable_ptr.hh.
bool notstd::operator< | ( | const cloneable_ptr< Type > & | A, |
const cloneable_ptr< Type > & | B | ||
) |
Definition at line 198 of file cloneable_ptr.hh.
bool notstd::operator== | ( | const cloneable_ptr< Type > & | A, |
const cloneable_ptr< Type > & | B | ||
) |
Definition at line 203 of file cloneable_ptr.hh.
void notstd::swap | ( | cloneable_ptr< Type > & | A, |
cloneable_ptr< Type > & | B | ||
) |
Definition at line 193 of file cloneable_ptr.hh.