Planeshift
FunctionParserBase< Value_t > Class Template Reference

#include <fparser.h>

Classes

class  FunctionWrapper
 

Public Types

typedef Value_t(* FunctionPtr) (const Value_t *)
 
enum  ParseErrorType {
  SYNTAX_ERROR =0, MISM_PARENTH, MISSING_PARENTH, EMPTY_PARENTH,
  EXPECT_OPERATOR, OUT_OF_MEMORY, UNEXPECTED_ERROR, INVALID_VARS,
  ILL_PARAMS_AMOUNT, PREMATURE_EOS, EXPECT_PARENTH_FUNC, UNKNOWN_IDENTIFIER,
  NO_FUNCTION_PARSED_YET, FP_NO_ERROR
}
 
typedef Value_t value_type
 

Public Member Functions

bool AddConstant (const std::string &name, Value_t value)
 
bool AddFunction (const std::string &name, FunctionPtr, unsigned paramsAmount)
 
bool AddFunction (const std::string &name, FunctionParserBase &)
 
template<typename DerivedWrapper >
bool AddFunctionWrapper (const std::string &name, const DerivedWrapper &, unsigned paramsAmount)
 
bool AddUnit (const std::string &name, Value_t value)
 
const char * ErrorMsg () const
 
Value_t Eval (const Value_t *Vars)
 
int EvalError () const
 
void ForceDeepCopy ()
 
 FunctionParserBase ()
 
 FunctionParserBase (const FunctionParserBase &)
 
FunctionWrapperGetFunctionWrapper (const std::string &name)
 
ParseErrorType GetParseErrorType () const
 
FunctionParserBaseoperator= (const FunctionParserBase &)
 
void Optimize ()
 
int Parse (const char *Function, const std::string &Vars, bool useDegrees=false)
 
int Parse (const std::string &Function, const std::string &Vars, bool useDegrees=false)
 
int ParseAndDeduceVariables (const std::string &function, int *amountOfVariablesFound=0, bool useDegrees=false)
 
int ParseAndDeduceVariables (const std::string &function, std::string &resultVarString, int *amountOfVariablesFound=0, bool useDegrees=false)
 
int ParseAndDeduceVariables (const std::string &function, std::vector< std::string > &resultVars, bool useDegrees=false)
 
bool RemoveIdentifier (const std::string &name)
 
void setDelimiterChar (char)
 
 ~FunctionParserBase ()
 

Static Public Member Functions

static Value_t epsilon ()
 
static void setEpsilon (Value_t)
 

Protected Member Functions

Data * getParserData ()
 

Static Protected Member Functions

static unsigned ParseIdentifier (const char *)
 
static std::pair< const char *, Value_t > ParseLiteral (const char *)
 

Detailed Description

template<typename Value_t>
class FunctionParserBase< Value_t >

Definition at line 30 of file fparser.h.

Member Typedef Documentation

template<typename Value_t>
typedef Value_t(* FunctionParserBase< Value_t >::FunctionPtr) (const Value_t *)

Definition at line 65 of file fparser.h.

template<typename Value_t>
typedef Value_t FunctionParserBase< Value_t >::value_type

Definition at line 43 of file fparser.h.

Member Enumeration Documentation

template<typename Value_t>
enum FunctionParserBase::ParseErrorType
Enumerator
SYNTAX_ERROR 
MISM_PARENTH 
MISSING_PARENTH 
EMPTY_PARENTH 
EXPECT_OPERATOR 
OUT_OF_MEMORY 
UNEXPECTED_ERROR 
INVALID_VARS 
ILL_PARAMS_AMOUNT 
PREMATURE_EOS 
EXPECT_PARENTH_FUNC 
UNKNOWN_IDENTIFIER 
NO_FUNCTION_PARSED_YET 
FP_NO_ERROR 

Definition at line 33 of file fparser.h.

Constructor & Destructor Documentation

