emergent 8.2.2 Variant Class Reference
emergent 8.2.2   Home · Wiki Docs For: Variant · Emergent Help Browser 

Variant Class Reference

flexible value atomic type that can hold many different types of content

See for more info: Wiki Docs For: Variant

 #include <Variant>

defined at: /mnt/ssd/grey/local/include/Emergent/Variant.h :47-450

Inherited By: Variant*, Variant&, const Variant

Index: SubTypes, Members, Methods, Static Members, Static Methods, Expert Members, Expert Methods

Sub Types


SubType Documentation

enum Variant::VarType

ConstantValueDescription
Variant::T_Invalid0x00000000
Variant::T_Bool0x00000001
Variant::T_Int0x00000002
Variant::T_UInt0x00000003
Variant::T_Int640x00000004
Variant::T_UInt640x00000005
Variant::T_Double0x00000006
Variant::T_Char0x00000007
Variant::T_Float0x00000008
Variant::T_String0x00000009
Variant::T_Ptr0x0000000Avoid*
Variant::T_Base0x0000000BtaBase ref counted
Variant::T_Matrix0x0000000CtaMatrix ref counted
Variant::T_TypeItem0x0000000D


Regular (preferred) Member and Method Documentation

Members

Methods

Method Category: _NoCategory


Method Documentation

Method Category: _NoCategory

bool Variant::Dump_Load_Type ( istream& strm, int& last_char )

loads type and null, using taMisc:: strm routines; calls ForceType; returns 'true' if type loaded

Show Source Code

void Variant::Dump_Save_Type ( ostream& strm )

dumps type and null

Show Source Code

void Variant::ForceType ( Variant::VarType vt, bool null )

called by streaming system to force the type to be indicated kind

Show Source Code

void Variant::GetRepInfo ( TypeDef*& typ, void*& data )

current typedef, and pointer to the data

Show Source Code

void Variant::UpdateAfterLoad ( )

called after internal modifications, to reassert correctness of null etc.

Show Source Code

int Variant::cmpBase ( taBase* val )

Show Source Code

int Variant::cmpBool ( bool val )

Show Source Code

int Variant::cmpByte ( byte val )

Show Source Code

int Variant::cmpCString ( char* val )

Show Source Code

int Variant::cmpChar ( char val )

Show Source Code

int Variant::cmpDouble ( double val )

Show Source Code

int Variant::cmpFloat ( float val )

Show Source Code

int Variant::cmpInt ( int val )

Show Source Code

int Variant::cmpInt64 ( ta_int64_t val )

Show Source Code

int Variant::cmpIntPtr ( intptr_t val )

Show Source Code

int Variant::cmpMatrix ( taMatrix* val )

Show Source Code

int Variant::cmpPtr ( void* val )

Show Source Code

int Variant::cmpString ( taString& val )

handles cmpting of a string

Show Source Code

int Variant::cmpTypeItem ( TypeItem* val )

todo: bool canCast(VarType new_type);

Show Source Code

int Variant::cmpUInt ( uint val )

Show Source Code

int Variant::cmpUInt64 ( ta_uint64_t val )

Show Source Code

int Variant::cmpVariant ( Variant& val )

value compare, using fairly relaxed type rules; Invalid never == anything

Show Source Code

bool Variant::eqBase ( taBase* val )

Show Source Code

bool Variant::eqBool ( bool val )

Show Source Code

bool Variant::eqByte ( byte val )

Show Source Code

bool Variant::eqCString ( char* val )

Show Source Code

bool Variant::eqChar ( char val )

Show Source Code

bool Variant::eqDouble ( double val )

Show Source Code

bool Variant::eqFloat ( float val )

Show Source Code

bool Variant::eqInt ( int val )

Show Source Code

bool Variant::eqInt64 ( ta_int64_t val )

Show Source Code

bool Variant::eqIntPtr ( intptr_t val )

Show Source Code

bool Variant::eqMatrix ( taMatrix* val )

Show Source Code

bool Variant::eqPtr ( void* val )

Show Source Code

bool Variant::eqString ( taString& val )

handles eqting of a string

Show Source Code

bool Variant::eqTypeItem ( TypeItem* val )

comparison operations, < -ve, == 0, > +ve

Show Source Code

bool Variant::eqUInt ( uint val )

Show Source Code

bool Variant::eqUInt64 ( ta_uint64_t val )

Show Source Code

bool Variant::eqVariant ( Variant& val )

value equality, using fairly relaxed type rules; Invalid never == anything

Show Source Code

void Variant::error ( char* msg )

emit error message

Show Source Code

taString Variant::getTypeAsString ( )

for debugging, get variant type as a string

Show Source Code

bool Variant::isAtomic ( )

'true' for non-ptr types (includes Invalid)

Show Source Code

bool Variant::isBaseType ( )

'true' if the value is a taBase* or taMatrix*

Show Source Code

bool Variant::isDefault ( )

returns 'true' if contains the default value for the type (null is ignored)

Show Source Code

bool Variant::isEnumDef ( )

'true' if the value is a NON-NULL EnumDef*, else false

Show Source Code

bool Variant::isInvalid ( )

Show Source Code

bool Variant::isMatrixType ( )

'true' if the value is a taMatrix*, BUT could be NULL

Show Source Code

bool Variant::isMemberDef ( )

'true' if the value is a NON-NULL MemberDef*, else false

Show Source Code

bool Variant::isMemberDefBase ( )

'true' if the value is a NON-NULL MemberDefBase*, else false

Show Source Code

bool Variant::isMethodDef ( )

'true' if the value is a NON-NULL MethodDef*, else false

