LAMA
lama::LAMAArrayConstView< T > Class Template Reference

LAMAArrayConstView is a proxy which gives a constant view to a sub range of a LAMAArray. More...

#include <LAMAArrayView.hpp>

Inheritance diagram for lama::LAMAArrayConstView< T >:

Public Types

typedef T ValueType
 ValueType is the type stored in this container.

Public Member Functions

 LAMAArrayConstView (const LAMAArrayConstView< T > &other)
 Takes a copy of the passed LAMAArrayConstView.
 LAMAArrayConstView (const LAMAArrayView< T > &view)
 Takes a copy of the passed LAMAArrayView.
 LAMAArrayConstView (const LAMAArray< T > &array)
 Constructs a view into the whole passed LAMAArray.
 LAMAArrayConstView (const LAMAArray< T > &array, const IndexType offset, const IndexType size)
 Constructs a view of the passed size into the passed LAMAArray starting at the passed offset.
virtual ~LAMAArrayConstView ()
 destroys this LAMAArrayView, the referenced LAMAArray is not touched.
IndexType size () const
 Returns the size of this LAMAArrayView.
virtual void writeAt (std::ostream &stream) const
 Writes some Information about this to the passed stream.
bool operator== (const LAMAArrayConstView< T > &other) const
 Checks if the LAMAArray referenced by other is the same than the LAMAArray reference by this.
bool operator!= (const LAMAArrayConstView< T > &other) const
 Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this.
bool operator== (const LAMAArrayView< T > &other) const
 Checks if the LAMAArray referenced by other is the same than the LAMAArray reference by this.
bool operator!= (const LAMAArrayView< T > &other) const
 Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this.

Private Member Functions

 LAMAArrayConstView ()
LAMAArrayConstViewoperator= (const LAMAArrayConstView< T > &other)
const ValueTypeget (const size_t index) const
int acquireReadAccess (ContextPtr context) const
void releaseReadAccess (const size_t index) const

Private Attributes

const LAMAArray< T > & mArray
const IndexType mOffset
const IndexType mSize

Friends

class ReadAccess< T >

Detailed Description

template<typename T>
class lama::LAMAArrayConstView< T >

LAMAArrayConstView is a proxy which gives a constant view to a sub range of a LAMAArray.


Member Typedef Documentation

template<typename T>
typedef T lama::LAMAArrayConstView< T >::ValueType

ValueType is the type stored in this container.


Constructor & Destructor Documentation

template<typename T>
lama::LAMAArrayConstView< T >::LAMAArrayConstView ( const LAMAArrayConstView< T > &  other)

Takes a copy of the passed LAMAArrayConstView.

Parameters:
[in]otherthe LAMAArrayConstView to take a copy from.
template<typename T>
lama::LAMAArrayConstView< T >::LAMAArrayConstView ( const LAMAArrayView< T > &  view)

Takes a copy of the passed LAMAArrayView.

Parameters:
[in]viewthe LAMAArrayView to take a copy from.
template<typename T>
lama::LAMAArrayConstView< T >::LAMAArrayConstView ( const LAMAArray< T > &  array)

Constructs a view into the whole passed LAMAArray.

Parameters:
[in,out]arraythe array to get a view into.
template<typename T>
lama::LAMAArrayConstView< T >::LAMAArrayConstView ( const LAMAArray< T > &  array,
const IndexType  offset,
const IndexType  size 
)

Constructs a view of the passed size into the passed LAMAArray starting at the passed offset.

Parameters:
[in,out]arraythe array to get a view into.
[in]offsetthe index where the view into array should start.
[in]sizethe lenght of the subrange of array.

References LAMA_THROWEXCEPTION, lama::LAMAArrayConstView< T >::mArray, lama::LAMAArrayConstView< T >::mOffset, and lama::LAMAArrayConstView< T >::mSize.

template<typename T >
lama::LAMAArrayConstView< T >::~LAMAArrayConstView ( ) [virtual]

destroys this LAMAArrayView, the referenced LAMAArray is not touched.

template<typename T>
lama::LAMAArrayConstView< T >::LAMAArrayConstView ( ) [private]

Member Function Documentation

template<typename T >
int lama::LAMAArrayConstView< T >::acquireReadAccess ( ContextPtr  context) const [private]
template<typename T >
const T * lama::LAMAArrayConstView< T >::get ( const size_t  index) const [private]
template<typename T>
bool lama::LAMAArrayConstView< T >::operator!= ( const LAMAArrayConstView< T > &  other) const

Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this.

Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this. CAVEAT: It is only checked if the LAMAArrays are not the same. Size and offset of the views are not checked for inequality.

Parameters:
[in]otherthe LAMAArrayConstView to compare this with.
Returns:
if this and other are referencing different LAMAArrays.
template<typename T>
bool lama::LAMAArrayConstView< T >::operator!= ( const LAMAArrayView< T > &  other) const

Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this.

Checks if the LAMAArray referenced by other is not the same than the LAMAArray reference by this. CAVEAT: It is only checked if the LAMAArrays are not the same. Size and offset of the views are not checked for inequality.

Parameters:
[in]otherthe LAMAArrayView to compare this with.
Returns:
if this and other are referencing different LAMAArrays.
template<typename T>
LAMAArrayConstView& lama::LAMAArrayConstView< T >::operator= ( const LAMAArrayConstView< T > &  other) [private]
template<typename T>
bool lama::LAMAArrayConstView< T >::operator== ( const LAMAArrayConstView< T > &  other) const

Checks if the LAMAArray referenced by other is the same than the LAMAArray reference by this.

Checks if the the LAMAArray referenced by other is the same than the LAMAArray reference by this. CAVEAT: It is only checked if the LAMAArrays are the same. Size and offset of the views are not checked for equality.

Parameters:
[in]otherthe LAMAArrayConstView to compare this with.
Returns:
if this and other are referencing the same LAMAArray.

References lama::LAMAArrayConstView< T >::mArray.

template<typename T>
bool lama::LAMAArrayConstView< T >::operator== ( const LAMAArrayView< T > &  other) const

Checks if the LAMAArray referenced by other is the same than the LAMAArray reference by this.

Checks if the LAMAArray referenced by other is the same than the LAMAArray reference by this. CAVEAT: It is only checked if the LAMAArrays are the same. Size and offset of the views are not checked for equality.

Parameters:
[in]otherthe LAMAArrayView to compare this with.
Returns:
if this and other are referencing the same LAMAArray.

References lama::LAMAArrayView< T >::mArray.

template<typename T >
void lama::LAMAArrayConstView< T >::releaseReadAccess ( const size_t  index) const [private]
template<typename T >
void lama::LAMAArrayConstView< T >::writeAt ( std::ostream &  stream) const [virtual]

Writes some Information about this to the passed stream.

If a deriving class does not overrides writeAt, typeid(this).name() is written to stream.

Parameters:
[out]streamthe stream to write to.

Reimplemented from Printable.


Friends And Related Function Documentation

template<typename T>
friend class ReadAccess< T > [friend]

Field Documentation

template<typename T>
const IndexType lama::LAMAArrayConstView< T >::mOffset [private]
template<typename T>
const IndexType lama::LAMAArrayConstView< T >::mSize [private]

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