LELArray.h

Classes

LELArray -- This LEL class holds an array with a mask. (full description)
LELArrayRef -- This LEL class holds a possible referenced array with a mask. (full description)

template <class T> class LELArray : public LELArrayBase

Interface

Public Members
LELArray (const Array<T>& value) : itsValue (value)
LELArray (const Array<T>& value, const Array<Bool>& mask) : LELArrayBase (mask), itsValue (value)
LELArray (const IPosition& shape)
LELArray (const LELArray<T>& other)
~LELArray()
LELArray<T>& operator= (const LELArray<T>& other)
const IPosition& shape() const
const Array<T>& value() const
Array<T>& value()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Synopsis

This LEL class holds an array with a mask. The mask can be a single Bool valid for all elements of the array. Otherwise it is a full mask with the same shape as the array.

Motivation

It makes it possible to handle an array with its mask as a single object.

To Do

Member Description

LELArray (const Array<T>& value) : itsValue (value)

Constructor takes value. Its mask is set to all True.

LELArray (const Array<T>& value, const Array<Bool>& mask) : LELArrayBase (mask), itsValue (value)

Constructor takes value and mask.

LELArray (const IPosition& shape)

Constructor takes shape. Its mask is set to all True.

LELArray (const LELArray<T>& other)

Copy constructor (reference semantics).

~LELArray()

LELArray<T>& operator= (const LELArray<T>& other)

Assignment (reference semantics).

const IPosition& shape() const

Get shape (of the value).

const Array<T>& value() const
Array<T>& value()

Get value.


template <class T> class LELArrayRef : public LELArray<T>

Interface

LELArrayRef (const IPosition& shape) : LELArray<T> (shape)
~LELArrayRef()
const Array<T>& value() const
Private Members
LELArrayRef (const LELArrayRef<T>& other)
LELArrayRef<T>& operator= (const LELArrayRef<T>& other)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Synopsis

This LEL class is derived from LELArray. Its purpose is to provide only const access to the array value, so the array can be a reference to another array. It is meant for optimization, so references can safely be used when evaluating a subexpression.

Motivation

It makes it possible to use the function evalRef in a safe way. It would be unsafe to use a LELArray object, because that gives non-const access to the value.

To Do

Member Description

LELArrayRef (const IPosition& shape) : LELArray<T> (shape)

Constructor takes shape. Its mask is set to all True.

~LELArrayRef()

const Array<T>& value() const

Get value.

LELArrayRef (const LELArrayRef<T>& other)

Copy constructor is not needed.

LELArrayRef<T>& operator= (const LELArrayRef<T>& other)

Assignment is not needed.