casa
$Rev:20696$
|
Templated class for aliased, tolerant AttributeValues. More...
#include <AttValPoiTol.h>
Public Member Functions | |
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 . | |
virtual void | setValue (const T &value) |
Change the value of the AttributeValue. | |
virtual void | setValue (const Vector< T > &value) |
virtual DataType | getPointerType () const |
Get the DataType of the aliased variable. | |
virtual String | className () const |
Return class name. | |
Private Member Functions | |
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. | |
Private Attributes | |
Vector< T > * | itsVectorPointerPtr |
Pointer to the aliased variable. | |
T * | itsScalarPointerPtr |
DataType | itsPointerType |
The pointer DataType. |
Templated class for aliased, tolerant AttributeValues.
Internal
"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.
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.
The motivation for this class is to be able to provide in-built tolerance and aliasing for AttributeValues.
Definition at line 73 of file AttValPoiTol.h.
casa::AttributeValuePoiTol< T >::AttributeValuePoiTol | ( | T * | value, |
const T & | tolerance, | ||
const Bool | strict | ||
) |
Constructor for a pointer to a scalar, and a tolerance.
casa::AttributeValuePoiTol< T >::AttributeValuePoiTol | ( | Vector< T > * | value, |
const T & | tolerance, | ||
const Bool | strict | ||
) |
Constructor for a pointer to a Vector
, and a scalar tolerance.
casa::AttributeValuePoiTol< T >::AttributeValuePoiTol | ( | const AttributeValuePoiTol< T > & | other | ) |
Copy constructor.
virtual casa::AttributeValuePoiTol< T >::~AttributeValuePoiTol | ( | ) | [virtual] |
Destructor.
casa::AttributeValuePoiTol< T >::AttributeValuePoiTol | ( | ) | [private] |
Default constructor.
virtual String casa::AttributeValuePoiTol< T >::className | ( | ) | const [inline, virtual] |
Return class name.
Reimplemented from casa::AttributeValueTol< T >.
Definition at line 113 of file AttValPoiTol.h.
References String.
virtual AttributeValueBase* casa::AttributeValuePoiTol< T >::clone | ( | ) | const [virtual] |
Return a new copy of the AttributeValuePoiTol (virtual constructor).
Reimplemented from casa::AttributeValueTol< T >.
virtual DataType casa::AttributeValuePoiTol< T >::getPointerType | ( | ) | const [virtual] |
Get the DataType of the aliased variable.
const AttributeValuePoiTol<T>& casa::AttributeValuePoiTol< T >::myCast | ( | const AttributeValueBase & | other | ) | const [private] |
Cast from Base class.
Reimplemented from casa::AttributeValue< T >.
virtual void casa::AttributeValuePoiTol< T >::operator+= | ( | const AttributeValueBase & | other | ) | [virtual] |
Add other
to *this
.
Needs to over-ride base class definition because the pointers need to be dereferenced prior to addition.
Reimplemented from casa::AttributeValue< T >.
const AttributeValuePoiTol<T>& casa::AttributeValuePoiTol< T >::operator= | ( | const AttributeValuePoiTol< T > & | other | ) |
Assignment operator.
virtual void casa::AttributeValuePoiTol< T >::setValue | ( | const T & | value | ) | [virtual] |
Change the value of the AttributeValue.
Reimplemented from casa::AttributeValue< T >.
virtual void casa::AttributeValuePoiTol< T >::setValue | ( | const Vector< T > & | value | ) | [virtual] |
Reimplemented from casa::AttributeValue< T >.
void casa::AttributeValuePoiTol< T >::updatePointerValue | ( | ) | const [private] |
Update the variable that is aliased to the AttributeValuePoiTol.
DataType casa::AttributeValuePoiTol< T >::itsPointerType [private] |
The pointer DataType.
Definition at line 129 of file AttValPoiTol.h.
T* casa::AttributeValuePoiTol< T >::itsScalarPointerPtr [private] |
Definition at line 125 of file AttValPoiTol.h.
Vector<T>* casa::AttributeValuePoiTol< T >::itsVectorPointerPtr [private] |
Pointer to the aliased variable.
Only one is ever active depending upon how the object was constructed. The memory allocated to these pointers does not belong to this object.
Definition at line 124 of file AttValPoiTol.h.