for all other ACDK types.
It can hold the values by value or by reference. Additionally the declared type can be set, which may differ to to the concret type of the hold value.
|
Public Types |
enum | Type {
UnknownType = 0,
BoolType,
CharType,
UcCharType,
ByteType,
ShortType,
IntType,
LongType,
FloatType,
DoubleType,
ObjectType,
BoolRefType,
CharRefType,
UcCharRefType,
ByteRefType,
ShortRefType,
IntRefType,
LongRefType,
FloatRefType,
DoubleRefType,
ObjectRefType
} |
| the typed the ScriptVar can hold More...
|
Public Member Functions |
| ScriptVar () |
| Standard constructor as Unknown Type.
|
| ScriptVar (bool c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar contains Boolean value.
|
| ScriptVar (bool *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar contains a bool reference.
|
| ScriptVar (char c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (char *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (ucchar c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (ucchar *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (byte c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (byte *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (short c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (short *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (int c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (int *c, int fl=MiAiOut, const ClazzInfo *ci=0) |
| ScriptVar (jlong c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (jlong *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (float c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (float *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (double c, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (double *c, int fl, const ClazzInfo *ci=0) |
| ScriptVar (NilRef nilval, int fl=MiAiIn, const ClazzInfo *ci=0) |
| ScriptVar (IN(RObject) obj, int fl=MiAiIn, const ClazzInfo *ci=0) |
| Contains a acdk::lang::Object value.
|
| ScriptVar (Object *obj, int fl=MiAiIn, const ClazzInfo *ci=0) |
| Contains a acdk::lang::Object value.
|
| ScriptVar (InterfaceBase *obj, int fl=MiAiIn, const ClazzInfo *ci=0) |
| Contains a acdk::lang::Object value.
|
| ScriptVar (RObject *c, int fl=MiAiOut, const ClazzInfo *ci=0) |
| contains a acdk::lang::Object reference
|
| ScriptVar (const char *cstr) |
| Contains a acdk::lang::Object with contains a String with given cstr.
|
| ScriptVar (const ScriptVar &o) |
| copy constructor
|
| ScriptVar (const ScriptVar &o, int flags, const ClazzInfo *ci=0) |
| constructs a ScriptVar from another scriptvar with possibility to change flags and declared type
|
| ~ScriptVar () |
const ClazzInfo * | getClazzInfo () const |
| This returns the ClazzInfo of the declared type.
|
const ClazzInfo * | getValueClazzInfo () const |
| different to getClazzInfo() it always return the dynamic type info of the contained value.
|
ScriptVar & | operator= (bool c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (bool *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (char c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (ucchar c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (char *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (const char *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (ucchar *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (byte c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (byte *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (short c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (short *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (int c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (int *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (jlong c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (jlong *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (float c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (float *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (double c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (double *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (const RObject &obj) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (Object *c) |
| assign operator for a bool value - Exceptions:
-
|
ScriptVar & | operator= (RObject *c) |
| assign operator for a bool value - Exceptions:
-
|
void | setOwnObjectReference (IN(RObject) obj=Nil) |
| For serialized mappings it may be needed to set a Object Reference (acdk::lang::Object) as own reference.
|
bool | getBoolVar (short castFlags=SVCastStdFlags) const |
| returns a bool value.
|
bool & | getBoolRef () |
| return bool reference.
|
char | getCharVar (short castFlags=SVCastStdFlags) const |
| returns char value In case of reference type it returns corresponding contained value type In case of Number it just cast it to a char In case of acdk::lang::Object contains acdk::lang::Character or acdk::lang::Number it returns the casted value .
|
char & | getCharRef () |
| return char reference - Exceptions:
-
|
ucchar | getUcCharVar (short castFlags=SVCastStdFlags) const |
ucchar & | getUcCharRef () |
byte | getByteVar (short castFlags=SVCastStdFlags) const |
byte & | getByteRef () |
short | getShortVar (short castFlags=SVCastStdFlags) const |
short & | getShortRef () |
int | getIntVar (short castFlags=SVCastStdFlags) const |
int & | getIntRef () |
jlong | getLongVar (short castFlags=SVCastStdFlags) const |
jlong & | getLongRef () |
float | getFloatVar (short castFlags=SVCastStdFlags) const |
float & | getFloatRef () |
double | getDoubleVar (short castFlags=SVCastStdFlags) const |
double & | getDoubleRef () |
RObject | getObjectVar (short castFlags=SVCastStdFlags, const ClazzInfo *ci=0) const |
RObject & | getObjectRef () |
RString | getStringVar (short castFlags=SVCastStdFlags) const |
| return StringVar - Exceptions:
-
BadCastException | If it is not a String containing, BadCastException will be thrown |
|
void * | getDataPtr () |
| return the void pointer to the data; Node the return pointer is only valid as long this ScriptVar exists.
|
bool | isUndef () const |
| return true if unknown type.
|
bool | isVoid () const |
| return true if type is unknown/void
|
bool | isBoolType () const |
| contains true if the hold value has type bool
|
bool | isCharType () const |
| contains true if the hold value has type char
|
bool | isUcCharType () const |
| contains true if the hold value has type ucchar
|
bool | isByteType () const |
| contains true if the hold value has type byte
|
bool | isShortType () const |
| contains true if the hold value has type short
|
bool | isIntType () const |
| contains true if the hold value has type int
|
bool | isLongType () const |
| contains true if the hold value has type jlong
|
bool | isFloatType () const |
| contains true if the hold value has type float
|
bool | isDoubleType () const |
| contains true if the hold value has type double
|
bool | isObjectType () const |
| contains true if the hold value has type Object
|
bool | isIntegerType () const |
| return true if the hold type is byte, short, int or long
|
bool | isCharacterType () const |
| return true if hold type is char or ucchar
|
bool | isFloatingType () const |
| return true if hold type is float or double
|
bool | isNumberType () const |
| return true if hold type is byte, short, int, long, float or double
|
bool | isStringType () const |
| return true if the hold type is a String instance
|
bool | isBoolean (short castFlags=SVCastStdFlags) const |
| return true if containing value can be casted to a boolean type
|
bool | isCharacter (short castFlags=SVCastStdFlags) const |
| return true if containing value can be casted to a character type
|
bool | isInteger (short castFlags=SVCastStdFlags) const |
| return true if containing can be casted to a integer type
|
bool | isFloating (short castFlags=SVCastStdFlags) const |
| return true if containing value can be casted to a floating type
|
bool | isNumber (short castFlags=SVCastStdFlags) const |
| return true if the containing value can be casted to a number type
|
bool | isOnlyFloating (short castFlags) const |
| this returns true if this is a castable float, but no castable integer
|
bool | isString (short castFlags=SVCastStdFlags) const |
| return true if the containing type can be casted to a string
|
bool | isObject (short castFlags=SVCastStdFlags) const |
| return true if containing type can be casted to a Object
|
int | getTypeStorageSize () const |
| return the size of the stored type.
|
ScriptVar | addition (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| arithmetic operators
|
ScriptVar | subtraction (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| arithmetic operators
|
ScriptVar | multiply (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| arithmetic operators
|
ScriptVar | divide (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| arithmetic operators
|
ScriptVar | modulo (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| arithmetic operators
|
ScriptVar | equal (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| Test for equality For basic type must has same value For object types equals() has to return true.
|
ScriptVar | same (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| Test for same For basic type must has same value For object types has to reference to same object.
|
ScriptVar | not_equal (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| return false if this object is not equal to other object.
|
ScriptVar | greater_than (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| return true if this is greater than the argument
|
ScriptVar | less_than (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
| return true if this is less than the argument
|
ScriptVar | greater_or_equal (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | less_or_equal (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
bool | isTrue (short castFlags=SVCastStdFlags) const |
ScriptVar | logical_and (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | logical_not (short castFlags=SVCastStdFlags) const |
ScriptVar | logical_or (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | logical_xor (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_and (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_or (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_xor (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_leftshift (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_rightshift (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_rightshift_unsigned (const ScriptVar &other, short castFlags=SVCastStdFlags) const |
ScriptVar | binary_not (short castFlags=SVCastStdFlags) const |
ScriptVar | negation (short castFlags=SVCastStdFlags) const |
| only valid for number.
|
RString | getTypeInfo () const |
| returns the type name is ACDK coding bool acdk::lang::RString
|
template<class T> T | getBasicType (const T &dummy) const |
| internal helper to retrive value of given type
|
void | assign (Object *obj, short castFlags=SVCastStdFlags) |
| assign given object to this
|
void | assign (IN(RObject) obj, short castFlags=SVCastStdFlags) |
| assign given object to this
|
ScriptVar & | operator= (const ScriptVar &o) |
| assignment operator
|
void | reset () |
| reset the script var to as void/UnknownType scriptvar
|
Object * | operator-> () |
| This operator throws Exception if type is object var or reference.
|
RString | toString () const |
| Converts the value to string for debugging purposes.
|
RString | toCode () const |
| the value as code constants 123 true This is a Text
|
void | dispose () |
| Release internal recouces.
|
void | get (bool &b) const |
| used for templates
|
void | get (char &b) const |
void | get (ucchar &b) const |
void | get (byte &b) const |
void | get (short &b) const |
void | get (int &b) const |
void | get (jlong &b) const |
void | get (float &b) const |
void | get (double &b) const |
void | get (RObject &b) const |
| operator bool () const |
| operator char () const |
| operator ucchar () const |
| operator byte () const |
| operator short () const |
| operator int () const |
| operator jlong () const |
| operator float () const |
| operator double () const |
ScriptVar | inOf () const |
| return a copy of this.
|
ScriptVar | outOf () |
| return this as reference type
|
ScriptVar | inoutOf () |
| return this as reference type
|
ScriptVar | _castScriptVar (const ClazzInfo *ci, short castFlags=SVCastStdFlags) const |
| Cast this variable to another if it is is an object, use the _cast() operator of the object to cast to requested type.
|
Static Public Member Functions |
ScriptVar | getInitialized (const acdk::lang::dmi::ClazzInfo *ci) |
| returns an initialized instance of ScriptVar
|
const ClazzInfo * | getClazzInfo (Type typ) |
| returns basic type.
|
bool | isReference (Type tp) |
| return true, if type is reference type
|
void | _throwWrongType (const ClazzInfo *wanted, const ClazzInfo *existant) |
| Throws DmiTypeConversionException.
|
Public Attributes |
Type | type |
int | flags |
| The flags see acdk::lang::dmi::MetaInfoFlags.
|
TypeUnion | var |
| The value.
|
const ClazzInfo * | _clazzType |
| if _clazzType is 0 the DmiObject has a weak type definition and may change its underlying type.
|
Protected Member Functions |
void | _checkType (Type tp) const |
| throws DmiTypeConversionException if type is not matching exaclty
|
void | _throwWrongType (Type wanted) const |
| throws a DmiTypeConversionException
|
void | _init (Object *obj) |
void | _init (RObject *obj) |
void | _initScriptVar (const ScriptVar &o) |
RObject & | _getrobject () |
const RObject & | _getrobject () const |
void | _setrobject (Object *o) |
void | _setrobject (IN(RObject) o) |
void | _deleterobject () |
void | _checkCastNum2Bool (short castFlags) const |
void | _checkCastBool2Num (short castFlags, Type requestedType) const |
void | _checkCastChar2Int (short castFlags, Type requestedType) const |
void | _checkCastInt2Float (short castFlags, Type requestedType) const |
void | _checkFloat2Char (short castFlags, Type requestedType) const |
void | _checkCastAutoboxing (short castFlags, Type requestedType) const |
bool | _getBool () const |
char | _getChar () const |
ucchar | _getUcChar () const |
byte | _getByte () const |
short | _getShort () const |
int | _getInt () const |
jlong | _getLong () const |
float | _getFloat () const |
float | _getDouble () const |
RObject | _getObject () const |
Static Protected Member Functions |
RString | getAsCodeArguments (ScriptVarArray &args) |