casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casa::AttributeValueBase Class Referenceabstract

Base class for values of Attributes used in the display classes. More...

#include <AttValBase.h>

Inheritance diagram for casa::AttributeValueBase:
casa::AttributeValue< T > casa::AttributeValuePoi< T > casa::AttributeValueTol< T > casa::AttributeValuePoiTol< T >

Public Member Functions

 AttributeValueBase (AttValue::ValueType type, casacore::Bool strict)
 Constructor. More...
 
 AttributeValueBase (const AttributeValueBase &other)
 Copy constructor. More...
 
virtual ~AttributeValueBase ()
 Destructor. More...
 
const AttributeValueBaseoperator= (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 AttributeValueBaseclone () 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...
 

Detailed Description

Base class for values of Attributes used in the display classes.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tAttribute

Etymology

"AttributeValueBase" is a concatenation, representing a "Base" class for "Attribute Values."

Synopsis

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.

Motivation

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.

Constructor & Destructor Documentation

casa::AttributeValueBase::AttributeValueBase ( AttValue::ValueType  type,
casacore::Bool  strict 
)

Constructor.

casa::AttributeValueBase::AttributeValueBase ( const AttributeValueBase other)

Copy constructor.

virtual casa::AttributeValueBase::~AttributeValueBase ( )
virtual

Destructor.

Member Function Documentation

virtual casacore::String casa::AttributeValueBase::className ( ) const
inlinevirtual
virtual AttributeValueBase* casa::AttributeValueBase::clone ( ) const
pure virtual
virtual casacore::Bool casa::AttributeValueBase::getStrictness ( ) const
virtual
AttValue::ValueType casa::AttributeValueBase::getType ( ) const

Get the type of the value stored.

virtual casacore::Bool casa::AttributeValueBase::matches ( const AttributeValueBase other) const
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 >.

casacore::Bool casa::AttributeValueBase::myMatch ( const AttributeValueBase other) const
protected

Check that private data match.

casacore::Bool casa::AttributeValueBase::operator!= ( const AttributeValueBase other) const
virtual void casa::AttributeValueBase::operator+= ( const AttributeValueBase other)
pure virtual
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()).

virtual void casa::AttributeValueBase::print ( std::ostream &  os)
pure virtual

Implemented in casa::AttributeValue< T >.

virtual void casa::AttributeValueBase::setStrictness ( const casacore::Bool newStrict)
virtual

Set/get the strictness state of this AttributeValue.

virtual void casa::AttributeValueBase::setType ( const AttValue::ValueType newType)
protectedvirtual

Set the type of the value stored.

Member Data Documentation

casacore::Bool casa::AttributeValueBase::itsStrictness
protected

Whether the match is strict or not.

Definition at line 242 of file AttValBase.h.

AttValue::ValueType casa::AttributeValueBase::itsValueType
protected

The type of what is stored.

Definition at line 239 of file AttValBase.h.


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