WXP::Variable Class Reference

This class specifies variable information. More...

#include "../include/Variable.h"

List of all members.

Public Types

enum  Type {
  REG, PROB_LT, PROB_GT, PROB_LTH,
  PROB_GTL, PROB_BET, ENS_MEMBER, ENS_MEAN,
  ENS_STDEV, ENS_PROB_LT, ENS_PROB_GT, ENS_PROB_BET
}

Public Member Functions

 Variable ()
 Variable (const char *ab)
 Variable (const char *ab, const char *unit)
int init ()
int set (const char *ab)
int set (const char *ab, const char *unit)
int setType (int t)
int getType ()
int setInd (int t)
int getInd ()
int setVal1 (float val)
float getVal1 ()
int setVal2 (float val)
float getVal2 ()
int setName (const char *str)
const char * getName ()
int setAbbr (const char *str)
const char * getAbbr ()
int setUnits (const char *str)
const char * getUnits ()
int toLabel (String &str)
int toIndCode ()
int toAbbrCode (String &str)
int toString (String &str)
int decode (const char *str)
int print ()

Static Public Attributes

static const int max_abbr = 40
static const int max_name = 40
static const int max_units = 20

Detailed Description

This class specifies variable information.

Author:
Dan Vietor

Constructor & Destructor Documentation

Variable::Variable (  ) 

Constructor. Initializes values

References init().

Variable::Variable ( const char *  ab  ) 

Constructor. Sets abbreviation

Parameters:
ab Abbreviation of variable
Variable::Variable ( const char *  ab,
const char *  unit 
)

Constructor. Sets abbreviation and units

Parameters:
ab Abbreviation of variable
unit String describing units of variable

Member Function Documentation

const char* WXP::Variable::getAbbr (  )  [inline]

Gets the variable abbreviation

int WXP::Variable::getInd (  )  [inline]

Gets the variable index

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

const char* WXP::Variable::getName (  )  [inline]

Gets the variable long name

int WXP::Variable::getType (  )  [inline]

Gets the variable type

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

const char* WXP::Variable::getUnits (  )  [inline]

Gets the variable units

int Variable::init (  ) 

Initializes the class values

References WXP::Const::MISS.

Referenced by WXP::VarSpec::init(), and Variable().

int Variable::print (  ) 

Prints class data to standard output

Referenced by WXP::VarSpec::printDetails(), and WXP::Grid::setVar().

int Variable::set ( const char *  ab,
const char *  unit 
)

Sets abbreviation and units

Parameters:
ab Abbreviation of variable
unit String describing units of variable

References WXP::StrLib::copy().

int Variable::set ( const char *  ab  ) 

Sets abbreviation

Parameters:
ab Abbreviation of variable

References WXP::StrLib::copy().

Referenced by WXP::Grid::setVar().

int Variable::setAbbr ( const char *  str  ) 

Sets the variable name abbreviation

Parameters:
str Variable abbreviation

References WXP::StrLib::copy().

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

int Variable::setInd ( int  rind  ) 

Sets the index of variable

Parameters:
rind The index of variable

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

int Variable::setName ( const char *  str  ) 

Sets the long name of variable

Parameters:
str String describing variable

References WXP::StrLib::copy().

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

int Variable::setType ( int  rtype  ) 

Sets the type of variable

Parameters:
rtype The type of variable

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

int Variable::setUnits ( const char *  str  ) 

Sets a string describing the units of the variable.

Parameters:
str Variable units

References WXP::StrLib::copy().

Referenced by WXP::GribFile::readPDB(), and WXP::GribFile::readPDS().

int Variable::toLabel ( String str  ) 

Converts class data to a string

Return values:
str Output String class

References WXP::String::append(), WXP::String::clear(), WXP::String::get(), toString(), and WXP::StrLib::valid().

Referenced by WXP::GribFile::makeInfo(), and WXP::VarSpec::toInfoLabel().

int Variable::toString ( String str  ) 

Converts class data to a string

Return values:
str Output String class

References WXP::String::append(), WXP::String::clear(), and WXP::String::get().

Referenced by WXP::VarSpec::print(), and toLabel().


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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1