casa
5.7.0-16
|
Base class for values of Attributes used in the display classes. More...
#include <AttValBase.h>
Public Member Functions | |
AttributeValueBase (AttValue::ValueType type, casacore::Bool strict) | |
Constructor. More... | |
AttributeValueBase (const AttributeValueBase &other) | |
Copy constructor. More... | |
virtual | ~AttributeValueBase () |
Destructor. More... | |
const AttributeValueBase & | operator= (const AttributeValueBase &other) |
Copy assignment. More... | |
AttValue::ValueType | getType () const |
Get the type of the value stored. More... | |
casacore::Bool | operator== (const AttributeValueBase &other) const |
Check for equality (and inequality) of two objects derived from AttributeValueBase. More... | |
casacore::Bool | operator!= (const AttributeValueBase &other) const |
virtual AttributeValueBase * | clone () const =0 |
Return a new copy of the AttributeValueBase. More... | |
virtual void | setStrictness (const casacore::Bool &newStrict) |
Set/get the strictness state of this AttributeValue. More... | |
virtual casacore::Bool | getStrictness () const |
virtual void | operator+= (const AttributeValueBase &other)=0 |
Add other to *this . More... | |
virtual casacore::String | className () const |
Return class name. More... | |
virtual void | print (std::ostream &os)=0 |
Protected Member Functions | |
virtual casacore::Bool | matches (const AttributeValueBase &other) const =0 |
Calculate whether *this matches other . More... | |
virtual void | setType (const AttValue::ValueType &newType) |
Set the type of the value stored. More... | |
casacore::Bool | myMatch (const AttributeValueBase &other) const |
Check that private data match. More... | |
Protected Attributes | |
AttValue::ValueType | itsValueType |
The type of what is stored. More... | |
casacore::Bool | itsStrictness |
Whether the match is strict or not. More... | |
Base class for values of Attributes used in the display classes.
Public interface
"AttributeValueBase" is a concatenation, representing a "Base" class for "Attribute Values."
This class is the base for storing Attribute values. Attributes are simple name-value pairs, where the name is a casacore::String, and the value can be a scalar or Array.
This class defines the type-independent interface for Attribute values, and the type-dependent interface and implementation is provided in AttributeValue . This type independent interface allows comparison of Attributes of different types.
To provide the non-templated (ie. type-independent) interface of AttributeValues in a single place, thus enabling the hiding of the templated aspect of Attributes from the end-user. In particular it allows implementation of the comparison operators in the base class, regardless of type.
Definition at line 182 of file AttValBase.h.
casa::AttributeValueBase::AttributeValueBase | ( | AttValue::ValueType | type, |
casacore::Bool | strict | ||
) |
Constructor.
casa::AttributeValueBase::AttributeValueBase | ( | const AttributeValueBase & | other | ) |
Copy constructor.
|
virtual |
Destructor.
|
inlinevirtual |
Return class name.
Reimplemented in casa::AttributeValue< T >, casa::AttributeValuePoi< T >, casa::AttributeValueTol< T >, and casa::AttributeValuePoiTol< T >.
Definition at line 230 of file AttValBase.h.
|
pure virtual |
Return a new copy of the AttributeValueBase.
Implemented in casa::AttributeValue< T >, casa::AttributeValuePoi< T >, casa::AttributeValueTol< T >, and casa::AttributeValuePoiTol< T >.
|
virtual |
AttValue::ValueType casa::AttributeValueBase::getType | ( | ) | const |
Get the type of the value stored.
|
protectedpure virtual |
Calculate whether *this
matches other
.
Since the meaning of "match" can be different for different types, it is left to the derived class to define this method.
Implemented in casa::AttributeValue< T >, and casa::AttributeValueTol< T >.
|
protected |
Check that private data match.
casacore::Bool casa::AttributeValueBase::operator!= | ( | const AttributeValueBase & | other | ) | const |
|
pure virtual |
Add other
to *this
.
Implemented in casa::AttributeValue< T >, casa::AttributeValuePoi< T >, and casa::AttributeValuePoiTol< T >.
const AttributeValueBase& casa::AttributeValueBase::operator= | ( | const AttributeValueBase & | other | ) |
Copy assignment.
casacore::Bool casa::AttributeValueBase::operator== | ( | const AttributeValueBase & | other | ) | const |
Check for equality (and inequality) of two objects derived from AttributeValueBase.
It is implemented in terms of the pure virtual method matches
, which must be implemented in derived classes. The operator==
only returns true
if this->matches(other)
and other.matches(*this)
are both true
. This guarantees that if a == b
it follows that b == a
(this is enforced this way because a
and b
can be classes derived differently from AttributeValueBase which can therefore have a different implementation of match()
).
|
pure virtual |
Implemented in casa::AttributeValue< T >.
|
virtual |
Set/get the strictness state of this AttributeValue.
|
protectedvirtual |
Set the type of the value stored.
|
protected |
Whether the match is strict or not.
Definition at line 242 of file AttValBase.h.
|
protected |
The type of what is stored.
Definition at line 239 of file AttValBase.h.