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

casacore::Data type that holds an array. More...

#include <TBData.h>

Inheritance diagram for casa::TBArrayData:
casa::TBData casa::TBArrayDataBool casa::TBArrayDataChar casa::TBArrayDataComplex casa::TBArrayDataDComplex casa::TBArrayDataDouble casa::TBArrayDataFloat casa::TBArrayDataInt casa::TBArrayDataShort casa::TBArrayDataString casa::TBArrayDataUChar casa::TBArrayDataUInt

Public Member Functions

 TBArrayData ()
 Default Constructor. More...
 
 ~TBArrayData ()
 
std::vector< int > getShape ()
 Returns the array's shape. More...
 
bool isLoaded ()
 Returns true if the array has data loaded into it, false otherwise. More...
 
bool isOneDimensional ()
 Returns true if the array is one-dimensional, false otherwise. More...
 
bool coordIsValid (std::vector< int > d)
 Returns true if the given coordinate is a valid index for this array given its shape, false otherwise. More...
 
bool isEmpty ()
 Returns true if the array is empty (i.e., all dimensions have size 0), false otherwise. More...
 
TBDatafirstItem ()
 Returns the first item in the array, or NULL if there is no data loaded. More...
 
virtual TBDatadataAt (std::vector< int > d)=0
 dataAt() must be implemented by any subclass. More...
 
virtual casacore::String asString ()=0
 asString() must be implemented by any subclass. More...
 
virtual bool release ()=0
 release() must be implemented by any subclass. More...
 
virtual void setDataAt (std::vector< int > d, TBData &value)=0
 setDataAt() must be implemented by any subclass. More...
 
double asDouble ()
 Invalid operations. More...
 
float asFloat ()
 asFloat() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a float. More...
 
int asInt ()
 asInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an int. More...
 
unsigned int asUInt ()
 asUInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned int. More...
 
bool asBool ()
 asBool() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a boolean. More...
 
char asChar ()
 asChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a char. More...
 
unsigned char asUChar ()
 asUChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned character. More...
 
short int asShort ()
 asShort() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a short. More...
 
std::pair< float, float > asComplex ()
 asComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a complex. More...
 
std::pair< double, double > asDComplex ()
 asDComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a double complex. More...
 
casacore::RecordasRecord ()
 asRecord() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a record. More...
 
void setValue (TBData &value)
 setValue() must be implemented by any subclass. More...
 
bool equals (TBData *data)
 equals() must be implemented by any subclass. More...
 
virtual bool contains (TBData *data)=0
 contains() must be implemented by any subclass. More...
 
virtual bool containsBetween (TBData *data, TBData *data2)=0
 containsBetween() must be implemented by any subclass. More...
 
virtual bool containsLessThan (TBData *data)=0
 containsLessThan() must be implemented by any subclass. More...
 
virtual bool containsGreaterThan (TBData *data)=0
 containsGreaterThan() must be implemented by any subclass. More...
 
virtual casacore::String to1DString ()=0
 to1DString() must be implemented by any subclass. More...
 
- Public Member Functions inherited from casa::TBData
 TBData ()
 Default Constructor. More...
 
virtual ~TBData ()
 
casacore::String displayValue ()
 See TBData::asString(). More...
 
virtual casacore::String getType ()=0
 getType() must be implemented by any subclass. More...
 

Protected Attributes

std::vector< int > shape
 casacore::Array shape. More...
 
bool loaded
 Whether data is loaded. More...
 
bool oneDim
 Whether the array is one-dimensional. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from casa::TBData
static TBDatacreate (casacore::String value, casacore::String type)
 Creates and returns a TBData object representing the given value and type. More...
 
static TBDatacreate (TBArray *array, casacore::String type)
 Creates a TBArrayData object containing the data in the given TBArray object with the given type. More...
 
static TBDatacreate (TBData &data)
 Creates and returns a copy of the given TBData. More...
 

Detailed Description

casacore::Data type that holds an array.

Synopsis

TBArrayData is the abstract class for array data types that the browser knows about. Subclasses of TBArrayData do not have to implement much of the abstract methods in TBData, but they do have to implement some array-specific methods. Because of the way the browser is set up, an array may or may not have actual data loaded into it; generally speaking, one-dimensional arrays are loaded (copied) immediately upon construction whereas other arrays must be manually loaded. This is to save space.

Definition at line 983 of file TBData.h.

Constructor & Destructor Documentation

casa::TBArrayData::TBArrayData ( )

Default Constructor.

casa::TBArrayData::~TBArrayData ( )

Member Function Documentation

bool casa::TBArrayData::asBool ( )
inlinevirtual

asBool() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a boolean.

Implements casa::TBData.

Definition at line 1041 of file TBData.h.

char casa::TBArrayData::asChar ( )
inlinevirtual

asChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a char.

Implements casa::TBData.

Definition at line 1042 of file TBData.h.

std::pair<float, float> casa::TBArrayData::asComplex ( )
inlinevirtual

asComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a complex.

Implements casa::TBData.

Definition at line 1045 of file TBData.h.

std::pair<double, double> casa::TBArrayData::asDComplex ( )
inlinevirtual

asDComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a double complex.

Implements casa::TBData.

Definition at line 1046 of file TBData.h.

double casa::TBArrayData::asDouble ( )
inlinevirtual

Invalid operations.

