AttValPoiTol.h

Classes

AttributeValuePoiTol -- Templated class for aliased, tolerant AttributeValues. (full description)

template <class T> class AttributeValuePoiTol : public AttributeValueTol<T>

Interface

Public Members
AttributeValuePoiTol(T* value, const T &tolerance, const Bool strict)
AttributeValuePoiTol(Vector<T>* value, const T &tolerance, const Bool strict)
AttributeValuePoiTol(const AttributeValuePoiTol<T> &other)
virtual ~AttributeValuePoiTol()
const AttributeValuePoiTol<T>& operator=(const AttributeValuePoiTol<T> &other)
virtual AttributeValueBase *clone() const
virtual void operator+=(const AttributeValueBase &other)
virtual void setValue(const T& value)
virtual void setValue(const Vector<T>& value)
virtual DataType getPointerType() const
virtual String className() const
Private Members
void updatePointerValue() const
const AttributeValuePoiTol<T>& myCast (const AttributeValueBase& other) const
AttributeValuePoiTol()

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

Prerequisite

Etymology

"AttributeValuePoiTol" is a contraction of "Attribute Value", "Pointer" and "Tolerance", and stores an Attribute by aliasing it with a pointer and associating it with some tolerance.

Synopsis

An AttributeValuePoiTol combines the aliasing (via a pointer) provided by the AttributeValuePoi class, and the tolerance provided by the AttributeValueTol class. See these classes for examples.

Motivation

The motivation for this class is to be able to provide in-built tolerance and aliasing for AttributeValues.

To Do

Member Description

AttributeValuePoiTol(T* value, const T &tolerance, const Bool strict)

Constructor for a pointer to a scalar, and a tolerance.

AttributeValuePoiTol(Vector<T>* value, const T &tolerance, const Bool strict)

Constructor for a pointer to a Vector, and a scalar tolerance.

AttributeValuePoiTol(const AttributeValuePoiTol<T> &other)

Copy constructor.

virtual ~AttributeValuePoiTol()

Destructor.

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

Assignment operator.

virtual AttributeValueBase *clone() const

Return a new copy of the AttributeValuePoiTol (virtual constructor).

virtual void operator+=(const AttributeValueBase &other)

Add other to *this. Needs to over-ride base class definition because the pointers need to be dereferenced prior to addition.

virtual void setValue(const T& value)
virtual void setValue(const Vector<T>& value)

Change the value of the AttributeValue.

virtual DataType getPointerType() const

Get the DataType of the aliased variable.

virtual String className() const

Return class name

void updatePointerValue() const

Update the variable that is aliased to the AttributeValuePoiTol.

const AttributeValuePoiTol<T>& myCast (const AttributeValueBase& other) const

Cast from Base class

AttributeValuePoiTol()

Default constructor