[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

Public Types | Public Member Functions | List of all members
ArrayVectorView< T > Class Template Reference

`#include <vigra/array_vector.hxx>`

Inheritance diagram for ArrayVectorView< T >:

## Public Types

typedef T | value_type

## Public Member Functions

| ArrayVectorView ()
| ArrayVectorView (size_type size, pointer const &data)
| ArrayVectorView (this_type const &rhs)
reference | back ()
const_reference | back () const
iterator | begin ()
const_iterator | begin () const
const_iterator | cbegin () const
const_iterator | cend () const
template<class U>
void | copy (ArrayVectorView< U > const &rhs)
void | copy (this_type const &rhs)
const_reverse_iterator | crbegin () const
const_reverse_iterator | crend () const
pointer | data ()
const_pointer | data () const
bool | empty () const
iterator | end ()
const_iterator | end () const
reference | front ()
const_reference | front () const
template<class U>
void | init (U const &initial)
bool | isInside (difference_type const &p) const
template<class U>
bool | operator!= (ArrayVectorView< U > const &rhs) const
ArrayVectorView & | operator= (ArrayVectorView const &rhs)
template<class U>
this_type & | operator= (ArrayVectorView< U > const &rhs)
template<class U>
bool | operator== (ArrayVectorView< U > const &rhs) const
reference | operator[] (difference_type i)
const_reference | operator[] (difference_type i) const
reverse_iterator | rbegin ()
const_reverse_iterator | rbegin () const
reverse_iterator | rend ()
const_reverse_iterator | rend () const
size_type | size () const
this_type | subarray (size_type begin, size_type end) const
template<class U>
void | swapData (ArrayVectorView< U > rhs)
void | swapData (this_type rhs)

## Detailed Description

template<class T>
class vigra::ArrayVectorView< T >

Provide STL conforming interface for C-arrays.

This template implements much of the functionality of std::vector on top of a C-array. ArrayVectorView does not manage the memory it refers to (i.e. it does not allocate or deallocate any memory). Thus, if the underlying memory changes, all dependent ArrayVectorView objects are invalidated. This is especially important when ArrayVectorView is used as a base class for ArrayVector, where several functions (e.g. resize(), insert()) can allocate new memory and thus invalidate the dependent views. The rules what operations invalidate view objects are the same as the rules concerning standard iterators.

#include <vigra/array_vector.hxx>
Namespace: vigra

## Member Typedef Documentation

## ◆ value_type

template<class T>

typedef T value_type

default constructor

## Constructor & Destructor Documentation

## ◆ ArrayVectorView() [1/3]

template<class T>

ArrayVectorView | ( |  | ) |

default constructor. View contains NULL pointer.

## ◆ ArrayVectorView() [2/3]

template<class T>

ArrayVectorView | ( | size_type | size,
|  | pointer const & | data )

Construct for given array data of length size. data, data+size must form a valid range.

## ◆ ArrayVectorView() [3/3]

template<class T>

ArrayVectorView | ( | this_type const & | rhs | ) |

Copy constructor.

## Member Function Documentation

## ◆ operator=() [1/2]

template<class T>

ArrayVectorView & operator= | ( | ArrayVectorView< T > const & | rhs | ) |

Copy assignment. There are 3 cases:

- When this ArrayVectorView does not point to valid data (e.g. after default construction), it becomes a copy of rhs.
- When the shapes of the two arrays match, the array contents (not the pointers) are copied.
- Otherwise, a PreconditionViolation exception is thrown.

## ◆ operator=() [2/2]

template<class T>
template<class U>

this_type & operator= | ( | ArrayVectorView< U > const & | rhs | ) |

Copy assignment. When the shapes of the two arrays match, the array contents (not the pointers) are copied. Otherwise, a PreconditionViolation exception is thrown.

## ◆ init()

template<class T>
template<class U>

void init | ( | U const & | initial | ) |

Overwrite all array elements with the value initial.

## ◆ copy() [1/2]

template<class T>

void copy | ( | this_type const & | rhs | ) |

Copy array elements. When the shapes of the two arrays match, the array contents (not the pointers) are copied. Otherwise, a PreconditionViolation exception is thrown.

## ◆ copy() [2/2]

template<class T>
template<class U>

void copy | ( | ArrayVectorView< U > const & | rhs | ) |

Copy array elements. When the shapes of the two arrays match, the array contents (not the pointers) are copied. Otherwise, a PreconditionViolation exception is thrown.

## ◆ swapData() [1/2]

template<class T>

void swapData | ( | this_type | rhs | ) |

Swap array elements. When the shapes of the two arrays match, the array contents (not the pointers) are swapped. Otherwise, a PreconditionViolation exception is thrown.

## ◆ swapData() [2/2]

template<class T>
template<class U>

void swapData | ( | ArrayVectorView< U > | rhs | ) |

Swap array elements. When the shapes of the two arrays match, the array contents (not the pointers) are swapped. Otherwise, a PreconditionViolation exception is thrown.

## ◆ subarray()

template<class T>

this_type subarray | ( | size_type | begin,
|  | size_type | end ) const

Construct ArrayVectorView referring to a subarray. begin and end must be a valid sub-range of the current array. Otherwise, a PreconditionViolation exception is thrown.

## ◆ data() [1/2]

template<class T>

const_pointer data | ( |  | ) | const

Get contained const pointer to the data.

## ◆ data() [2/2]

template<class T>

pointer data | ( |  | ) |

Get contained pointer to the data.

## ◆ begin() [1/2]

template<class T>

const_iterator begin | ( |  | ) | const

Get const iterator referring to the first array element.

## ◆ begin() [2/2]

template<class T>

iterator begin | ( |  | ) |

Get iterator referring to the first array element.

## ◆ end() [1/2]

template<class T>

const_iterator end | ( |  | ) | const

Get const iterator pointing beyond the last array element.

## ◆ end() [2/2]

template<class T>

iterator end | ( |  | ) |

Get iterator pointing beyond the last array element.

## ◆ cbegin()

template<class T>

const_iterator cbegin | ( |  | ) | const

Get const iterator referring to the first array element.

## ◆ cend()

template<class T>

const_iterator cend | ( |  | ) | const

Get const iterator pointing beyond the last array element.

## ◆ rbegin() [1/2]

template<class T>

reverse_iterator rbegin | ( |  | ) |

Get reverse iterator referring to the last array element.

## ◆ rbegin() [2/2]

template<class T>

const_reverse_iterator rbegin | ( |  | ) | const

Get const reverse iterator referring to the last array element.

## ◆ rend() [1/2]

template<class T>

reverse_iterator rend | ( |  | ) |

Get reverse iterator pointing before the first array element.

## ◆ rend() [2/2]

template<class T>

const_reverse_iterator rend | ( |  | ) | const

Get const reverse iterator pointing before the first array element.

## ◆ crbegin()

template<class T>

const_reverse_iterator crbegin | ( |  | ) | const

Get const reverse iterator referring to the last array element.

## ◆ crend()

template<class T>

const_reverse_iterator crend | ( |  | ) | const

Get const reverse iterator pointing before the first array element.

## ◆ front() [1/2]

template<class T>

reference front | ( |  | ) |

Access first array element.

## ◆ front() [2/2]

template<class T>

const_reference front | ( |  | ) | const

Read first array element.

## ◆ back() [1/2]

template<class T>

reference back | ( |  | ) |

Access last array element.

## ◆ back() [2/2]

template<class T>

const_reference back | ( |  | ) | const

Read last array element.

## ◆ operator[]() [1/2]

template<class T>

reference operator[] | ( | difference_type | i | ) |

Access array element i.

## ◆ operator[]() [2/2]

template<class T>

const_reference operator[] | ( | difference_type | i | ) | const

Read array element i.

## ◆ empty()

template<class T>

bool empty | ( |  | ) | const

Equivalent to size() == 0.

## ◆ size()

template<class T>

size_type size | ( |  | ) | const

Number of elements in the array.

## ◆ operator==()

template<class T>
template<class U>

bool operator== | ( | ArrayVectorView< U > const & | rhs | ) | const

Check for element-wise equality of two array. Also returns false if the two arrays have different sizes.

## ◆ operator!=()

template<class T>
template<class U>

bool operator!= | ( | ArrayVectorView< U > const & | rhs | ) | const

check whether two arrays are not elementwise equal. Also returns true if the two arrays have different sizes.

## ◆ isInside()

template<class T>

bool isInside | ( | difference_type const & | p | ) | const

check whether the given point is in the array range.

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

- vigra/array_vector.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.12.4