openvrml::field_value::counted_impl< ValueType > Class Template Reference

#include <openvrml/field_value.h>

Inheritance diagram for openvrml::field_value::counted_impl< ValueType >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename ValueType>
class openvrml::field_value::counted_impl< ValueType >

Concrete reference-counted implementation.

For internal use only.


Public Member Functions

 counted_impl (const ValueType &value) throw ( std::bad_alloc )
 Construct.
 counted_impl (const counted_impl< ValueType > &ci) throw ()
 Construct a copy.
virtual ~counted_impl () throw ()
 Destroy.
const ValueType & value () const throw ()
 Access.
void value (const ValueType &val) throw ( std::bad_alloc )
 Mutate.

Private Member Functions

counted_impl< ValueType > & operator= (const counted_impl< ValueType > &)
 Not implemented.
virtual std::auto_ptr< counted_impl_basedo_clone () const throw ( std::bad_alloc )
 Polymorphically construct a copy.

Private Attributes

boost::mutex mutex_
 Mutex protecting value_.
boost::shared_ptr< ValueType > value_
 A shared_ptr to an instance of the value_type of a Field Value.

Constructor & Destructor Documentation

template<typename ValueType>
openvrml::field_value::counted_impl< ValueType >::counted_impl ( const ValueType &  value  )  throw ( std::bad_alloc ) [explicit]

Construct.

Parameters:
[in] value initial value.
Exceptions:
std::bad_alloc if memory allocation fails.

template<typename ValueType>
openvrml::field_value::counted_impl< ValueType >::counted_impl ( const counted_impl< ValueType > &  ci  )  throw ()

Construct a copy.

Parameters:
[in] ci the instance to copy.

template<typename ValueType>
openvrml::field_value::counted_impl< ValueType >::~counted_impl (  )  throw () [virtual]

Destroy.


Member Function Documentation

template<typename ValueType>
const ValueType & openvrml::field_value::counted_impl< ValueType >::value (  )  const throw ()

Access.

Returns:
the value.

template<typename ValueType>
void openvrml::field_value::counted_impl< ValueType >::value ( const ValueType &  val  )  throw ( std::bad_alloc )

Mutate.

Parameters:
[in] val the new value.
Exceptions:
std::bad_alloc if memory allocation fails.

template<typename ValueType>
openvrml::field_value::counted_impl< ValueType > & openvrml::field_value::counted_impl< ValueType >::operator= ( const counted_impl< ValueType > &   )  [private]

Not implemented.

template<typename ValueType>
std::auto_ptr< field_value::counted_impl_base > openvrml::field_value::counted_impl< ValueType >::do_clone (  )  const throw ( std::bad_alloc ) [private, virtual]

Polymorphically construct a copy.

Returns:
a clone of the instance.
Exceptions:
std::bad_alloc if memory allocation fails.

Implements openvrml::field_value::counted_impl_base.


Member Data Documentation

template<typename ValueType>
boost::mutex openvrml::field_value::counted_impl< ValueType >::mutex_ [mutable, private]

Mutex protecting value_.

template<typename ValueType>
boost::shared_ptr< ValueType > openvrml::field_value::counted_impl< ValueType >::value_ [private]

A shared_ptr to an instance of the value_type of a Field Value.

See also:
http://boost.org/libs/smart_ptr/shared_ptr.htm