template < class C > class CWTemp

Copy on write data vector class template.

Public Fields

typedef unsigned int size_t
General purpose data length type
typedef C container_t
Underlying container type
typedef pair <size_t, container_t> node_t
Node containing the use count and a data container
typedef typename C::iterator iterator
Iterator borrowed from the container
typedef typename C::const_iterator const_iterator
Constant iterator borrowed from container
typedef typename C::value_type value_type
Data type borrowed from container

Public Methods

CWTemp(void)
Default constructor
explicit CWTemp(size_t N)
Copy constructor.
CWTemp(const CWTemp& x)
Copy constructor.
~CWTemp(void)
Destructor.
CWTemp& operator=(const CWTemp& x)
Create a new read instance.
size_t getSize(void) const
Get the CW vector size.
size_t getLength(void) const
Get the CW vector size.
const_iterator begin(void) const
Get an iterator to the first element
iterator begin(void)
Get an iterator to the first element
const_iterator end(void) const
Get an iterator to the last element
iterator end(void)
Get an iterator to the last element
const container_t& getRef(void) const
Get a constant reference to the data vector.
container_t& getRef(void)
Get a writable reference to the data vector.
const value_type& operator[](size_t i) const
Get a constant reference to a data word.
value_type& operator[](size_t i)
Get a writable reference to a data word.

Documentation

The CWTemp template classes allow data in a specified container to be shared by more than one Data vector without forcing a copy. This is especially useful for reducing overheads when passing ownership of long data vectors. A data vector can be copied using the assignment (=) operator, and the data container is referenced with the getRef method.
typedef unsigned int size_t
General purpose data length type

typedef C container_t
Underlying container type

typedef pair <size_t, container_t> node_t
Node containing the use count and a data container

typedef typename C::iterator iterator
Iterator borrowed from the container

typedef typename C::const_iterator const_iterator
Constant iterator borrowed from container

typedef typename C::value_type value_type
Data type borrowed from container

CWTemp(void)
Default constructor

explicit CWTemp(size_t N)
Copy constructor.

CWTemp(const CWTemp& x)
Copy constructor.

~CWTemp(void)
Delete the vector.

CWTemp& operator=(const CWTemp& x)
Get a read-only copy of the pointer.
Returns:
A read-Only pointer.

size_t getSize(void) const
Get the number of words allocated by the CW vector.

size_t getLength(void) const
Get the number of words containing data.

const_iterator begin(void) const
Get an iterator to the first element

iterator begin(void)
Get an iterator to the first element

const_iterator end(void) const
Get an iterator to the last element

iterator end(void)
Get an iterator to the last element

const container_t& getRef(void) const
Get a constant reference to the data vector.

container_t& getRef(void)
Get a writable reference to the data vector.

const value_type& operator[](size_t i) const
Get a constant reference to a data word.

value_type& operator[](size_t i)
Get a writable reference to a data word.


This class has no child classes.
Author:
J. Zweizig.
Version:
1.1; Modified February 23, 2000.

alphabetic index hierarchy of classes


generated by doc++