|
lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Cloneable object class that stores an automatic instance of the given cloneable type. More...
#include <cloneable_obj.h>
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_obj & | operator= (const value_type &cloneable) |
| Replaces the stored cloneable value with a clone of the given cloneable value. | |
| cloneable_obj & | operator= (const value_type *cloneable) |
| Replaces the stored cloneable value with a clone of the given cloneable value (nullptr allowed). | |
| cloneable_obj & | operator= (const cloneable_obj &right) |
| Replaces the stored cloneable value with a clone of the given cloneable object. | |
| value_type & | get (void) |
| Gets the value stored by this cloneable object. | |
| maybe_const_value_type & | get (void) const |
| Gets the value stored by this cloneable object. | |
| value_type * | getptr (void) |
| Gets the value stored by this cloneable object. | |
| maybe_const_value_type * | getptr (void) const |
| Gets the value stored by this cloneable object. | |
| bool | valid () const |
| Gets whether this cloneable object is currently storing a value. | |
| value_type & | operator* () |
| Gets the value stored by this cloneable object. | |
| maybe_const_value_type & | operator* () const |
| Gets the value stored by this cloneable object. | |
| value_type * | operator-> () |
| Gets the value stored by this cloneable object. | |
| maybe_const_value_type * | operator-> () 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. | |
Cloneable object class that stores an automatic instance of the given cloneable type.
1.7.6.1