code::Data4D< T1, T2, T3, T4, X > Class Template Reference

Inheritance diagram for code::Data4D< T1, T2, T3, T4, X >:

code::DataType List of all members.

Detailed Description

template<class T1, class T2, class T3, class T4, class X>
class code::Data4D< T1, T2, T3, T4, X >

A four-dimensional container, part of DataType.

Author:
: Lakshman
Version:
:
Id
code_DimensionedData.h,v 1.44 2009/06/02 20:17:37 lakshman Exp


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

 Data4D ()
 Constructs an empty array of values.
 Data4D (size_t size1, size_t size2, size_t size3, size_t size4)
 Constructs the object of requested size and fills its with the default constructor X() values.
 Data4D (SmartPtr< std::vector< Data3D< T2, T3, T4, X > > > new_val)
 Constructor with already existing values.
Data4D clone () const
 Creates a completely separate copy of the data.
const Data3D< T2, T3, T4,
X > & 
operator[] (size_t i) const
 Returns the ith member of the array.
Data3D< T2, T3, T4, X > & operator[] (size_t i)
 Returns the ith member of the array.
const std::vector< Data3D<
T2, T3, T4, X > > & 
data () const
 Returns the internal vector of Data1D.
std::vector< Data3D< T2, T3,
T4, X > > & 
data ()
 Returns the internal vector of Data1D.
value (size_t i, size_t j, size_t k, size_t m) const
 Another way to use the class, instead of using [].
value (Coord ijkm) const
 Another way to use the class, instead of using [].
Datum< X > data (size_t i, size_t j, size_t k, size_t m) const
 Obtain the datum corresponding to the ith element.
Datum< X > data (Coord ijkm) const
 Obtain the datum corresponding to the ith element.
DimType coord_value (Coord ij) const
 Returns the relative position of the element wrt to the first.
SpaceTimeRef reference (Coord ijk) const
 Obtain the reference of i,j,kth element.
virtual SpaceTimeRef getSpaceTimeRef () const
 Returns the reference of the first element.
virtual SpaceTimeRef reference (size_t i, size_t j, size_t k, size_t m) const
 Obtain the reference of i,j,k,m th element.
virtual DimType coord_value (size_t i, size_t j, size_t k, size_t m) const
 Returns the relative position of the element wrt to the first.
virtual ~Data4D ()
 This class is meant to be subclassed.
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< DataCellgetAttributeValue (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< DataColumngetAttribute (const std::string &key) const
 Get the attribute value for a particular key.
const AttrMapgetAttributes () 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 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.
bool hasQuality () const
const DataTypegetQuality () const
void setQuality (SmartPtr< DataType > dt)
void clearAttributes ()

Public Attributes

InitSmartPtr< std::vector<
Data3D< T2, T3, T4, X > > > 
vals
 The array of 3D types that is held.

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)

Classes

class  Coord
 A coordinate for Data4D. More...
class  DimType
 A Dimension type for Data4D, e.g. More...


Member Typedef Documentation

typedef std::map< std::string, SmartPtr<DataColumn> > code::DataType::AttrMap [inherited]

key-value pairs that describe the data.


Member Enumeration Documentation

enum code::DataType::Type [inherited]

Enumerator:
RadialSet 
LatLonGrid 
LatLonHeightGrid 
CartesianGrid2D 
Grid2D 
DataTable 
WindField 
WindFieldLLGVolume 
ElevationVolume 
ContourData 
Other 


Constructor & Destructor Documentation

template<class T1, class T2, class T3, class T4, class X>
code::Data4D< T1, T2, T3, T4, X >::Data4D (  )  [inline]

Constructs an empty array of values.

Use push_back() to fill this in.

template<class T1, class T2, class T3, class T4, class X>
code::Data4D< T1, T2, T3, T4, X >::Data4D ( size_t  size1,
size_t  size2,
size_t  size3,
size_t  size4 
) [inline]

Constructs the object of requested size and fills its with the default constructor X() values.

template<class T1, class T2, class T3, class T4, class X>
code::Data4D< T1, T2, T3, T4, X >::Data4D ( SmartPtr< std::vector< Data3D< T2, T3, T4, X > > >  new_val  )  [inline]

Constructor with already existing values.

template<class T1, class T2, class T3, class T4, class X>
virtual code::Data4D< T1, T2, T3, T4, X >::~Data4D (  )  [inline, virtual]

This class is meant to be subclassed.


Member Function Documentation

void code::DataType::clearAttributes (  )  [inline, inherited]

template<class T1, class T2, class T3, class T4, class X>
Data4D code::Data4D< T1, T2, T3, T4, X >::clone (  )  const [inline]

Creates a completely separate copy of the data.

template<class T1, class T2, class T3, class T4, class X>
virtual DimType code::Data4D< T1, T2, T3, T4, X >::coord_value ( size_t  i,
size_t  j,
size_t  k,
size_t  m 
) const [inline, virtual]

Returns the relative position of the element wrt to the first.

template<class T1, class T2, class T3, class T4, class X>
DimType code::Data4D< T1, T2, T3, T4, X >::coord_value ( Coord  ij  )  const [inline]

Returns the relative position of the element wrt to the first.

void code::DataType::copyDataType ( const DataType dt  )  [inherited]

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.

template<class T1, class T2, class T3, class T4, class X>
Datum<X> code::Data4D< T1, T2, T3, T4, X >::data ( Coord  ijkm  )  const [inline]

Obtain the datum corresponding to the ith element.

template<class T1, class T2, class T3, class T4, class X>
Datum<X> code::Data4D< T1, T2, T3, T4, X >::data ( size_t  i,
size_t  j,
size_t  k,
size_t  m 
) const [inline]

