In file CWVec/CWTemp.hh:

template < class C > class CWTemp

Copy on write data vector class template.

Inheritance:


Public Fields

typedef unsigned long size_type
General purpose data length type
typedef C container_type
Underlying container type
typedef std::pair <size_type, container_type> node_type
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_type N)
Copy constructor.
CWTemp (const CWTemp& x)
Copy constructor.
~CWTemp (void)
Destructor.
CWTemp& operator= (const CWTemp& x)
Create a new read instance.
size_type getSize (void) const
Get the CW vector size.
size_type 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_type& getRef (void) const
Get a constant reference to the data vector.
container_type& getRef (void)
Get a writable reference to the data vector.
const value_type& operator[] (size_type i) const
Get a constant reference to a data word.
value_type& operator[] (size_type 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 long size_type
General purpose data length type

typedef C container_type
Underlying container type

typedef std::pair <size_type, container_type> node_type
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_type 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_type getSize(void) const
Get the number of words allocated by the CW vector.

size_type 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_type& getRef(void) const
Get a constant reference to the data vector.

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

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

value_type& operator[](size_type 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


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++