template<typename Value_t>
FunctionParserBase< Value_t >::FunctionParserBase ( )
template<typename Value_t>
FunctionParserBase< Value_t >::~FunctionParserBase ( )
template<typename Value_t>
FunctionParserBase< Value_t >::FunctionParserBase ( const FunctionParserBase< Value_t > &  )

Member Function Documentation

template<typename Value_t>
bool FunctionParserBase< Value_t >::AddConstant ( const std::string &  name,
Value_t  value 
)
template<typename Value_t>
bool FunctionParserBase< Value_t >::AddFunction ( const std::string &  name,
FunctionPtr  ,
unsigned  paramsAmount 
)
template<typename Value_t>
bool FunctionParserBase< Value_t >::AddFunction ( const std::string &  name,
FunctionParserBase< Value_t > &   
)
template<typename Value_t >
template<typename DerivedWrapper >
bool FunctionParserBase< Value_t >::AddFunctionWrapper ( const std::string &  name,
const DerivedWrapper &  wrapper,
unsigned  paramsAmount 
)

Definition at line 218 of file fparser.h.

template<typename Value_t>
bool FunctionParserBase< Value_t >::AddUnit ( const std::string &  name,
Value_t  value 
)
template<typename Value_t>
static Value_t FunctionParserBase< Value_t >::epsilon ( )
static
template<typename Value_t>
const char* FunctionParserBase< Value_t >::ErrorMsg ( ) const
template<typename Value_t>
Value_t FunctionParserBase< Value_t >::Eval ( const Value_t *  Vars)
template<typename Value_t>
int FunctionParserBase< Value_t >::EvalError ( ) const
template<typename Value_t>
void FunctionParserBase< Value_t >::ForceDeepCopy ( )
template<typename Value_t>
FunctionWrapper* FunctionParserBase< Value_t >::GetFunctionWrapper ( const std::string &  name)
template<typename Value_t>
ParseErrorType FunctionParserBase< Value_t >::GetParseErrorType ( ) const
template<typename Value_t>
Data* FunctionParserBase< Value_t >::getParserData ( )
protected
template<typename Value_t>
FunctionParserBase& FunctionParserBase< Value_t >::operator= ( const FunctionParserBase< Value_t > &  )
template<typename Value_t>
void FunctionParserBase< Value_t >::Optimize ( )
template<typename Value_t>
int FunctionParserBase< Value_t >::Parse ( const char *  Function,
const std::string &  Vars,
bool  useDegrees = false 
)
template<typename Value_t>
int FunctionParserBase< Value_t >::Parse ( const std::string &  Function,
const std::string &  Vars,
bool  useDegrees = false 
)
template<typename Value_t>
int FunctionParserBase< Value_t >::ParseAndDeduceVariables ( const std::string &  function,
int amountOfVariablesFound = 0,
bool  useDegrees = false 
)
template<typename Value_t>
int FunctionParserBase< Value_t >::ParseAndDeduceVariables ( const std::string &  function,
std::string &  resultVarString,
int amountOfVariablesFound = 0,
bool  useDegrees = false 
)
template<typename Value_t>
int FunctionParserBase< Value_t >::ParseAndDeduceVariables ( const std::string &  function,
std::vector< std::string > &  resultVars,
bool  useDegrees = false 
)
template<typename Value_t>
static unsigned FunctionParserBase< Value_t >::ParseIdentifier ( const char *  )
staticprotected
template<typename Value_t>
static std::pair<const char*, Value_t> FunctionParserBase< Value_t >::ParseLiteral ( const char *  )
staticprotected
template<typename Value_t>
bool FunctionParserBase< Value_t >::RemoveIdentifier ( const std::string &  name)
template<typename Value_t>
void FunctionParserBase< Value_t >::setDelimiterChar ( char  )
template<typename Value_t>
static void FunctionParserBase< Value_t >::setEpsilon ( Value_t  )
static

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