Implements casa::TBData.

Definition at line 1037 of file TBData.h.

float casa::TBArrayData::asFloat ( )
inlinevirtual

asFloat() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a float.

Implements casa::TBData.

Definition at line 1038 of file TBData.h.

int casa::TBArrayData::asInt ( )
inlinevirtual

asInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an int.

Implements casa::TBData.

Definition at line 1039 of file TBData.h.

casacore::Record* casa::TBArrayData::asRecord ( )
inlinevirtual

asRecord() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a record.

Implements casa::TBData.

Definition at line 1047 of file TBData.h.

short int casa::TBArrayData::asShort ( )
inlinevirtual

asShort() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a short.

Implements casa::TBData.

Definition at line 1044 of file TBData.h.

virtual casacore::String casa::TBArrayData::asString ( )
pure virtual

asString() must be implemented by any subclass.

Generally speaking, should return the array data for one-dimensional arrays or the shape and type otherwise.

Implements casa::TBData.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

unsigned char casa::TBArrayData::asUChar ( )
inlinevirtual

asUChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned character.

Implements casa::TBData.

Definition at line 1043 of file TBData.h.

unsigned int casa::TBArrayData::asUInt ( )
inlinevirtual

asUInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned int.

Implements casa::TBData.

Definition at line 1040 of file TBData.h.

virtual bool casa::TBArrayData::contains ( TBData data)
pure virtual

contains() must be implemented by any subclass.

Returns true if this array has data loaded and contains the given value, false otherwise.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

virtual bool casa::TBArrayData::containsBetween ( TBData data,
TBData data2 
)
pure virtual

containsBetween() must be implemented by any subclass.

Returns true if this array has data loaded and contains a value between the two given values, false otherwise. NOTE: the behavior is undefined for arrays with non-numerical values.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

virtual bool casa::TBArrayData::containsGreaterThan ( TBData data)
pure virtual

containsGreaterThan() must be implemented by any subclass.

Returns true if this array has data loaded and contains a value greater than the given value, false otherwise. NOTE: the behavior is undefined for arrays with non-numerical values.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

virtual bool casa::TBArrayData::containsLessThan ( TBData data)
pure virtual

containsLessThan() must be implemented by any subclass.

Returns true if this array has data loaded and contains a value less than the given value, false otherwise. NOTE: the behavior is undefined for arrays with non-numerical values.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

bool casa::TBArrayData::coordIsValid ( std::vector< int >  d)

Returns true if the given coordinate is a valid index for this array given its shape, false otherwise.

virtual TBData* casa::TBArrayData::dataAt ( std::vector< int >  d)
pure virtual

dataAt() must be implemented by any subclass.

Returns a TBData copy of the data at the given coordinates, or NULL if the coordinates are invalid or there is no loaded data. NOTE: generally speaking, since subclasses do not internally store their data as arrays of TBData*, the returned TBData object must be deleted by the caller.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

bool casa::TBArrayData::equals ( TBData data)
inlinevirtual

equals() must be implemented by any subclass.

Returns true if the given TBData is equal to this TBData object, false otherwise. Note: the behavior of this method is undefined if the given TBData is not of the same type as "this" TBData.

Implements casa::TBData.

Definition at line 1050 of file TBData.h.

TBData* casa::TBArrayData::firstItem ( )

Returns the first item in the array, or NULL if there is no data loaded.

std::vector<int> casa::TBArrayData::getShape ( )

Returns the array's shape.

bool casa::TBArrayData::isEmpty ( )

Returns true if the array is empty (i.e., all dimensions have size 0), false otherwise.

bool casa::TBArrayData::isLoaded ( )

Returns true if the array has data loaded into it, false otherwise.

bool casa::TBArrayData::isOneDimensional ( )

Returns true if the array is one-dimensional, false otherwise.

virtual bool casa::TBArrayData::release ( )
pure virtual
virtual void casa::TBArrayData::setDataAt ( std::vector< int >  d,
TBData value 
)
pure virtual

setDataAt() must be implemented by any subclass.

Sets the data at the given coordinates to the given value. NOTE: this method's behavior is undefined if the type of the TBData does not match the type of the array.

Implemented in casa::TBArrayDataDComplex, casa::TBArrayDataComplex, casa::TBArrayDataShort, casa::TBArrayDataUChar, casa::TBArrayDataChar, casa::TBArrayDataBool, casa::TBArrayDataUInt, casa::TBArrayDataInt, casa::TBArrayDataFloat, casa::TBArrayDataDouble, and casa::TBArrayDataString.

void casa::TBArrayData::setValue ( TBData value)
inlinevirtual

setValue() must be implemented by any subclass.

Sets this data's value to the value of the given TBData. Note: the behavior of this method is undefined if the given TBData is not the same type as "this" TBData.

Implements casa::TBData.

Definition at line 1048 of file TBData.h.

virtual casacore::String casa::TBArrayData::to1DString ( )
pure virtual

Member Data Documentation

bool casa::TBArrayData::loaded
protected

Whether data is loaded.

Definition at line 1085 of file TBData.h.

bool casa::TBArrayData::oneDim
protected

Whether the array is one-dimensional.

Definition at line 1088 of file TBData.h.

std::vector<int> casa::TBArrayData::shape
protected

casacore::Array shape.

Definition at line 1082 of file TBData.h.


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