MBDyn-1.7.3
|
#include <mathtyp.h>
Classes | |
class | ErrConstraintViolation |
class | ErrUnknownType |
class | ErrUnknownValue |
class | ErrWrongType |
Public Types | |
enum | Type { VAR_UNKNOWN = -1, VAR_BOOL, VAR_INT, VAR_REAL, VAR_STRING, VAR_LAST } |
enum | TypeModifier { MOD_UNKNOWN = -1, MOD_CONST, MOD_LAST } |
Static Public Member Functions | |
static const char *const | GetTypeName (TypedValue::Type t) |
Protected Attributes | |
TypedValue::Type | type |
bool | bConst |
union { | |
Int i | |
Real r | |
} | v |
std::string | s |
enum TypedValue::Type |
Enumerator | |
---|---|
VAR_UNKNOWN | |
VAR_BOOL | |
VAR_INT | |
VAR_REAL | |
VAR_STRING | |
VAR_LAST |
Definition at line 45 of file mathtyp.h.
Enumerator | |
---|---|
MOD_UNKNOWN | |
MOD_CONST | |
MOD_LAST |
TypedValue::TypedValue | ( | void | ) |
Definition at line 874 of file mathp.cc.
References NO_OP.
Referenced by operator%(), operator*(), operator+(), operator-(), and operator/().
TypedValue::~TypedValue | ( | void | ) |
Definition at line 885 of file mathp.cc.
References v.
Definition at line 897 of file mathp.cc.
TypedValue::TypedValue | ( | const TypedValue::Type | t, |
bool | isConst = false |
||
) |
Definition at line 909 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, s, type, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
TypedValue::TypedValue | ( | const TypedValue & | var | ) |
Definition at line 932 of file mathp.cc.
References ASSERT, i, MBDYN_EXCEPT_ARGS, r, s, type, v, VAR_BOOL, VAR_INT, VAR_REAL, VAR_STRING, and VAR_UNKNOWN.
TypedValue & TypedValue::Cast | ( | const TypedValue & | var, |
bool | bErr = false |
||
) |
Definition at line 1032 of file mathp.cc.
References bConst, buf, Const(), GetBool(), GetInt(), GetReal(), GetString(), GetTypeName(), MBDYN_EXCEPT_ARGS, mbdyn_get_line_data(), r, s, Set(), type, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Var::Cast(), mp_cast(), and MathParser::stmt().
bool TypedValue::Const | ( | void | ) | const |
Definition at line 1182 of file mathp.cc.
References bConst.
Referenced by Cast(), Var::Const(), Var::MayChange(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), Set(), SetConst(), SetType(), and Var::Var().
bool TypedValue::GetBool | ( | void | ) | const |
Definition at line 1188 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, type, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Cast(), EE_Divide::Eval(), MathParser::evalfunc(), HighParser::GetBool(), and operator=().
Int TypedValue::GetInt | ( | void | ) | const |
Definition at line 1209 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, type, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Cast(), EE_Modulus::Eval(), EE_Divide::Eval(), EE_Power::Eval(), MathParser::evalfunc(), HighParser::GetInt(), operator%(), operator%=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator=(), and MathParser::power_int().
Real TypedValue::GetReal | ( | void | ) | const |
Definition at line 1228 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, type, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Cast(), EE_Divide::Eval(), EE_Power::Eval(), MathParser::evalfunc(), MathParser::Get(), MathParser::GetLastStmt(), HighParser::GetReal(), HighParser::GetTimeout(), operator!(), operator!=(), operator&&(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), operator||(), and MathParser::power_int().
const std::string & TypedValue::GetString | ( | void | ) | const |
Definition at line 1247 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, s, type, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Cast(), MathParser::evalfunc(), HighParser::GetString(), mp_cast(), operator!(), operator+(), operator+=(), operator<<(), operator=(), and MathParser::TokenPop().
TypedValue::Type TypedValue::GetType | ( | void | ) | const |
Definition at line 1155 of file mathp.cc.
References type.
Referenced by EE_Modulus::Eval(), EE_Divide::Eval(), EE_Power::Eval(), Var::GetType(), operator!(), operator%(), operator%=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), MathParser::power_int(), and Set().
const char *const TypedValue::GetTypeName | ( | void | ) | const |
Definition at line 1176 of file mathp.cc.
References type.
Referenced by Cast(), NamedValue::GetTypeName(), MathParser::StaticNameSpace::StaticNameSpace(), and MathParser::stmt().
|
static |
Definition at line 1161 of file mathp.cc.
References MBDYN_EXCEPT_ARGS, TypeName_t::name, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
bool TypedValue::operator!= | ( | const TypedValue & | v | ) | const |
TypedValue TypedValue::operator% | ( | const TypedValue & | v | ) | const |
Definition at line 1517 of file mathp.cc.
References GetInt(), GetType(), MBDYN_EXCEPT_ARGS, TypedValue(), VAR_BOOL, and VAR_INT.
const TypedValue & TypedValue::operator%= | ( | const TypedValue & | v | ) |
Definition at line 1634 of file mathp.cc.
References Const(), GetInt(), GetType(), MBDYN_EXCEPT_ARGS, Set(), type, VAR_BOOL, and VAR_INT.
bool TypedValue::operator&& | ( | const TypedValue & | v | ) | const |
TypedValue TypedValue::operator* | ( | const TypedValue & | v | ) | const |
Definition at line 1491 of file mathp.cc.
References GetInt(), GetReal(), GetType(), TypedValue(), VAR_BOOL, and VAR_INT.
const TypedValue & TypedValue::operator*= | ( | const TypedValue & | v | ) |
Definition at line 1598 of file mathp.cc.
References Const(), GetInt(), GetReal(), GetType(), MBDYN_EXCEPT_ARGS, Set(), type, VAR_BOOL, VAR_INT, and VAR_REAL.
TypedValue TypedValue::operator+ | ( | const TypedValue & | v | ) | const |
Definition at line 1444 of file mathp.cc.
References buf, GetInt(), GetReal(), GetString(), GetType(), MBDYN_EXCEPT_ARGS, TypedValue(), VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
const TypedValue & TypedValue::operator+= | ( | const TypedValue & | v | ) |
Definition at line 1534 of file mathp.cc.
References buf, Const(), GetInt(), GetReal(), GetString(), GetType(), MBDYN_EXCEPT_ARGS, s, Set(), type, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
TypedValue TypedValue::operator- | ( | const TypedValue & | v | ) | const |
Definition at line 1478 of file mathp.cc.
References GetInt(), GetReal(), GetType(), TypedValue(), VAR_BOOL, and VAR_INT.
const TypedValue & TypedValue::operator-= | ( | const TypedValue & | v | ) |
Definition at line 1580 of file mathp.cc.
References Const(), GetInt(), GetReal(), GetType(), MBDYN_EXCEPT_ARGS, Set(), type, VAR_BOOL, VAR_INT, and VAR_REAL.
TypedValue TypedValue::operator/ | ( | const TypedValue & | v | ) | const |
Definition at line 1504 of file mathp.cc.
References GetInt(), GetReal(), GetType(), TypedValue(), VAR_BOOL, and VAR_INT.
const TypedValue & TypedValue::operator/= | ( | const TypedValue & | v | ) |
Definition at line 1616 of file mathp.cc.
References Const(), GetInt(), GetReal(), GetType(), MBDYN_EXCEPT_ARGS, Set(), type, VAR_BOOL, VAR_INT, and VAR_REAL.
bool TypedValue::operator< | ( | const TypedValue & | v | ) | const |
bool TypedValue::operator<= | ( | const TypedValue & | v | ) | const |
TypedValue & TypedValue::operator= | ( | const TypedValue & | var | ) |
Definition at line 961 of file mathp.cc.
References bConst, buf, Const(), GetBool(), GetInt(), GetReal(), GetString(), MBDYN_EXCEPT_ARGS, s, Set(), type, VAR_BOOL, VAR_INT, VAR_REAL, VAR_STRING, and VAR_UNKNOWN.
bool TypedValue::operator== | ( | const TypedValue & | v | ) | const |
bool TypedValue::operator> | ( | const TypedValue & | v | ) | const |
bool TypedValue::operator>= | ( | const TypedValue & | v | ) | const |
bool TypedValue::operator|| | ( | const TypedValue & | v | ) | const |
const TypedValue & TypedValue::Set | ( | const bool & | b | ) |
Definition at line 1285 of file mathp.cc.
References Const(), GetType(), MBDYN_EXCEPT_ARGS, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Referenced by Cast(), MathParser::GetToken(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and Var::SetVal().
const TypedValue& TypedValue::Set | ( | const Int & | i | ) |
const TypedValue & TypedValue::Set | ( | const Real & | r | ) |
Definition at line 1342 of file mathp.cc.
References Const(), GetType(), MBDYN_EXCEPT_ARGS, r, v, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
const TypedValue & TypedValue::Set | ( | const std::string & | s | ) |
Definition at line 1372 of file mathp.cc.
References Const(), GetType(), MBDYN_EXCEPT_ARGS, s, VAR_BOOL, VAR_INT, VAR_REAL, and VAR_STRING.
Definition at line 1275 of file mathp.cc.
References bConst, Const(), and MBDYN_EXCEPT_ARGS.
Referenced by EE_Value::EE_Value(), MathParser::stmt(), Table::Table(), and Var::Var().
void TypedValue::SetType | ( | TypedValue::Type | t, |
bool | isConst = false |
||
) |
Definition at line 1264 of file mathp.cc.
References bConst, Const(), MBDYN_EXCEPT_ARGS, and type.
Referenced by MathParser::GetToken(), and MathParser::power_int().
|
protected |
Definition at line 87 of file mathtyp.h.
Referenced by Cast(), Const(), operator=(), SetConst(), and SetType().
Int TypedValue::i |
Definition at line 89 of file mathtyp.h.
Referenced by TypedValue().
Real TypedValue::r |
Definition at line 90 of file mathtyp.h.
Referenced by Cast(), Set(), and TypedValue().
|
protected |
Definition at line 92 of file mathtyp.h.
Referenced by Cast(), GetString(), operator+=(), operator=(), Set(), and TypedValue().
|
protected |
Definition at line 86 of file mathtyp.h.
Referenced by Cast(), GetBool(), GetInt(), GetReal(), GetString(), GetType(), GetTypeName(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), SetType(), and TypedValue().
union { ... } TypedValue::v |
Referenced by GetBool(), GetInt(), GetReal(), Set(), and TypedValue().