Public Types |
| enum | ToNodeType { ToNodeTop,
ToNodeOne,
ToNodeAll,
ToNodeNone
} |
|
typedef uint16_t | Type |
|
typedef void(MVar::* | BoolType_ )() const |
Public Member Functions |
|
| MVar (bool x) |
|
| MVar (uint8_t x) |
|
| MVar (int8_t x) |
|
| MVar (uint16_t x) |
|
| MVar (int16_t x) |
|
| MVar (uint32_t x) |
|
| MVar (int32_t x) |
|
| MVar (uint64_t x) |
|
| MVar (int64_t x) |
|
| MVar (double x) |
|
| MVar (float x) |
|
| MVar (const MVar &v) |
|
| MVar (const mnum &x) |
|
| MVar (const mstr &str, Type t=String) |
|
| MVar (const std::string &str, Type t=String) |
|
| MVar (const char *str, Type t=String) |
|
| MVar (mstr *str, Type t=String) |
|
| MVar (MObject *o, Type t=ObjectPointer) |
|
| MVar (void *p) |
|
| MVar (const MObject &o) |
|
| MVar (const mnode &n, bool exact=false) |
|
| MVar (const mvec &v) |
|
| MVar (const mlist &l) |
|
| MVar (const mrat &x) |
|
| MVar (const mmat &x) |
|
| MVar (const mreal &x) |
|
mnum & | asNum () |
|
const mnum & | asNum () const |
|
mnum & | num () |
|
const mnum & | num () const |
|
| operator const mnum & () const |
|
| operator mnum & () |
|
bool | isTrue () const |
|
bool | isFalse () const |
|
mstr & | asStr () |
|
const mstr & | asStr () const |
|
mstr & | str () |
|
const mstr & | str () const |
|
const char * | cstr () const |
| mstr | toStr (bool concise=true, bool quote=false, bool mml=true) const |
|
const char * | asCStr () const |
|
std::string | toStdStr () const |
|
int64_t | asLong () const |
|
int64_t | toLong () const |
|
double | asDouble () const |
|
double | toDouble () const |
|
const mrat & | asRat () const |
|
mrat & | asRat () |
|
mrat | toRat () const |
|
const mreal & | asReal () const |
|
mreal & | asReal () |
|
mreal | toReal () const |
|
const mmat & | asMat () const |
|
mmat & | asMat () |
|
size_t | asSize () const |
|
MObject * | asObj () const |
|
MObject * | obj () const |
|
void * | asPtr () const |
|
void * | ptr () const |
|
const mvec & | vec () const |
|
mvec & | vec () |
|
| operator const mvec & () const |
|
| operator mvec & () |
|
const mlist & | list () const |
|
mlist & | list () |
|
| operator const mlist & () const |
|
| operator mlist & () |
|
const mmap & | map () const |
|
mmap & | map () |
| mvec | toVec () const |
| mlist | toList () const |
|
| operator const mmap & () const |
|
| operator mmap & () |
|
| operator double () const |
|
| operator uint8_t () const |
|
| operator int8_t () const |
|
| operator uint16_t () const |
|
| operator int16_t () const |
|
| operator uint32_t () const |
|
| operator int32_t () const |
|
| operator uint64_t () const |
|
| operator int64_t () const |
|
| operator const char * () const |
|
| operator mstr & () |
|
| operator const mstr & () const |
|
| operator float () const |
|
| operator bool () const |
|
MVar & | operator= (const MVar &v) |
|
MVar & | operator= (const MStr &s) |
|
MVar & | operator= (const std::string &s) |
|
MVar & | operator= (const char *s) |
|
template<typename T > |
| MVar & | operator= (const T &t) |
|
MVar & | operator+= (const MVar &v) |
|
MVar | operator+ (const MVar &v) const |
|
template<typename T > |
| MVar | operator+ (T &x) const |
|
MVar | operator+ (uint32_t x) const |
|
MVar | operator+ (int32_t x) const |
|
MVar | operator+ (uint64_t x) const |
|
MVar | operator+ (int64_t x) const |
|
MVar | operator+ (double x) const |
|
MVar | operator++ (int) |
|
MVar & | operator++ () |
|
MVar & | operator-= (const MVar &v) |
|
MVar | operator- (const MVar &v) const |
|
template<typename T > |
| MVar | operator- (T &x) const |
|
MVar | operator- (uint32_t x) const |
|
MVar | operator- (int32_t x) const |
|
MVar | operator- (uint64_t x) const |
|
MVar | operator- (int64_t x) const |
|
MVar | operator- (double x) const |
|
MVar | operator-- (int) |
|
MVar & | operator-- () |
|
MVar | operator- () const |
|
MVar & | operator*= (const MVar &v) |
|
MVar | operator* (const MVar &v) const |
|
template<typename T > |
| MVar | operator* (T &x) const |
|
MVar | operator* (uint32_t x) const |
|
MVar | operator* (int32_t x) const |
|
MVar | operator* (uint64_t x) const |
|
MVar | operator* (int64_t x) const |
|
MVar | operator* (double x) const |
|
MVar & | operator/= (const MVar &v) |
|
MVar | operator/ (const MVar &v) const |
|
template<typename T > |
| MVar | operator/ (T &x) const |
|
MVar | operator/ (uint32_t x) const |
|
MVar | operator/ (int32_t x) const |
|
MVar | operator/ (uint64_t x) const |
|
MVar | operator/ (int64_t x) const |
|
MVar | operator/ (double x) const |
|
bool | operator< (const MVar &v) const |
|
template<typename T > |
| bool | operator< (const T &t) const |
|
bool | operator> (const MVar &v) const |
|
template<typename T > |
| bool | operator> (const T &t) const |
|
bool | operator<= (const MVar &v) const |
|
template<typename T > |
| bool | operator<= (const T &t) const |
|
bool | operator>= (const MVar &v) const |
|
template<typename T > |
| bool | operator>= (const T &t) const |
|
bool | operator== (const MVar &v) const |
|
bool | operator== (const MStr &s) const |
|
template<typename T > |
| bool | operator== (const T &t) const |
|
bool | operator== (const std::string &s) const |
|
bool | operator== (const char *s) const |
|
bool | operator!= (const MVar &v) const |
|
bool | operator!= (const MStr &s) const |
|
template<typename T > |
| bool | operator!= (const T &t) const |
|
bool | operator!= (const std::string &s) const |
|
bool | operator!= (const char *s) const |
|
MVar & | operator|= (const MVar &v) |
|
MVar | operator| (const MVar &v) const |
|
template<typename T > |
| MVar | operator| (T &x) const |
|
MVar | operator| (int x) const |
|
MVar | operator| (double x) const |
|
const MVar & | operator[] (const MVar &key) const |
|
MVar & | operator[] (const MVar &key) |
|
template<typename T > |
| const MVar & | operator[] (const T &key) const |
|
template<typename T > |
| MVar & | operator[] (const T &key) |
|
bool | operator! () const |
|
MVar & | operator%= (const MVar &v) |
|
MVar | operator% (const MVar &v) const |
|
template<typename T > |
| MVar | operator% (const T &t) const |
|
MVar | operator% (uint32_t x) const |
|
MVar | operator% (int32_t x) const |
|
MVar | operator% (uint64_t x) const |
|
MVar | operator% (int64_t x) const |
|
MVar | operator% (double x) const |
|
MVar & | operator<< (const MVar &v) |
|
template<typename T > |
| MVar & | operator<< (const T &x) |
|
void | BoolStub_ () const |
|
| operator BoolType_ () const |
|
bool | isDefined () const |
|
bool | isNumeric () const |
|
int | isRational () const |
|
bool | isReal () const |
|
Type | type () const |
|
MVar & | get (const MVar &key) |
|
MVar & | operator() (const MVar &key) |
| mvec | keys () const |
| size_t | size () const |
| size_t | mapSize () const |
|
bool | isMapEmpty () const |
| bool | isSeqEmpty () const |
| bool | isEmpty () const |
| size_t | span () const |
|
bool | toBool () const |
|
void | setBinary (const char *buf, size_t pos, size_t count, Type t=String) |
|
size_t | getBinary (char *buf, size_t pos, size_t count) const |
|
size_t | getBinary (char *buf, size_t pos) const |
|
size_t | binarySize () const |
| bool | hasKey (const MVar &key) const |
| bool | keyValue (const MVar &key, const MVar &value) const |
|
MVar & | setHead (const MVar &v, Type t=String) |
|
MVar | head () const |
|
MVar & | back () |
|
const MVar & | back () const |
|
void | pushBack (const MVar &v) |
|
void | push_back (const MVar &v) |
|
void | push (const MVar &v) |
|
void | pushFront (const MVar &v) |
|
void | push_front (const MVar &v) |
|
MVar | popBack () |
|
void | pop_back () |
|
MVar | popFront () |
|
void | pop_front () |
|
void | pop () |
|
void | insert (int64_t pos, const MVar &value) |
|
MVar & | add (const MVar &key, const MVar &value) |
| const MVar & | uget (const MVar &key, const MVar &def=undef) const |
| int64_t | index (const MVar &value, int64_t start=0, int64_t end=-1) const |
|
void | erase (const MVar &key) |
| void | clearSeq () |
|
void | clearMap () |
|
void | clear () |
|
void | merge (const MVar &v) |
|
void | outerMerge (const MVar &v) |
|
bool | hasVector () const |
|
bool | hasList () const |
| void | indexMap (bool flag) |
|
bool | isString () const |
|
bool | isStringPtr () const |
| mvec | split (const mstr &delimiter, int maxTokens=-1) const |
| mstr | join (const mstr &delimiter) const |
| MVar & | unite () |
| MVar & | unite (const MVar &v, bool outer=false) |
| MVar & | intersect (const MVar &v, bool outer=false) |
| MVar & | complement (const MVar &v) |
| bool | subsumesData (const MVar &v) const |
| MVar | clone () const |
| MVar & | unlink () |
| bool | isCodeData () const |
| void | setCodeData (bool flag) |
| mnode | toNode (ToNodeType type=ToNodeTop) const |
| bool | isSymbolic () const |
| bool | isFunction () const |
| bool | isFunction (const mstr &f) const |
| bool | isFunction (const mstr &f, size_t args) const |
| bool | isFunction (const mstr &f, size_t argsMin, size_t argsMax) const |
| bool | isSymbol () const |
| bool | isSymbol (const mstr &name) const |
Static Public Member Functions |
|
static MVar | fromStr (const mstr &str, bool literal=true, bool exact=false) |
|
static MStr | itp (const MStr &str, const mvec &vars) |
Static Public Attributes |
|
static const Type | NumericMask = 0x0010 |
|
static const Type | DefinedNumericMask = 0x0020 |
|
static const Type | Undefined = 0x0010 |
|
static const Type | Constant = 0x0031 |
|
static const Type | Integer = 0x0032 |
|
static const Type | Rational = 0x0033 |
|
static const Type | Float = 0x0034 |
|
static const Type | Matrix = 0x0035 |
|
static const Type | Real = 0x0036 |
|
static const Type | StringMask = 0x0040 |
|
static const Type | String = 0x0040 |
|
static const Type | Symbol = 0x0041 |
|
static const Type | Function = 0x0042 |
|
static const Type | ObjectMask = 0x0080 |
|
static const Type | ObjectPointer = 0x0081 |
|
static const Type | LocalObject = 0x0082 |
|
static const Type | SharedObject = 0x0083 |
|
static const Type | RawPointer = 0x0100 |
|
static const Type | CodeDataMask = 0x0200 |
A recursive variant type for holding numerics, strings, and more.
Each mvar has a specific dynamic type (its "head") and may hold other mvar's recursively through its map and vector/list. MVar is used throughout the framework for a large variety of purposes.