Public Member Functions | Private Types | Private Member Functions | Private Attributes
ProgramOptions::ValueStore Class Reference

A type that can hold any kind of value type. More...

#include <value_store.h>

List of all members.

Public Member Functions

template<class T >
ValueStoreassimilate (T *obj)
 stores obj in this and takes over ownership of obj
void clear ()
 destroys and releases any stored value
bool empty () const
 Returns true if holder does not contain a value.
void * extract_raw () const
ValueStoreoperator= (ValueStore other)
 stores a copy of other releasing any previous value
template<class T >
ValueStoreoperator= (const T &obj)
 stores a copy of obj releasing any previous value
void surrender ()
 surrenders any stored value without destroying it
void swap (ValueStore &other)
 swaps this with other
const std::type_info & type () const
 Returns the type of the stored value.
 ValueStore ()
 creates an empty object
 ValueStore (const ValueStore &other)
 copies the value in other
template<class T >
 ValueStore (const T &obj)
 stores a copy of obj
 ~ValueStore ()
 releases any stored value

Private Types

enum  { call_extract = 0, vcall_clone = 1, vcall_destroy = 2, vcall_typeid = 3 }
typedef detail::vptr_type vptr_type

Private Member Functions

void clone (const void *obj, void **out) const
void * extract (void **o) const

Private Attributes

void * value_
vptr_type vptr_

Detailed Description

A type that can hold any kind of value type.

Definition at line 40 of file value_store.h.


Member Typedef Documentation

Definition at line 93 of file value_store.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
call_extract 
vcall_clone 
vcall_destroy 
vcall_typeid 

Definition at line 92 of file value_store.h.


Constructor & Destructor Documentation

creates an empty object

Definition at line 26 of file value_store.cpp.

copies the value in other

Definition at line 30 of file value_store.cpp.

template<class T >
ProgramOptions::ValueStore::ValueStore ( const T &  obj) [inline]

stores a copy of obj

Definition at line 48 of file value_store.h.

releases any stored value

Definition at line 37 of file value_store.cpp.


Member Function Documentation

template<class T >
ValueStore& ProgramOptions::ValueStore::assimilate ( T *  obj) [inline]

stores obj in this and takes over ownership of obj

Precondition:
delete obj is valid

Definition at line 68 of file value_store.h.

destroys and releases any stored value

Definition at line 59 of file value_store.cpp.

void ProgramOptions::ValueStore::clone ( const void *  obj,
void **  out 
) const [private]

Definition at line 70 of file value_store.cpp.

bool ProgramOptions::ValueStore::empty ( ) const [inline]

Returns true if holder does not contain a value.

Definition at line 77 of file value_store.h.

void * ProgramOptions::ValueStore::extract ( void **  o) const [private]

Definition at line 74 of file value_store.cpp.

void* ProgramOptions::ValueStore::extract_raw ( ) const [inline]

Definition at line 86 of file value_store.h.

ValueStore & ProgramOptions::ValueStore::operator= ( ValueStore  other)

stores a copy of other releasing any previous value

Definition at line 40 of file value_store.cpp.

template<class T >
ValueStore& ProgramOptions::ValueStore::operator= ( const T &  obj) [inline]

stores a copy of obj releasing any previous value

Definition at line 59 of file value_store.h.

surrenders any stored value without destroying it

Definition at line 66 of file value_store.cpp.

swaps this with other

Definition at line 44 of file value_store.cpp.

const std::type_info & ProgramOptions::ValueStore::type ( ) const

Returns the type of the stored value.

Definition at line 49 of file value_store.cpp.


Member Data Documentation

Definition at line 97 of file value_store.h.

Definition at line 96 of file value_store.h.


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


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:41