artefaktur
software engineer &        architecture

 
 
 
 

class ScriptVar

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::dmi::ScriptVar Class Reference

#include <ScriptVar.h>

Inheritance diagram for acdk::lang::dmi::ScriptVar:

acdk::lang::dmi::DmiObject List of all members.

Detailed Description

ScriptVar is a generic container 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.

ScriptVar also provides the standard operations like addition, multiplication may used inside scripting languages.

It mainly used in Dynamic Method Invokation (DMI) interfaces.

See also:
 ScriptVar

acdk::lang::dmi::DmiObject

Exceptions:
Operation on ScriptVar (operatuions, conversion, assignmnet) can throw acdk::lang::DmiTypeConversionException
Author:
Roger Rene Kommer


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 ClazzInfogetClazzInfo () const
 This returns the ClazzInfo of the declared type.

const ClazzInfogetValueClazzInfo () const
 different to getClazzInfo() it always return the dynamic type info of the contained value.

ScriptVaroperator= (bool c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (bool *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (char c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (ucchar c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (char *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (const char *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (ucchar *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (byte c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (byte *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (short c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (short *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (int c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (int *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (jlong c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (jlong *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (float c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (float *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (double c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (double *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (const RObject &obj)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (Object *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


ScriptVaroperator= (RObject *c)
 assign operator for a bool value
Exceptions:
DmiTypeConversionException if incompatible type


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:
DmiTypeConversionException If not char reference


ucchar getUcCharVar (short castFlags=SVCastStdFlags) const
ucchargetUcCharRef ()
byte getByteVar (short castFlags=SVCastStdFlags) const
bytegetByteRef ()
short getShortVar (short castFlags=SVCastStdFlags) const
short & getShortRef ()
int getIntVar (short castFlags=SVCastStdFlags) const
int & getIntRef ()
jlong getLongVar (short castFlags=SVCastStdFlags) const
jlonggetLongRef ()
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
RObjectgetObjectRef ()
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

ScriptVaroperator= (const ScriptVar &o)
 assignment operator

void reset ()
 reset the script var to as void/UnknownType scriptvar

Objectoperator-> ()
 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 ClazzInfogetClazzInfo (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)

Member Enumeration Documentation

enum acdk::lang::dmi::ScriptVar::Type
 

the typed the ScriptVar can hold

Enumeration values:
UnknownType  Uninitialized or void type.
BoolType  contains bool
CharType  contains char
UcCharType  contains ucchar
ByteType  contains byte
ShortType  contains short
IntType  contains int
LongType  contains jlong
FloatType  contains float
DoubleType  contains double
ObjectType  contains acdk::lang::Object
BoolRefType  contains reference to bool value
CharRefType  contains reference to char value
UcCharRefType  contains reference to ucchar value
ByteRefType  contains reference to byte value
ShortRefType  contains reference to short value
IntRefType  contains reference to int value
LongRefType  contains reference to jlong value
FloatRefType  contains reference to float value
DoubleRefType  contains reference to double value
ObjectRefType  contains reference to acdk::lang::Object reference

Constructor & Destructor Documentation

acdk::lang::dmi::ScriptVar::ScriptVar  )  [inline]
 

Standard constructor as Unknown Type.

acdk::lang::dmi::ScriptVar::ScriptVar bool  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

ScriptVar contains Boolean value.

acdk::lang::dmi::ScriptVar::ScriptVar bool *  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

ScriptVar contains a bool reference.

acdk::lang::dmi::ScriptVar::ScriptVar char  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar char *  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar ucchar  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar ucchar c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar byte  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar byte c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar short  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar short *  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar int  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar int *  c,
int  fl = MiAiOut,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar jlong  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar jlong c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar float  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar float *  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar double  c,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar double *  c,
int  fl,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar NilRef  nilval,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

acdk::lang::dmi::ScriptVar::ScriptVar IN(RObject obj,
int  fl = MiAiIn,
const ClazzInfo ci = 0
 

Contains a acdk::lang::Object value.

acdk::lang::dmi::ScriptVar::ScriptVar Object obj,
int  fl = MiAiIn,
const ClazzInfo ci = 0
[inline]
 

Contains a acdk::lang::Object value.

acdk::lang::dmi::ScriptVar::ScriptVar InterfaceBase obj,
int  fl = MiAiIn,
const ClazzInfo ci = 0
 

Contains a acdk::lang::Object value.

acdk::lang::dmi::ScriptVar::ScriptVar RObject c,
int  fl = MiAiOut,
const ClazzInfo ci = 0
 

contains a acdk::lang::Object reference

acdk::lang::dmi::ScriptVar::ScriptVar const char *  cstr  ) 
 

Contains a acdk::lang::Object with contains a String with given cstr.

acdk::lang::dmi::ScriptVar::ScriptVar const ScriptVar o  ) 
 

copy constructor

acdk::lang::dmi::ScriptVar::ScriptVar const ScriptVar o,
int  flags,
const ClazzInfo ci = 0
 

constructs a ScriptVar from another scriptvar with possibility to change flags and declared type

acdk::lang::dmi::ScriptVar::~ScriptVar  ) 
 


Member Function Documentation

ScriptVar acdk::lang::dmi::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.

void acdk::lang::dmi::ScriptVar::_checkCastAutoboxing short  castFlags,
Type  requestedType
const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkCastBool2Num short  castFlags,
Type  requestedType
const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkCastChar2Int short  castFlags,
Type  requestedType
const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkCastInt2Float short  castFlags,
Type  requestedType
const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkCastNum2Bool short  castFlags  )  const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkFloat2Char short  castFlags,
Type  requestedType
const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_checkType Type  tp  )  const [inline, protected]
 

throws DmiTypeConversionException if type is not matching exaclty

void acdk::lang::dmi::ScriptVar::_deleterobject  )  [inline, protected]
 

bool acdk::lang::dmi::ScriptVar::_getBool  )  const [inline, protected]
 

byte acdk::lang::dmi::ScriptVar::_getByte  )  const [inline, protected]
 

char acdk::lang::dmi::ScriptVar::_getChar  )  const [inline, protected]
 

float acdk::lang::dmi::ScriptVar::_getDouble  )  const [inline, protected]
 

float acdk::lang::dmi::ScriptVar::_getFloat  )  const [inline, protected]
 

int acdk::lang::dmi::ScriptVar::_getInt  )  const [inline, protected]
 

jlong acdk::lang::dmi::ScriptVar::_getLong  )  const [inline, protected]
 

RObject acdk::lang::dmi::ScriptVar::_getObject  )  const [inline, protected]
 

const RObject& acdk::lang::dmi::ScriptVar::_getrobject  )  const [protected]
 

RObject& acdk::lang::dmi::ScriptVar::_getrobject  )  [protected]
 

short acdk::lang::dmi::ScriptVar::_getShort  )  const [inline, protected]
 

ucchar acdk::lang::dmi::ScriptVar::_getUcChar  )  const [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_init RObject obj  )  [protected]
 

void acdk::lang::dmi::ScriptVar::_init Object obj  )  [protected]
 

void acdk::lang::dmi::ScriptVar::_initScriptVar const ScriptVar o  )  [protected]
 

