SourceForge.net Logo

eval::detail::val Class Reference

A generic class for wrapping any type of object/primitive. More...

#include <val.hpp>

Collaboration diagram for eval::detail::val:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 val ()
 Create an empty val.
template<typename ValT>
 val (ValT *value, ownership_type_nocopy ownership_type)
template<typename ValT>
 val (const ValT *value, ownership_type_nocopy ownership_type)
template<typename ValT>
 val (const boost::shared_ptr< ValT > &value, ownership_type_shared_ptr)
template<typename ValT>
 val (const boost::shared_ptr< const ValT > &value, ownership_type_shared_ptr)
template<typename ValT>
 val (const boost::shared_array< ValT > &value, ownership_type_shared_array)
template<typename ValT>
 val (const boost::shared_array< const ValT > &value, ownership_type_shared_array)
template<typename ValT>
 val (ValT &value, ownership_type_copy)
template<typename ValT>
 val (const ValT &value, ownership_type_copy)
 val (const val &other)
void swap (val &other)
valoperator= (val rhs)
bool empty () const
bool will_copy_deeply () const
bool is_const () const
large_int coerce_int () const
double coerce_double () const
std::string coerce_string () const
const std::type_info & type () const
bool points_to_same_object_as (const val &rhs) const
 Returns true only if (but not necessarily if) this wraps the same instance as rhs.
 ~val ()

Private Attributes

const storage_base_common_store

Friends

template<typename ValT>
ValT * val_cast_ptr_helper (const val &v, const boost::true_type &)
 ValT will be a const type (indicated by 2nd argument).
template<typename ValT>
ValT * val_cast_ptr_helper (const val &v, const boost::false_type &)
 ValT will not be a const type (indicated by 2nd argument).


Detailed Description

A generic class for wrapping any type of object/primitive.
Examples:

val_example.cpp.


Constructor & Destructor Documentation

eval::detail::val::val (  )  [inline]

Create an empty val.

template<typename ValT>
eval::detail::val::val ( ValT *  value,
ownership_type_nocopy  ownership_type 
) [inline]

template<typename ValT>
eval::detail::val::val ( const ValT *  value,
ownership_type_nocopy  ownership_type 
) [inline]

template<typename ValT>
eval::detail::val::val ( const boost::shared_ptr< ValT > &  value,
ownership_type_shared_ptr   
) [inline]

template<typename ValT>
eval::detail::val::val ( const boost::shared_ptr< const ValT > &  value,
ownership_type_shared_ptr   
) [inline]

template<typename ValT>
eval::detail::val::val ( const boost::shared_array< ValT > &  value,
ownership_type_shared_array   
) [inline]

template<typename ValT>
eval::detail::val::val ( const boost::shared_array< const ValT > &  value,
ownership_type_shared_array   
) [inline]

template<typename ValT>
eval::detail::val::val ( ValT &  value,
ownership_type_copy   
) [inline]

template<typename ValT>
eval::detail::val::val ( const ValT &  value,
ownership_type_copy   
) [inline]

eval::detail::val::val ( const val other  )  [inline]

Either a shallow or deep copy will be made, depending on the constructor used to create other.

See also:
will_copy_deeply()

eval::detail::val::~val (  )  [inline]


Member Function Documentation

void eval::detail::val::swap ( val other  )  [inline]

val& eval::detail::val::operator= ( val  rhs  )  [inline]

Either a shallow or deep copy will be made, depending on the constructor used to create rhs.

See also:
will_copy_deeply()

bool eval::detail::val::empty (  )  const [inline]

Returns:
true iff this is empty (i.e. default constructed or constructed with a NULL pointer).

bool eval::detail::val::will_copy_deeply (  )  const [inline]

bool eval::detail::val::is_const (  )  const [inline]

large_int eval::detail::val::coerce_int (  )  const [inline]

Exceptions:
empty_exception if this is empty
overflow_exception on underflow or overflow
non_numeric_exception if conversion not possible
Examples:
val_example.cpp.

double eval::detail::val::coerce_double (  )  const [inline]

Exceptions:
empty_exception if this is empty
overflow_exception on underflow or overflow
non_numeric_exception if conversion not possible

std::string eval::detail::val::coerce_string (  )  const [inline]

Exceptions:
empty_exception if this is empty
non_ostreamable_exception if conversion not possible
Examples:
val_example.cpp.

const std::type_info& eval::detail::val::type (  )  const [inline]

bool eval::detail::val::points_to_same_object_as ( const val rhs  )  const [inline]

Returns true only if (but not necessarily if) this wraps the same instance as rhs.

In the special case that at least one of this or rhs are empty(), returns true if and only if both are empty().

Warning:
Note the careful wording of the specification. The only guarantee that this method makes is that if it returns true, this and rhs wrap the same instance. So, in other words, it may return false even if this and rhs wrap the same instance. For example, this may occur if this was created using a pointer cast to a base class, whereas rhs was created using the uncast pointer.
See also:
eval::execution_context::point_to_same_obj


Friends And Related Function Documentation

template<typename ValT>
ValT* val_cast_ptr_helper ( const val v,
const boost::true_type &   
) [friend]

ValT will be a const type (indicated by 2nd argument).

template<typename ValT>
ValT* val_cast_ptr_helper ( const val v,
const boost::false_type &   
) [friend]

ValT will not be a const type (indicated by 2nd argument).


Member Data Documentation


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

Generated on Sat Sep 20 20:02:34 2008 for eval by  doxygen 1.5.6