Show Source Code

bool Variant::isNull ( )

'true' if the value is null

Show Source Code

bool Variant::isNumeric ( )

'true' if NumericStrict, or valid numeric string

Show Source Code

bool Variant::isNumericStrict ( )

'true' if an int-ish, float, or char type

Show Source Code

bool Variant::isPropertyDef ( )

'true' if the value is a NON-NULL PropertyDef*, else false

Show Source Code

bool Variant::isPtrType ( )

'true' if the value is a void*, taBase*, or taMatrix*

Show Source Code

bool Variant::isStringType ( )

'true' if a char or String

Show Source Code

bool Variant::isTypeDef ( )

'true' if the value is a NON-NULL TypeDef*, else false

Show Source Code

bool Variant::isTypeItem ( )

'true' if the value is a TypeItem*, BUT could be NULL

Show Source Code

bool Variant::isValid ( )

Show Source Code

void Variant::load ( istream& s )

streams in as a string, use toXxx if it is of another type

Show Source Code

void Variant::save ( ostream& s )

streams out using << for the type

Show Source Code

void Variant::setBase ( taBase* cp )

handles setting of a taBase

Show Source Code

void Variant::setBool ( bool val, bool null = false )

Show Source Code

void Variant::setByte ( byte val, bool null = false )

Show Source Code

void Variant::setCString ( char* val, bool null = false )

Show Source Code

void Variant::setChar ( char val, bool null = false )

Show Source Code

void Variant::setDouble ( double val, bool null = false )

Show Source Code

void Variant::setFloat ( float val, bool null = false )

Show Source Code

bool Variant::setFromStringGuessType ( taString& val )

set value from string, and attempt to guess the type based on the string -- e.g., if it is numeric with a decimal then convert to double type, true / false = bool, starting with . looks for a path to an object -- returns true if was able to guess a type other than String, otherwise sets to a string and assigns to value

Show Source Code

void Variant::setInt ( int val, bool null = false )

Show Source Code

void Variant::setInt64 ( ta_int64_t val, bool null = false )

Show Source Code

void Variant::setIntPtr ( intptr_t val, bool null = false )

Show Source Code

void Variant::setInvalid ( )

invalid/null

Show Source Code

void Variant::setMatrix ( taMatrix* cp )

handles setting of a matrix

Show Source Code

void Variant::setPtr ( void* val )

Show Source Code

void Variant::setString ( taString& cp, bool null = false )

handles setting of a string

Show Source Code

void Variant::setType ( Variant::VarType value )

force it to be given type, if changed, set to default value

Show Source Code

void Variant::setTypeItem ( TypeItem* cp )

handles setting of a TypeItem

Show Source Code

void Variant::setUInt ( uint val, bool null = false )

Show Source Code

void Variant::setUInt64 ( ta_uint64_t val, bool null = false )

Show Source Code

void Variant::setVariant ( Variant& cp )

basically a copy

Show Source Code

void Variant::setVariantData ( Variant& cp )

preserve target type, only copy data

Show Source Code

taBase* Variant::toBase ( )

must be a Base or Matrix, otherwise returns NULL

Show Source Code

bool Variant::toBool ( )

Show Source Code

byte Variant::toByte ( )

Show Source Code

char Variant::toChar ( )

Show Source Code

const taString Variant::toCssLiteral ( )

to a form suitable for initializing a Css variable, ex. quoted strings, U suffix for unsigned, path for taBase variable, etc.

Show Source Code

double Variant::toDouble ( )

Show Source Code

EnumDef* Variant::toEnumDef ( )

must be a EnumDef, otherwise returns NULL

Show Source Code

float Variant::toFloat ( )

Show Source Code

int Variant::toInt ( )

Show Source Code

ta_int64_t Variant::toInt64 ( )

Show Source Code

taMatrix* Variant::toMatrix ( )

must be a Matrix, otherwise returns NULL

Show Source Code

MemberDef* Variant::toMemberDef ( )

must be a MemberDef, otherwise returns NULL

Show Source Code

MemberDefBase* Variant::toMemberDefBase ( )

must be a MemberDefBase, otherwise returns NULL

Show Source Code

MethodDef* Variant::toMethodDef ( )

must be a MethodDef, otherwise returns NULL

Show Source Code

PropertyDef* Variant::toPropertyDef ( )

must be a PropertyDef, otherwise returns NULL

Show Source Code

void* Variant::toPtr ( )

must be a void*, Base, or Matrix, otherwise returns NULL

Show Source Code

taString Variant::toString ( )

Show Source Code

TypeDef* Variant::toTypeDef ( )

must be a TypeDef, otherwise returns NULL

Show Source Code

TypeItem* Variant::toTypeItem ( )

must be a TypeItem, otherwise returns NULL

Show Source Code

uint Variant::toUInt ( )

Show Source Code

ta_uint64_t Variant::toUInt64 ( )

Show Source Code

Variant::VarType Variant::type ( )

Show Source Code

void Variant::updateFromString ( taString& val )

set value from string, but keep current type

Show Source Code

void Variant::warn ( char* msg )

emit warning message

Show Source Code

Static Member and Method Documentation

Static Members

Static Methods

Static Method Category: _NoCategory


Static Method Documentation

Static Method Category: _NoCategory

const taString Variant::formatNumber ( Variant& val, short prec, bool hex = false )   [static]

format a number (hex for integral types only)

Show Source Code

Expert Member and Method Documentation

Expert Members

Expert Methods


Expert Method Documentation


Copyright © 2017Regents of the University of Colorado, Carnegie Mellon University, Princeton University.
emergent 8.2.2