void acdk::lang::dmi::ScriptVar::_setrobject IN(RObject o  )  [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_setrobject Object o  )  [inline, protected]
 

void acdk::lang::dmi::ScriptVar::_throwWrongType Type  wanted  )  const [protected]
 

throws a DmiTypeConversionException

void acdk::lang::dmi::ScriptVar::_throwWrongType const ClazzInfo wanted,
const ClazzInfo existant
[static]
 

Throws DmiTypeConversionException.

parameter wanted and existant are not checked, only used to error message

ScriptVar acdk::lang::dmi::ScriptVar::addition const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

arithmetic operators

void acdk::lang::dmi::ScriptVar::assign IN(RObject obj,
short  castFlags = SVCastStdFlags
[inline]
 

assign given object to this

Reimplemented in acdk::lang::dmi::DmiObject.

void acdk::lang::dmi::ScriptVar::assign Object obj,
short  castFlags = SVCastStdFlags
 

assign given object to this

ScriptVar acdk::lang::dmi::ScriptVar::binary_and const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_leftshift const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_not short  castFlags = SVCastStdFlags  )  const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_or const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_rightshift const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_rightshift_unsigned const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::binary_xor const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

void acdk::lang::dmi::ScriptVar::dispose  ) 
 

Release internal recouces.

