WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
WXP::Variable Class Reference

This class specifies variable information. More...

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

Public Types

enum  Type {
  REG , ACCUM , MEAN , MAX ,
  MIN , 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 ,
  PERC
}
 

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() [1/3]

Variable::Variable ( )

Constructor. Initializes values

References init().

◆ Variable() [2/3]

Variable::Variable ( const char *  ab)

Constructor. Sets abbreviation

Parameters
abAbbreviation of variable

References set().

◆ Variable() [3/3]

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

Constructor. Sets abbreviation and units

Parameters
abAbbreviation of variable
unitString describing units of variable

References set().

Member Function Documentation

◆ decode()

int Variable::decode ( const char *  str)

Decodes abbreviation code to set parameters

Parameters
strAbbreviation code

References WXP::StrLib::equal(), init(), WXP::Wxp::outDebug(), and WXP::StrLib::valid().

◆ getAbbr()

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

Gets the variable abbreviation

Referenced by WXP::VarName::get().

◆ getInd()

int WXP::Variable::getInd ( )
inline

Gets the variable index

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

◆ getName()

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

Gets the variable long name

◆ getType()

int WXP::Variable::getType ( )
inline

Gets the variable type

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

◆ getUnits()

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

Gets the variable units

◆ getVal1()

float WXP::Variable::getVal1 ( )
inline

Gets the first value

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

◆ getVal2()

float WXP::Variable::getVal2 ( )
inline

Gets the second value

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

◆ init()

int Variable::init ( )

Initializes the class values

References WXP::Const::MISS.

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

◆ print()

int Variable::print ( )

Prints class data

References toIndCode().

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

◆ set() [1/2]

int Variable::set ( const char *  ab)

Sets abbreviation

Parameters
abAbbreviation of variable

References WXP::StrLib::copy().

Referenced by WXP::Grid::setVar(), and Variable().

◆ set() [2/2]

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

Sets abbreviation and units

Parameters
abAbbreviation of variable
unitString describing units of variable

References WXP::StrLib::copy().

◆ setAbbr()

int Variable::setAbbr ( const char *  str)

Sets the variable name abbreviation

Parameters
strVariable abbreviation

References WXP::StrLib::copy().

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

◆ setInd()

int Variable::setInd ( int  rind)

Sets the index of variable

Parameters
rindThe index of variable

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

◆ setName()

int Variable::setName ( const char *  str)

Sets the long name of variable

Parameters
strString describing variable

References WXP::StrLib::copy().

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

◆ setType()

int Variable::setType ( int  rtype)

Sets the type of variable

Parameters
rtypeThe type of variable

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

◆ setUnits()

int Variable::setUnits ( const char *  str)

Sets a string describing the units of the variable.

Parameters
strVariable units

References WXP::StrLib::copy().

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

◆ setVal1()

int WXP::Variable::setVal1 ( float  val)
inline

Sets the first value

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

◆ setVal2()

int WXP::Variable::setVal2 ( float  val)
inline

Sets the second value

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

◆ toAbbrCode()

int Variable::toAbbrCode ( String str)

Creates abbreviation code. Can be passed to decode to set object

Return values
strAbbreviation code

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

◆ toIndCode()

int Variable::toIndCode ( )

Creates index code

Returns
Index code

Referenced by print(), WXP::VarSpec::print(), and WXP::WmoIngest::process().

◆ toLabel()

int Variable::toLabel ( String str)

Converts class data to a string

Return values
strOutput String class

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

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

◆ toString()

int Variable::toString ( String str)

Converts class data to a string

Return values
strOutput String class

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

Referenced by WXP::VarSpec::print().


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