Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
gnsstk::Expression Class Reference

Detailed Description

Definition at line 88 of file Expression.hpp.

#include <Expression.hpp>

Classes

class  BinOpNode
 
class  ConstNode
 
class  ExpNode
 
class  FuncOpNode
 
class  Token
 
class  VarNode
 

Public Member Functions

bool canEvaluate (void)
 
double evaluate (void)
 
 Expression (const Expression &rhs)
 
 Expression (const std::string &str)
 
 Expression (void)
 
Expressionoperator= (const Expression &rhs)
 Assignment operator. More...
 
void print (std::ostream &ostr) const
 
bool set (const char *name, double value)
 
bool set (const std::string name, double value)
 
bool setGPSConstants (void)
 
bool setRinexObs (const RinexObsData::RinexObsTypeMap &rotm)
 
bool setSvObsEpoch (const SvObsEpoch &soe)
 
 ~Expression (void)
 Destructor. More...
 

Private Member Functions

void buildExpressionTree (void)
 
int countResolvedTokens (void)
 
void defineOperators (void)
 
void dumpLists (void)
 
void setExpression (const std::string &newExpression)
 
void tokenize (const std::string &str)
 

Private Attributes

std::list< ExpNode * > eList
 
ExpNoderoot
 
std::list< TokentList
 

Static Private Attributes

static std::map< std::string, std::string > argumentPatternMap
 
static std::map< std::string, int > operatorMap
 
static bool operatorsDefined = false
 

Constructor & Destructor Documentation

◆ Expression() [1/3]

gnsstk::Expression::Expression ( void  )

Empty constructor

Definition at line 175 of file Expression.cpp.

◆ Expression() [2/3]

gnsstk::Expression::Expression ( const std::string &  str)

Constructor.

Parameters
strExpression to be evaluated.

Definition at line 161 of file Expression.cpp.

◆ Expression() [3/3]

gnsstk::Expression::Expression ( const Expression rhs)

Copy constructor.

Parameters
rhsExpression to be copied.
Note
variable values are not copied.

Definition at line 182 of file Expression.cpp.

◆ ~Expression()

gnsstk::Expression::~Expression ( void  )

Destructor.

Definition at line 259 of file Expression.cpp.

Member Function Documentation

◆ buildExpressionTree()

void gnsstk::Expression::buildExpressionTree ( void  )
private

Definition at line 411 of file Expression.cpp.

◆ canEvaluate()

bool gnsstk::Expression::canEvaluate ( void  )

Checks in advance if all variables have been set.

Returns
True if all variables are set.

Definition at line 560 of file Expression.cpp.

◆ countResolvedTokens()

int gnsstk::Expression::countResolvedTokens ( void  )
private

Definition at line 395 of file Expression.cpp.

◆ defineOperators()

void gnsstk::Expression::defineOperators ( void  )
private

Definition at line 217 of file Expression.cpp.

◆ dumpLists()

void gnsstk::Expression::dumpLists ( void  )
private

Definition at line 198 of file Expression.cpp.

◆ evaluate()

double gnsstk::Expression::evaluate ( void  )
inline

Returns the numerical value of the expression. Note that if the expression contains variables, those variables must be set.

Exceptions
ExpressionException

Definition at line 174 of file Expression.hpp.

◆ operator=()

Expression & gnsstk::Expression::operator= ( const Expression rhs)

Assignment operator.

Definition at line 190 of file Expression.cpp.

◆ print()

void gnsstk::Expression::print ( std::ostream &  ostr) const
inline

Writes the expression out to a stream.

Definition at line 180 of file Expression.hpp.

◆ set() [1/2]

bool gnsstk::Expression::set ( const char *  name,
double  value 
)
inline

Sets a variable in the expression to the input value. All instances of the variable are set to this value. This is required before an expression can be evaluated, if the expression contains variables. In the search, case is not important (e.g., "c" and "C" would be a match).

Parameters
nameName of the variable to set
valueValue to set the variable to.
Returns
True if the variable was found.

Definition at line 138 of file Expression.hpp.

◆ set() [2/2]

bool gnsstk::Expression::set ( const std::string  name,
double  value 
)

Sets a variable in the expression to the input value. All instances of the variable are set to this value. This is required before an expression can be evaluated, if the expression contains variables.

Parameters
nameName of the variable to set
valueValue to set the variable to.
Returns
True if the variable was found.

Definition at line 533 of file Expression.cpp.

◆ setExpression()

void gnsstk::Expression::setExpression ( const std::string &  newExpression)
private

Definition at line 168 of file Expression.cpp.

◆ setGPSConstants()

bool gnsstk::Expression::setGPSConstants ( void  )

Sets multiple variables in the expression to constants associated with GPS. Predefined variables include: PI; C (meters per second); L1 and L2, carrier frequencies in cycles per second; WL1 and WL2, carrier wavelengths. As with other variables, the case is insensitive.

Returns
True if any GPS related constants were found

Definition at line 581 of file Expression.cpp.

◆ setRinexObs()

bool gnsstk::Expression::setRinexObs ( const RinexObsData::RinexObsTypeMap rotm)

Sets multiple variables in the expression using values stored in a RinexObsType stucture. This structure is nested within the RinexObsData class.

Parameters
rotmMap of RinexObsType to RinexObsDatum
Returns
True if an obs variable was found.

Definition at line 599 of file Expression.cpp.

◆ setSvObsEpoch()

bool gnsstk::Expression::setSvObsEpoch ( const SvObsEpoch soe)

Definition at line 613 of file Expression.cpp.

◆ tokenize()

void gnsstk::Expression::tokenize ( const std::string &  str)
private

Definition at line 266 of file Expression.cpp.

Member Data Documentation

◆ argumentPatternMap

std::map< std::string, std::string > gnsstk::Expression::argumentPatternMap
staticprivate

Definition at line 344 of file Expression.hpp.

◆ eList

std::list<ExpNode *> gnsstk::Expression::eList
private

Definition at line 348 of file Expression.hpp.

◆ operatorMap

std::map< std::string, int > gnsstk::Expression::operatorMap
staticprivate

Definition at line 343 of file Expression.hpp.

◆ operatorsDefined

bool gnsstk::Expression::operatorsDefined = false
staticprivate

Definition at line 345 of file Expression.hpp.

◆ root

ExpNode* gnsstk::Expression::root
private

Definition at line 349 of file Expression.hpp.

◆ tList

std::list<Token> gnsstk::Expression::tList
private

Definition at line 347 of file Expression.hpp.


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


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44