LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
cloneable.hpp File Reference
#include <h2/meta/core/SFINAE.hpp>
#include <memory>
#include <type_traits>
#include <vector>
Include dependency graph for cloneable.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lbann::AsVirtualBase< Base >
 Declare Base to be a virtual base. More...
 
struct  lbann::HasAbstractFunction< T >
 Declare that T has unimplemented virtual functions. More...
 
class  lbann::Cloneable< T, Base >
 Inject polymorphic clone functions into hierarchies. More...
 
class  lbann::Cloneable< T, Base >
 
class  lbann::Cloneable< T >
 Specialization of Cloneable to handle stand-alone classes. More...
 
class  lbann::Cloneable< HasAbstractFunction< T >, Base... >
 Specialization of Cloneable for intermediate classes. More...
 
class  lbann::Cloneable< HasAbstractFunction< T >, Base >
 
class  lbann::Cloneable< HasAbstractFunction< T > >
 Specialization of Cloneable to handle the top of hierarchies. More...
 
struct  lbann::IsCloneableT< T >
 Predicate testing for Cloneable interface. More...
 
struct  lbann::IsCloneablePtrT< T >
 
struct  lbann::IsCloneablePtrT< T * >
 
struct  lbann::IsCloneablePtrT< std::shared_ptr< T > >
 
struct  lbann::IsCloneablePtrT< std::unique_ptr< T, DeleterT > >
 

Namespaces

 lbann
 

Typedefs

template<typename T >
using lbann::NonLeafClass = HasAbstractFunction< T >
 Alias for HasAbstractFunction. More...
 
template<typename T , typename... Bases>
using lbann::AbstractCloneableBase = Cloneable< HasAbstractFunction< T >, Bases... >
 Helper metafunction for describing the top of a hierarchy that's cloneable. More...
 

Functions

template<typename T >
constexpr bool lbann::IsCloneable_v ()
 
template<typename T >
constexpr bool lbann::IsCloneablePtr_v ()
 
template<typename CloneablePtrT , h2::meta::EnableWhen< IsCloneablePtr< CloneablePtrT >, int > = 1>
auto lbann::clone_all (std::vector< CloneablePtrT > const &things)
 

Variables

template<typename T >
constexpr bool lbann::IsCloneable = IsCloneable_v<T>()
 
template<typename T >
constexpr bool lbann::IsCloneablePtr = IsCloneablePtr_v<T>()
 

Detailed Description

This file implements covariant returns via smart pointers for a polymorphic clone function. The implementation largely follows the solution presented by the FluentC++ blog. Some class/tag names have been updated to be clearer, in my opinion. Additionally, a semi-useful predicate has been added to aid metaprogramming down the line.

Definition in file cloneable.hpp.