ScriptVar acdk::lang::dmi::ScriptVar::divide const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

arithmetic operators

ScriptVar acdk::lang::dmi::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.

void acdk::lang::dmi::ScriptVar::get RObject b  )  const
 

void acdk::lang::dmi::ScriptVar::get double &  b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get float &  b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get jlong b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get int &  b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get short &  b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get byte b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get ucchar b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get char &  b  )  const [inline]
 

void acdk::lang::dmi::ScriptVar::get bool &  b  )  const [inline]
 

used for templates

RString acdk::lang::dmi::ScriptVar::getAsCodeArguments ScriptVarArray args  )  [static, protected]
 

Returns:
(int, ::acdk::lang::StringBuffer)

template<class T>
T acdk::lang::dmi::ScriptVar::getBasicType const T &  dummy  )  const [inline]
 

internal helper to retrive value of given type

bool& acdk::lang::dmi::ScriptVar::getBoolRef  ) 
 

return bool reference.

Exceptions:
DmiTypeConversionException If not bool reference or bool value

bool acdk::lang::dmi::ScriptVar::getBoolVar short  castFlags = SVCastStdFlags  )  const
 

returns a bool value.

In case of reference type it returns corresponding contained value type In case of integer all values != 0 returned true In case of acdk::lang::Object returns true if obj != Nil

byte& acdk::lang::dmi::ScriptVar::getByteRef  ) 
 

See also:
getCharRef

byte acdk::lang::dmi::ScriptVar::getByteVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

char& acdk::lang::dmi::ScriptVar::getCharRef  ) 
 

return char reference

Exceptions:
DmiTypeConversionException If not char reference

char acdk::lang::dmi::ScriptVar::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 .

Exceptions:
otherwise DmiTypeConversionException

const ClazzInfo* acdk::lang::dmi::ScriptVar::getClazzInfo Type  typ  )  [static]
 

returns basic type.

in Case of Object always object

const ClazzInfo* acdk::lang::dmi::ScriptVar::getClazzInfo  )  const [inline]
 

This returns the ClazzInfo of the declared type.

If the ScriptVar doesn't have an explicit set type (_clazzType == 0) it return the dynamic type of the contained value.

In case it contains a basic type it returns the ClazzInfo::getBasicTypeClazz<T>() In case it is a Nil object it returns the Object::clazzInfo() In case of unknown type it returns ClazzInfo::getUnknownBasicClazz()

Returns:
the declared ClazzInfo or the ClazzInfo the contained value
See also:
getValueClazzInfo()

void* acdk::lang::dmi::ScriptVar::getDataPtr  ) 
 

return the void pointer to the data; Node the return pointer is only valid as long this ScriptVar exists.

In case of holding reference types it returns also the pointer the value and not a pointer to a pointer to the value

double& acdk::lang::dmi::ScriptVar::getDoubleRef  ) 
 

See also:
getCharVar

double acdk::lang::dmi::ScriptVar::getDoubleVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

float& acdk::lang::dmi::ScriptVar::getFloatRef  ) 
 

See also:
getCharVar

float acdk::lang::dmi::ScriptVar::getFloatVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

ScriptVar acdk::lang::dmi::ScriptVar::getInitialized const acdk::lang::dmi::ClazzInfo ci  )  [static]
 

returns an initialized instance of ScriptVar

int& acdk::lang::dmi::ScriptVar::getIntRef  ) 
 

See also:
getCharRef

int acdk::lang::dmi::ScriptVar::getIntVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

jlong& acdk::lang::dmi::ScriptVar::getLongRef  ) 
 

See also:
getCharVar

jlong acdk::lang::dmi::ScriptVar::getLongVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

RObject& acdk::lang::dmi::ScriptVar::getObjectRef  ) 
 

See also:
getCharVar

RObject acdk::lang::dmi::ScriptVar::getObjectVar short  castFlags = SVCastStdFlags,
const ClazzInfo ci = 0
const
 

short& acdk::lang::dmi::ScriptVar::getShortRef  ) 
 

See also:
getCharRef

short acdk::lang::dmi::ScriptVar::getShortVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

