Home | Download | Screen shots | Discussion | Documentation
--- | --- | --- | --- | ---

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

Concrete reference-counted implementation. More...

`#include <openvrml/field_value.h>`

Inheritance diagram for openvrml::field_value::counted_impl< ValueType >:
[legend]

List of all members.

## 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_base > | do_clone () const throw ( std::bad_alloc )
| Polymorphically construct a copy.

## Private Attributes

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

## Detailed Description

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

Concrete reference-counted implementation.

For internal use only.

Template Parameters:

  | ValueType | a Field Value `value_type`.

## Constructor & Destructor Documentation

template<typename ValueType >

openvrml::field_value::counted_impl< ValueType >::counted_impl | ( | const ValueType & | value | ) | throw ( std::bad_alloc )`[inline, explicit]`

Construct.

Template Parameters:

  | ValueType | a Field Value `value_type`.

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 ()`[inline]`

Construct a copy.

Template Parameters:

  | ValueType | a Field Value `value_type`.

Parameters:

  `[in]` | ci | the instance to copy.

template<typename ValueType >

openvrml::field_value::counted_impl< ValueType >::~counted_impl | ( |  | ) | throw ()`[inline, virtual]`

Destroy.

Template Parameters:

  | ValueType | a Field Value `value_type`.

## Member Function Documentation

template<typename ValueType >

const ValueType & openvrml::field_value::counted_impl< ValueType >::value | ( |  | ) | const throw ()`[inline]`

Access.

Template Parameters:

  | ValueType | a Field Value `value_type`.

Returns:
  the value.

template<typename ValueType >

void openvrml::field_value::counted_impl< ValueType >::value | ( | const ValueType & | val | ) | throw ( std::bad_alloc )`[inline]`

Mutate.

Template Parameters:

  | ValueType | a Field Value `value_type`.

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 )`[inline, private, virtual]`

Polymorphically construct a copy.

Template Parameters:

  | ValueType | a Field Value `value_type`.

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::shared_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