Inheritance diagram for code::DataType:
This is what you will get back from the Formatters, for example. The important function here is the invoke, which makes possible all the useful things you can do on the data. These useful operations are called Algorithms. Typical usage is like this:
MyAlgorithm myAlg; SmartPtr< DataType > dt = someBuilder.createObject( someParams ); dt->invoke( myAlg );
Every DataType is geographically and spatially referenced. You can get the reference using the getSpaceTimeRef() function. This function will return to you a reasonable reference in the case of multiple-item data.
Every DataType may optionally have attributes associated with it. Such attributes, often refered to as meta data, describe various things about the object. In a sense, then, the SpaceTimeRef is just another attribute of the object. You can not count on any particular attribute being present in the DataType, but should be willing to use any attributes present. The attributes can be obtained by a string key, commonly defined in the TypeName class.
Public Types | |
typedef std::map< std::string, SmartPtr< DataColumn > > | AttrMap |
key-value pairs that describe the data. | |
RadialSet | |
LatLonGrid | |
LatLonHeightGrid | |
CartesianGrid2D | |
Grid2D | |
DataTable | |
WindField | |
WindFieldLLGVolume | |
ElevationVolume | |
ContourData | |
Other | |
enum | Type { RadialSet, LatLonGrid, LatLonHeightGrid, CartesianGrid2D, Grid2D, DataTable, WindField, WindFieldLLGVolume, ElevationVolume, ContourData, Other } |
Public Member Functions | |
std::string | getTypeClassName () const |
returns a string such as RadialSet, LatLonGrid, etc. | |
void | copyDataType (const DataType &dt) |
A convenience function provided for subclasses that implement clone() -- will copy into this data type all the attributes in the type dt. | |
const std::string & | getTypeName () const |
Return the TypeName of this DataType. | |
virtual short | getType () const |
Get enum type of this class. | |
void | setTypeName (const std::string &) |
Set the TypeName of this DataType. | |
SmartPtr< DataCell > | getAttributeValue (const std::string &key) const |
Return a single value associated with an attribute key corresponding to the function's argument. | |
bool | getAttributeValue (const std::string &key, std::string &setme) const |
Assign `setme' with the attribute corresponding to `key'. | |
bool | getAttributeValue (const std::string &key, double &setme) const |
Assign `setme' with the attribute corresponding to `key'. | |
void | setAttributeValue (const std::string &key, const std::string &value, const std::string &unit="dimensionless") |
Set a single-valued attribute that describes this DataType. | |
void | setAttributeValue (const std::string &key, double value, const std::string &unit="dimensionless", const std::string &format="%g") |
Set a single-valued attribute that describes this DataType. | |
void | setAttribute (const std::string &key, SmartPtr< DataColumn > value) |
Set a multiple-valued attribute that describes this DataType. | |
SmartPtr< DataColumn > | getAttribute (const std::string &key) const |
Get the attribute value for a particular key. | |
const AttrMap & | getAttributes () const |
Get the entire map of attributes available for this data type. | |
virtual void | invoke (Algorithm &) |
Report an error, and halt execution because this function MUST be overridden in every descendant of DataType. | |
virtual SpaceTimeRef | getSpaceTimeRef () const =0 |
Return a SpaceTimeRef that best corresponds to this DataType. | |
virtual double | getRawValue (const Location &, bool=false) const |
Gets raw value from data set. | |
virtual TimeInterval | getExpiryInterval () const |
Return 15 minutes as the length of time for which this DataType is valid. | |
DataType () | |
Initialize TypeName string to invalid value of "not set". | |
virtual | ~DataType () |
Call descendant's destructor. | |
bool | hasQuality () const |
const DataType & | getQuality () const |
void | setQuality (SmartPtr< DataType > dt) |
void | clearAttributes () |
Static Public Attributes | |
static const std::string | IsTableData |
static const std::string | Unit |
static const std::string | ColorMap |
static const std::string | ExpiryInterval |
Protected Member Functions | |
virtual void | deep_copy (const DataType &source) |
typedef std::map< std::string, SmartPtr<DataColumn> > code::DataType::AttrMap |
key-value pairs that describe the data.
enum code::DataType::Type |
code::DataType::DataType | ( | ) |
virtual code::DataType::~DataType | ( | ) | [inline, virtual] |
Call descendant's destructor.
void code::DataType::clearAttributes | ( | ) | [inline] |
void code::DataType::copyDataType | ( | const DataType & | dt | ) |
A convenience function provided for subclasses that implement clone() -- will copy into this data type all the attributes in the type dt.
Attributes with the same name will be over-written, other attributes will remain unchanged.
virtual void code::DataType::deep_copy | ( | const DataType & | source | ) | [inline, protected, virtual] |
SmartPtr< DataColumn > code::DataType::getAttribute | ( | const std::string & | key | ) | const |
Get the attribute value for a particular key.
key | attribute key |
getAttributes() if you don't know the attribute key.
const AttrMap& code::DataType::getAttributes | ( | ) | const [inline] |
Get the entire map of attributes available for this data type.
getAttributeValue for a convenient get.
bool code::DataType::getAttributeValue | ( | const std::string & | key, | |
double & | setme | |||
) | const |
Assign `setme' with the attribute corresponding to `key'.
bool code::DataType::getAttributeValue | ( | const std::string & | key, | |
std::string & | setme | |||
) | const |
Assign `setme' with the attribute corresponding to `key'.
Return a single value associated with an attribute key corresponding to the function's argument.
If no such attribute key exists, then return the NULL SmartPtr. In case multiple values are associated with the key, only the first item is returned.
virtual TimeInterval code::DataType::getExpiryInterval | ( | ) | const [virtual] |
const DataType& code::DataType::getQuality | ( | ) | const [inline] |
virtual double code::DataType::getRawValue | ( | const Location & | , | |
bool | = false | |||
) | const [inline, virtual] |
Gets raw value from data set.
Reimplemented in code::CartesianGrid2D, code::CartesianGrid3D, code::ElevationVolume, code::LatLonGrid, code::LatLonHeightGrid, code::RadialSet, code::SparseGrid, and code::WindFieldLLGVolume.
virtual SpaceTimeRef code::DataType::getSpaceTimeRef | ( | ) | const [pure virtual] |
Return a SpaceTimeRef that best corresponds to this DataType.
The Time component corresponds to the beginning of the TimeInterval during which this DataType is valid.
Implemented in code::BasicIcon, code::CartesianGrid2D, code::CartesianGrid3D, code::SingleContourData, code::ContourData, code::DataTable, code::Datum< X >, code::Data1D< T4, X >, code::Collection< X >, code::Data2D< T3, T4, X >, code::Data3D< T2, T3, T4, X >, code::Data4D< T1, T2, T3, T4, X >, code::ElevationVolume, code::FieldArrowStruct, code::Grid2D, code::IconData, code::LatLonGrid, code::PolarGrid, code::RadialSet, code::SparseGrid, code::WindFieldStruct< T >, code::Data1D< code::Length, float >, code::Data1D< code::Angle, code::RadialSet >, code::Collection< code::Radial >, code::Collection< code::SingleContourData >, code::Data2D< code::Angle, code::Angle, float >, code::Data2D< code::Length, code::Length, float >, code::Data2D< code::DLLH, code::DLLH, float >, code::Data3D< code::Length, code::Angle, code::Angle, float >, and code::Data3D< code::Length, code::Length, code::Length, float >.
virtual short code::DataType::getType | ( | ) | const [inline, virtual] |
Get enum type of this class.
Reimplemented in code::CartesianGrid2D, code::ContourData, code::DataTable, code::ElevationVolume, code::Grid2D, code::LatLonGrid, code::LatLonHeightGrid, code::PolarGrid, code::RadialSet, code::WindFieldLLGVolume, and code::WindFieldStruct< T >.
std::string code::DataType::getTypeClassName | ( | ) | const |
returns a string such as RadialSet, LatLonGrid, etc.
See the enum Type for all the possible options. Subclasses need only to over-ride getType()
bool code::DataType::hasQuality | ( | ) | const [inline] |
virtual void code::DataType::invoke | ( | Algorithm & | ) | [virtual] |
Report an error, and halt execution because this function MUST be overridden in every descendant of DataType.
The descendant's implementation should pass this or *this, as is appropriate, into the argument's process() member.
Reimplemented in code::BasicIcon, code::AlgTrackStruct, code::LtgoIconStruct, code::MesoIconStruct, code::BwerIconStruct, code::CartesianGrid2D, code::CartesianGrid3D, code::SingleContourData, code::ContourData, code::DataTable, code::DEM, code::Datum< X >, code::Collection< X >, code::ElevationVolume, code::FieldArrowStruct, code::Grid2D, code::IconData, code::LatLonGrid, code::LatLonHeightGrid, code::PolarGrid, code::Radial, code::RadialSet, code::WindFieldStruct< T >, code::Collection< code::Radial >, and code::Collection< code::SingleContourData >.
void code::DataType::setAttribute | ( | const std::string & | key, | |
SmartPtr< DataColumn > | value | |||
) |
Set a multiple-valued attribute that describes this DataType.
If value is 0 (i.e. invalid), this attribute will be removed from the map.
void code::DataType::setAttributeValue | ( | const std::string & | key, | |
double | value, | |||
const std::string & | unit = "dimensionless" , |
|||
const std::string & | format = "%g" | |||
) |
Set a single-valued attribute that describes this DataType.
This is a convenience function that allows you to set a dimensionless number as the value of an attribute.
If the attribute key does not already exist, then it will be constructed.
void code::DataType::setAttributeValue | ( | const std::string & | key, | |
const std::string & | value, | |||
const std::string & | unit = "dimensionless" | |||
) |
Set a single-valued attribute that describes this DataType.
This is a convenience function that allows you to set a text string as the value of an attribute.
If the attribute key does not already exist, then it will be constructed. The empty string may NOT be used as a value for the attribute; this function will return immediately if the value is the empty string.
const std::string code::DataType::ColorMap [static] |
const std::string code::DataType::ExpiryInterval [static] |
const std::string code::DataType::IsTableData [static] |
const std::string code::DataType::Unit [static] |