RString acdk::lang::dmi::ScriptVar::getStringVar short  castFlags = SVCastStdFlags  )  const
 

return StringVar

Exceptions:
BadCastException If it is not a String containing, BadCastException will be thrown

RString acdk::lang::dmi::ScriptVar::getTypeInfo  )  const
 

returns the type name is ACDK coding bool acdk::lang::RString

int acdk::lang::dmi::ScriptVar::getTypeStorageSize  )  const
 

return the size of the stored type.

If Type is dynamic (object) it returns -1 In case reference is stored return the size of the underlying type and not of the pointer

ucchar& acdk::lang::dmi::ScriptVar::getUcCharRef  ) 
 

See also:
getCharRef

ucchar acdk::lang::dmi::ScriptVar::getUcCharVar short  castFlags = SVCastStdFlags  )  const
 

See also:
getCharVar

const ClazzInfo* acdk::lang::dmi::ScriptVar::getValueClazzInfo  )  const
 

different to getClazzInfo() it always return the dynamic type info of the contained value.

See also:
getClazzInfo()

ScriptVar acdk::lang::dmi::ScriptVar::greater_or_equal const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::greater_than const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

return true if this is greater than the argument

ScriptVar acdk::lang::dmi::ScriptVar::inOf  )  const
 

return a copy of this.

In case this holds a reference, the contained value will be copied to a value.

ScriptVar acdk::lang::dmi::ScriptVar::inoutOf  ) 
 

return this as reference type

Note:
this instance has to be hold as long also the reference exits, otherwise crash!

bool acdk::lang::dmi::ScriptVar::isBoolean short  castFlags = SVCastStdFlags  )  const
 

return true if containing value can be casted to a boolean type

bool acdk::lang::dmi::ScriptVar::isBoolType  )  const [inline]
 

contains true if the hold value has type bool

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isByteType  )  const [inline]
 

contains true if the hold value has type byte

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isCharacter short  castFlags = SVCastStdFlags  )  const
 

return true if containing value can be casted to a character type

bool acdk::lang::dmi::ScriptVar::isCharacterType  )  const [inline]
 

return true if hold type is char or ucchar

bool acdk::lang::dmi::ScriptVar::isCharType  )  const [inline]
 

contains true if the hold value has type char

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isDoubleType  )  const [inline]
 

contains true if the hold value has type double

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isFloating short  castFlags = SVCastStdFlags  )  const
 

return true if containing value can be casted to a floating type

bool acdk::lang::dmi::ScriptVar::isFloatingType  )  const [inline]
 

return true if hold type is float or double

bool acdk::lang::dmi::ScriptVar::isFloatType  )  const [inline]
 

contains true if the hold value has type float

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isInteger short  castFlags = SVCastStdFlags  )  const
 

return true if containing can be casted to a integer type

bool acdk::lang::dmi::ScriptVar::isIntegerType  )  const [inline]
 

return true if the hold type is byte, short, int or long

bool acdk::lang::dmi::ScriptVar::isIntType  )  const [inline]
 

contains true if the hold value has type int

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isLongType  )  const [inline]
 

contains true if the hold value has type jlong

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isNumber short  castFlags = SVCastStdFlags  )  const [inline]
 

return true if the containing value can be casted to a number type

bool acdk::lang::dmi::ScriptVar::isNumberType  )  const [inline]
 

return true if hold type is byte, short, int, long, float or double

bool acdk::lang::dmi::ScriptVar::isObject short  castFlags = SVCastStdFlags  )  const [inline]
 

return true if containing type can be casted to a Object

bool acdk::lang::dmi::ScriptVar::isObjectType  )  const [inline]
 

contains true if the hold value has type Object

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isOnlyFloating short  castFlags  )  const
 

this returns true if this is a castable float, but no castable integer

bool acdk::lang::dmi::ScriptVar::isReference Type  tp  )  [inline, static]
 

return true, if type is reference type

bool acdk::lang::dmi::ScriptVar::isShortType  )  const [inline]
 

contains true if the hold value has type short

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isString short  castFlags = SVCastStdFlags  )  const
 

return true if the containing type can be casted to a string

bool acdk::lang::dmi::ScriptVar::isStringType  )  const [inline]
 

return true if the hold type is a String instance

bool acdk::lang::dmi::ScriptVar::isTrue short  castFlags = SVCastStdFlags  )  const
 

bool acdk::lang::dmi::ScriptVar::isUcCharType  )  const [inline]
 

contains true if the hold value has type ucchar

Reimplemented in acdk::lang::dmi::DmiObject.

bool acdk::lang::dmi::ScriptVar::isUndef  )  const [inline]
 

return true if unknown type.

This means ScriptVar is not initialized or void

bool acdk::lang::dmi::ScriptVar::isVoid  )  const [inline]
 

return true if type is unknown/void

ScriptVar acdk::lang::dmi::ScriptVar::less_or_equal const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::less_than const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

return true if this is less than the argument

ScriptVar acdk::lang::dmi::ScriptVar::logical_and const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::logical_not short  castFlags = SVCastStdFlags  )  const
 

ScriptVar acdk::lang::dmi::ScriptVar::logical_or const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::logical_xor const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

ScriptVar acdk::lang::dmi::ScriptVar::modulo const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

arithmetic operators

ScriptVar acdk::lang::dmi::ScriptVar::multiply const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

arithmetic operators

ScriptVar acdk::lang::dmi::ScriptVar::negation short  castFlags = SVCastStdFlags  )  const
 

only valid for number.

return switched signed value

ScriptVar acdk::lang::dmi::ScriptVar::not_equal const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

return false if this object is not equal to other object.

if contained value is a object type it calls equals on this value

acdk::lang::dmi::ScriptVar::operator bool  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator byte  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator char  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator double  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator float  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator int  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator jlong  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator short  )  const [inline]
 

acdk::lang::dmi::ScriptVar::operator ucchar  )  const [inline]
 

Object* acdk::lang::dmi::ScriptVar::operator->  ) 
 

This operator throws Exception if type is object var or reference.

ScriptVar& acdk::lang::dmi::ScriptVar::operator= const ScriptVar o  ) 
 

assignment operator

Reimplemented in acdk::lang::dmi::DmiObject.

ScriptVar& acdk::lang::dmi::ScriptVar::operator= RObject c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= Object c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= const RObject obj  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= double *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= double  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= float *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= float  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= jlong c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= jlong  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= int *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= int  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= short *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= short  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= byte c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= byte  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= ucchar c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= const char *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= char *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= ucchar  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= char  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= bool *  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar& acdk::lang::dmi::ScriptVar::operator= bool  c  ) 
 

assign operator for a bool value

Exceptions:
DmiTypeConversionException if incompatible type

ScriptVar acdk::lang::dmi::ScriptVar::outOf  ) 
 

return this as reference type

Note:
this instance has to be hold as long also the reference exits, otherwise crash!

void acdk::lang::dmi::ScriptVar::reset  ) 
 

reset the script var to as void/UnknownType scriptvar

ScriptVar acdk::lang::dmi::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.

void acdk::lang::dmi::ScriptVar::setOwnObjectReference IN(RObject obj = Nil  ) 
 

For serialized mappings it may be needed to set a Object Reference (acdk::lang::Object) as own reference.

The acdk::lang::Object* will be allocated by new

ScriptVar acdk::lang::dmi::ScriptVar::subtraction const ScriptVar other,
short  castFlags = SVCastStdFlags
const
 

arithmetic operators

RString acdk::lang::dmi::ScriptVar::toCode  )  const
 

the value as code constants 123 true This is a Text

RString acdk::lang::dmi::ScriptVar::toString  )  const
 

Converts the value to string for debugging purposes.


Member Data Documentation

const ClazzInfo* acdk::lang::dmi::ScriptVar::_clazzType
 

if _clazzType is 0 the DmiObject has a weak type definition and may change its underlying type.

If _clazzType is not 0, the assign methods check if type is assignable

int acdk::lang::dmi::ScriptVar::flags
 

The flags see acdk::lang::dmi::MetaInfoFlags.

Type acdk::lang::dmi::ScriptVar::type
 

TypeUnion acdk::lang::dmi::ScriptVar::var
 

The value.

 
Last modified 2005-05-08 18:32 by SYSTEM By Artefaktur, Ing. Bureau Kommer