Obtain the datum corresponding to the ith element.

template<class T1, class T2, class T3, class T4, class X>
std::vector< Data3D<T2,T3,T4,X> >& code::Data4D< T1, T2, T3, T4, X >::data (  )  [inline]

Returns the internal vector of Data1D.

template<class T1, class T2, class T3, class T4, class X>
const std::vector< Data3D<T2,T3,T4,X> >& code::Data4D< T1, T2, T3, T4, X >::data (  )  const [inline]

Returns the internal vector of Data1D.

virtual void code::DataType::deep_copy ( const DataType source  )  [inline, protected, virtual, inherited]

SmartPtr< DataColumn > code::DataType::getAttribute ( const std::string &  key  )  const [inherited]

Get the attribute value for a particular key.

Parameters:
key attribute key
Returns:
value attribute value in unit-safe manner, or an invalid SmartPtr on error.
See also:
getAttributeValue()

getAttributes() if you don't know the attribute key.

const AttrMap& code::DataType::getAttributes (  )  const [inline, inherited]

Get the entire map of attributes available for this data type.

See also:
getAttribute for a more selective get.

getAttributeValue for a convenient get.

bool code::DataType::getAttributeValue ( const std::string &  key,
double &  setme 
) const [inherited]

Assign `setme' with the attribute corresponding to `key'.

Returns:
true on success; false if no such attribute exists

bool code::DataType::getAttributeValue ( const std::string &  key,
std::string &  setme 
) const [inherited]

Assign `setme' with the attribute corresponding to `key'.

Returns:
true on success; false if no such attribute exists

SmartPtr< DataCell > code::DataType::getAttributeValue ( const std::string &  key  )  const [inherited]

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.

See also:
getAttribute() to get all values.

virtual TimeInterval code::DataType::getExpiryInterval (  )  const [virtual, inherited]

Return 15 minutes as the length of time for which this DataType is valid.

Override this function in the descendant of DataType as appropriate.

Reimplemented in code::DEM.

const DataType& code::DataType::getQuality (  )  const [inline, inherited]

virtual double code::DataType::getRawValue ( const Location ,
bool  = false 
) const [inline, virtual, inherited]

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.

template<class T1, class T2, class T3, class T4, class X>
virtual SpaceTimeRef code::Data4D< T1, T2, T3, T4, X >::getSpaceTimeRef (  )  const [inline, virtual]

Returns the reference of the first element.

Implements code::DataType.

virtual short code::DataType::getType (  )  const [inline, virtual, inherited]

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 [inherited]

returns a string such as RadialSet, LatLonGrid, etc.

See the enum Type for all the possible options. Subclasses need only to over-ride getType()

const std::string& code::DataType::getTypeName (  )  const [inherited]

Return the TypeName of this DataType.

bool code::DataType::hasQuality (  )  const [inline, inherited]

virtual void code::DataType::invoke ( Algorithm  )  [virtual, inherited]

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 >.

template<class T1, class T2, class T3, class T4, class X>
Data3D<T2,T3,T4,X>& code::Data4D< T1, T2, T3, T4, X >::operator[] ( size_t  i  )  [inline]

Returns the ith member of the array.

No bounds check is done.

template<class T1, class T2, class T3, class T4, class X>
const Data3D<T2,T3,T4,X>& code::Data4D< T1, T2, T3, T4, X >::operator[] ( size_t  i  )  const [inline]

Returns the ith member of the array.

No bounds check is done.

template<class T1, class T2, class T3, class T4, class X>
virtual SpaceTimeRef code::Data4D< T1, T2, T3, T4, X >::reference ( size_t  i,
size_t  j,
size_t  k,
size_t  m 
) const [inline, virtual]

Obtain the reference of i,j,k,m th element.

This function needs to be implemented by subclasses. It should be a pure virtual, but we need to instantiate Data1D's ...

template<class T1, class T2, class T3, class T4, class X>
SpaceTimeRef code::Data4D< T1, T2, T3, T4, X >::reference ( Coord  ijk  )  const [inline]

Obtain the reference of i,j,kth element.

void code::DataType::setAttribute ( const std::string &  key,
SmartPtr< DataColumn value 
) [inherited]

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" 
) [inherited]

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.

See also:
setAttribute() to set multiple values for an attribute.

void code::DataType::setAttributeValue ( const std::string &  key,
const std::string &  value,
const std::string &  unit = "dimensionless" 
) [inherited]

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.

See also:
setAttribute() to set multiple values for an attribute.

void code::DataType::setQuality ( SmartPtr< DataType dt  )  [inline, inherited]

void code::DataType::setTypeName ( const std::string &   )  [inherited]

Set the TypeName of this DataType.

template<class T1, class T2, class T3, class T4, class X>
X code::Data4D< T1, T2, T3, T4, X >::value ( Coord  ijkm  )  const [inline]

Another way to use the class, instead of using [].

template<class T1, class T2, class T3, class T4, class X>
X code::Data4D< T1, T2, T3, T4, X >::value ( size_t  i,
size_t  j,
size_t  k,
size_t  m 
) const [inline]

Another way to use the class, instead of using [].


Member Data Documentation

const std::string code::DataType::ColorMap [static, inherited]

const std::string code::DataType::ExpiryInterval [static, inherited]

const std::string code::DataType::IsTableData [static, inherited]

const std::string code::DataType::Unit [static, inherited]

template<class T1, class T2, class T3, class T4, class X>
InitSmartPtr< std::vector< Data3D<T2,T3,T4,X> > > code::Data4D< T1, T2, T3, T4, X >::vals

The array of 3D types that is held.

Use [] to dereference ...


Generated on Fri May 4 13:40:11 2012 for WDSS-IIw2 by  doxygen 1.4.7