lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions | Static Public Member Functions
lean::smart::cloneable_obj< Cloneable, PointerSemantics > Class Template Reference

Cloneable object class that stores an automatic instance of the given cloneable type. More...

#include <cloneable_obj.h>

List of all members.

Public Types

typedef Cloneable value_type
 Type of the cloneable value stored by this cloneable object.
typedef conditional_type
< PointerSemantics, value_type,
const value_type >::type 
maybe_const_value_type
 Const value_type for value semantics, value_type for pointer semantics.

Public Member Functions

 cloneable_obj (const value_type &cloneable)
 Constructs a cloneable object by cloning the given cloneable value.
 cloneable_obj (const cloneable_obj &right)
 Constructs a cloneable object by cloning the given cloneable object.
 cloneable_obj (const value_type *cloneable)
 Constructs a cloneable object by cloning the given cloneable object (nullptr allowed).
 ~cloneable_obj () throw ()
 Destroys the cloneable object.
cloneable_objoperator= (const value_type &cloneable)
 Replaces the stored cloneable value with a clone of the given cloneable value.
cloneable_objoperator= (const value_type *cloneable)
 Replaces the stored cloneable value with a clone of the given cloneable value (nullptr allowed).
cloneable_objoperator= (const cloneable_obj &right)
 Replaces the stored cloneable value with a clone of the given cloneable object.
value_typeget (void)
 Gets the value stored by this cloneable object.
maybe_const_value_typeget (void) const
 Gets the value stored by this cloneable object.
value_typegetptr (void)
 Gets the value stored by this cloneable object.
maybe_const_value_typegetptr (void) const
 Gets the value stored by this cloneable object.
bool valid () const
 Gets whether this cloneable object is currently storing a value.
value_typeoperator* ()
 Gets the value stored by this cloneable object.
maybe_const_value_typeoperator* () const
 Gets the value stored by this cloneable object.
value_typeoperator-> ()
 Gets the value stored by this cloneable object.
maybe_const_value_typeoperator-> () const
 Gets the value stored by this cloneable object.
 operator value_type & ()
 Gets the value stored by this cloneable object.
 operator maybe_const_value_type & () const
 Gets the value stored by this cloneable object.

Static Public Member Functions

static LEAN_INLINE cloneable_obj null ()
 Gets a null cloneable object that may only be copied from and assigned to.

Detailed Description

template<class Cloneable, bool PointerSemantics = false>
class lean::smart::cloneable_obj< Cloneable, PointerSemantics >

Cloneable object class that stores an automatic instance of the given cloneable type.


The documentation for this class was generated from the following file: