→ home
 
→ index of namespace default
 
→ index of project core
 
→ index of module core

Class core.TKS


Synopsis: Static class that provides various TkScript related utility functions (e.g. reflection helpers).

  Base classes:
  Methods:
  Constants:
Method classToHashTable
Write the members of the given meta class instance to the given hash table.
Signature
classToHashTable(Objectc,
  HashTableht 
  )  
 :boolean
Arguments
Objectc–Meta class instance (script class)
HashTableht–Target hashtable
Returns
boolean–true if all object members have been written to the hashtable or false otherwise

 
→ top of page
Method constantToString
Try to map a constant integer value to a literal.
Signature
constantToString(intc,
  Stringprefix 
  )  
 :String
Arguments
intc–Integer constant
Stringprefix–Prefix of constant name
Returns
String–

 
→ top of page
Method evalMethodByName
Evaluate the given C++ or meta class method.
Signature
evalMethodByName(Objecto,
  Stringname,
  Objectarglist,
  ValuereturnValue 
  )  
 :boolean
Arguments
Objecto–Object to operate on
Stringname–Method name
Objectarglist–Argument list (array, list, ..)
ValuereturnValue–Receives the method return value
Returns
boolean–true if the method has been called successfully, false otherwise

 
→ top of page
Method findClassesByPrefix
Find all script and/or C++ classes that match the given class name prefix.
Signature
findClassesByPrefix(StringnspaceName,
  Stringprefix 
  )  
 :PointerArray
Arguments
StringnspaceName–"yac" to only search C++ classes, null to search all classes (script classes first), or namespace name to match.
Stringprefix–null to match all class names, class name prefix otherwise.
Returns
PointerArray–PointerArray that holds template object references to all matching classes.
Description

If nspaceName is "yac", only C++ will be searched.
This method supports the => operator.

 
→ top of page
Method findScriptClass
Find the template object for the given script class.
Signature
findScriptClass(StringnspaceName,
  StringclassName 
  )  
 :Class
Arguments
StringnspaceName–Name of the namespace or NULL (default namespace)
StringclassName–Name of the script class
Returns
Class–template object for the given script class or null if the given name does not map to a script class.

 
→ top of page
Method forceUnlockNamedMutex
Unlock mutex. Should only be called in case something horribly wrent wrong (e.g. a thread holding the mutex has crashed)
Signature
forceUnlockNamedMutex(name)
Arguments
name–
Description

This method might be removed, pls don't call.

 
→ top of page
Method getClassID
Return the classID of the given C++ object.
Signature
getClassID(Objecto)
 :int
Arguments
Objecto–The object in question
Returns
int–C++ classID

 
→ top of page
Method getClassName
Return the name of the given object
Signature
getClassName(Objecto)
 :String
Arguments
Objecto–The object in question
Returns
String–new String instance holding the class name or null if "o" is not a valid object.
See also:  


 
→ top of page
Method getDllPrefix
Query prefix for native code DLLs / shared objects.
Signature
getDllPrefix():String
Returns
String–"" on Windows, "lib" on Linux, MacOSX, ..

 
→ top of page
Method getDllSuffix
Query suffix for native code DLLs / shared objects.
Signature
getDllSuffix():String
Returns
String–".dll" on Windows, ".so" on Linux, MacOSX, ..

 
→ top of page
Method getHomeDir
Query absolute pathname of user home directory.
Signature
getHomeDir():String
Returns
String–Absolute pathname of user home directory

 
→ top of page
Method getMethodArgumentNames
Query the parameter names of the given script class method.
Signature
getMethodArgumentNames(StringnamespaceName,
  StringscriptClassName,
  StringmethodName 
  )  
 :StringArray
Arguments
StringnamespaceName–Name of the namespace, null to search default namespace
StringscriptClassName–Name of the script class
StringmethodName–Method name
Returns
StringArray–new StringArray instance holding the method parameter names or null if the class or method was not found.

 
→ top of page
Method getMethodNames
Query the method names of the given C++ or script class.
Signature
getMethodNames(Objecto)
 :StringArray
Arguments
Objecto–C++ or script (meta) class instance
Returns
StringArray–new StringArray instance holding the method names for the given class or null if "o" is not a valid object.

 
→ top of page
Method getNamespaceName
Return the namespace name of the given object
Signature
getNamespaceName(Objecto)
 :String
Arguments
Objecto–The object in question
Returns
String–new String instance holding the namespace name or null if "o" is not a valid object.
See also:  


 
→ top of page
Method getNumProperties
Return the number of meta class members.
Signature
getNumProperties(Objecto)
 :int
Arguments
Objecto–The object in question
Returns
int–Number of meta class members
See also:  


 
→ top of page
Method getPropertyAccessKeyByIndex
Query the access key for the nth member of a meta class object.
Signature
getPropertyAccessKeyByIndex(Objecto,
  intindex 
  )  
 :int
Arguments
Objecto–The object in question
intindex–
Returns
int–
Description

This is a tool method to handle meta class objects like e.g. script classes.
See also:  


 
→ top of page
Method getPropertyAccessKeyByName
Query the access key for a member of a meta class object.
Signature
getPropertyAccessKeyByName(Objecto,
  Stringname 
  )  
 :int
Arguments
Objecto–The object in question
Stringname–Member name
Returns
int–
Description

This is a tool method to handle meta class objects like e.g. script classes.
See also:  


 
→ top of page
Method getPropertyByAccessKey
Read meta class member.
Signature
getPropertyByAccessKey(intak)
 :var
Arguments
intak–Access key to the meta class member
Returns
var–Member value
See also:  


 
→ top of page
Method getPropertyByName
Return meta class member value by name.
Signature
getPropertyByName(Stringname)
 :var
Arguments
Stringname–Member name
Returns
var–Member value
See also:  


 
→ top of page
Method getPropertyClassName
Return the name of a meta class object.
Signature
getPropertyClassName(Objecto)
 :String
Arguments
Objecto–The object in question
Returns
String–Meta class name
See also:  


 
→ top of page
Method getPropertyNameByAccessKey
Return meta class member name.
Signature
getPropertyNameByAccessKey(intak)
 :String
Arguments
intak–Access key to the meta class member
Returns
String–Member name
See also:  


 
→ top of page
Method getTksApplicationPath
Query absolute pathname of tks application directory.
Signature
getTksApplicationPath():String
Returns
String–Absolute pathname of tks application directory

 
→ top of page
Method getTksExeDir
Query absolute pathname of tks executable.
Signature
getTksExeDir():String
Returns
String–Absolute pathname of tks executable

 
→ top of page
Method getTksLibraryPath
Query absolute pathname of tks library directory.
Signature
getTksLibraryPath():String
Returns
String–Absolute pathname of tks library directory

 
→ top of page
Method getTksModulePath
Query absolute pathname of tks modules directory.
Signature
getTksModulePath():String
Returns
String–Absolute pathname of tks modules directory

 
→ top of page
Method getTksPluginPath
Query absolute pathname of tks plugins directory.
Signature
getTksPluginPath():String
Returns
String–Absolute pathname of tks plugins directory

 
→ top of page
Method getVersion
Return TkScript version identifier.
Signature
getVersion():int
Returns
int–TkScript version 32bit integer value
Description

The format is 0xmmiirrpp, where mm=major version, ii=minor version major, rr=release number, pp=patch.
See also:  


 
→ top of page
Method getVersionString
Return TkScript version string.
Signature
getVersionString():String
Returns
String–Version string
Description

Each byte is converted to decimal, sub-version numbers are separated by the '.' char.
See also:  


 
→ top of page
Method hashTableToClass
Iterate hash table and copy the elements to members of "c".
Signature
hashTableToClass(HashTableht,
  Objectc 
  )  
 :boolean
Arguments
HashTableht–Source hashtable
Objectc–Destination metaclass instance (scriptclass object)
Returns
boolean–true if all hash table entries were copied to the object or false, otherwise.
Description

All deletable objects will be unlinked from the hashtable.

 
→ top of page
Method is64Bit
Query whether it's a 64bit runtime environment.
Signature
is64Bit():boolean
Returns
boolean–True if it's 64bit, false if 32bit (less is not supported).

 
→ top of page
Method isBigEndian
Check whether TKS is running on a big endian host.
Signature
isBigEndian()

 
→ top of page
Method lockNamedMutex
Lock mutex that was declared using the =mutexname= syntax.
Signature
lockNamedMutex(name)
Arguments
name–

 
→ top of page
Method newObjectArrayByName
Resolve object name and create an empty array of equally typed objects.
Signature
newObjectArrayByName(Stringnspace,
  Stringname 
  )  
 :Object
Arguments
Stringnspace–Namespace name or null
Stringname–Name of the element object class
Returns
Object–Array object
Description

If the object class has a special array object (see Object.yacArrayNew()), an instance of the given array object class will be returned. A generic ObjectArray will be created, otherwise.
See also:  


 
→ top of page
Method newObjectByID
Return a new instance of the given C++ class.
Signature
newObjectByID(intclassID)
 :Object
Arguments
intclassID–Name-id of a C++ class
Returns
Object–C++ class instance
Description

This method has to be used with care since classIDs are not constants and may vary between different releases of TkScript. Plugin classes always have dynamic class IDs.

 
→ top of page
Method newObjectByName
Create a new instance of a script or C++ class.
Signature
newObjectByName(Stringnspace,
  Stringname 
  )  
 :Object
Arguments
Stringnspace–Namespace name or null
Stringname–Class name
Returns
Object–New object instance or null if the given name does not map to a script or C++ class.

 
→ top of page
Method reinstallDebugHandler
Hack to re-install exception filter after a DLL has changed it.
Signature
reinstallDebugHandler()

 
→ top of page
Method scriptClassConstantToString
Try to map a constant to script class constant name.
Signature
scriptClassConstantToString(Valuevo,
  Classclazz,
  Stringprefix 
  )  
 :String
Arguments
Valuevo–→ValueObject that the constants are compared with
Classclazz–Class in which to search
Stringprefix–Prefix of constant name
Returns
String–

 
→ top of page
Method setFloatPropertyByName
Set a float member of a meta class object.
Signature
setFloatPropertyByName(Objecto,
  Stringname,
  floatf 
  )  
Arguments
Objecto–The object in question
Stringname–Name of the property to modify
floatf–New value for the float property
Description

This is a tool method to handle meta class objects like e.g. script classes.
See also:  


 
→ top of page
Method setIntPropertyByName
Set an integer member of a meta class object.
Signature
setIntPropertyByName(Objecto,
  Stringname,
  inti 
  )  
Arguments
Objecto–The object in question
Stringname–Name of the property to modify
inti–New value for the integer property
Description

This is a tool method to handle meta class objects like e.g. script classes.
See also:  


 
→ top of page
Method setObjectPropertyByName
Set an object member of a meta class object.
Signature
setObjectPropertyByName(Objecto,
  Stringname,
  Objecto 
  )  
Arguments
Objecto–The object in question
Stringname–Name of the property to modify
Objecto–The object in question
Description

This is a tool method to handle meta class objects like e.g. script classes.
See also:  


 
→ top of page
Method sleep
Suspend the current thread for the given number of milli seconds.
Signature
sleep(intmilliSec)
Arguments
intmilliSec–Number of milli seconds

 
→ top of page
Method stringToConstant
Try to map a named constant to its value.
Signature
stringToConstant(Stringname)
 :var
Arguments
Stringname–Name of the constant
Returns
var–Constant value or void if the given name does not map to any constant

 
→ top of page
Method unlockNamedMutex
Unlock mutex that was declared using the =mutexname= syntax.
Signature
unlockNamedMutex(name)
Arguments
name–

 
→ top of page
Method yield
Yield CPU time to the next thread.
Signature
yield()

 
→ top of page
Constant SIGABRT (int)
Constant SIGFPE (int)
Constant SIGILL (int)
Constant SIGINT (int)
Constant SIGSEGV (int)
Constant SIGTERM (int)
Constant YAC_BIG_ENDIAN (int)
Stream byteorder (MSB first)
Constant YAC_LITTLE_ENDIAN (int)
Stream byteorder (LSB first)
Constant YAC_OP_ADD (int)
Object.yacOperator() command id (add)
Constant YAC_OP_AND (int)
Object.yacOperator() command id (bitwise and)
Constant YAC_OP_ASSIGN (int)
Object.yacOperator() command id (assign)
Constant YAC_OP_BITNOT (int)
Object.yacOperator() command id (bitwise not)
Constant YAC_OP_CEQ (int)
Object.yacOperator() command id (compare equal)
Constant YAC_OP_CGE (int)
Object.yacOperator() command id (compare greater equal)
Constant YAC_OP_CGT (int)
Object.yacOperator() command id (compare greater than)
Constant YAC_OP_CLE (int)
Object.yacOperator() command id (compare less equal)
Constant YAC_OP_CLT (int)
Object.yacOperator() command id (compare less than)
Constant YAC_OP_CNE (int)
Object.yacOperator() command id (compare not equal)
Constant YAC_OP_DIV (int)
Object.yacOperator() command id (divide)
Constant YAC_OP_EOR (int)
Object.yacOperator() command id (bitwise exclusive or)
Constant YAC_OP_INIT (int)
Object.yacOperator() command id (init)
Constant YAC_OP_LAND (int)
Object.yacOperator() command id (logical and)
Constant YAC_OP_LEOR (int)
Object.yacOperator() command id (logical exclusive or)
Constant YAC_OP_LOR (int)
Object.yacOperator() command id (logical or)
Constant YAC_OP_MOD (int)
Object.yacOperator() command id (modulo)
Constant YAC_OP_MUL (int)
Object.yacOperator() command id (multiply)
Constant YAC_OP_NEG (int)
Object.yacOperator() command id (negate)
Constant YAC_OP_NOT (int)
Object.yacOperator() command id (logical not)
Constant YAC_OP_OR (int)
Object.yacOperator() command id (bitwise or)
Constant YAC_OP_SHL (int)
Object.yacOperator() command id (shift left)
Constant YAC_OP_SHR (int)
Object.yacOperator() command id (shift right)
Constant YAC_OP_SUB (int)
Object.yacOperator() command id (subtract)
Constant YAC_TYPE_FLOAT (int)
Constant YAC_TYPE_INT (int)
Constant YAC_TYPE_OBJECT (int)
Constant YAC_TYPE_STRING (int)
Constant YAC_TYPE_VOID (int)

 

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable 
Project Functions:ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathClampf , mathClampi , mathDistancePointPlane2d , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathPowerf , mathPoweri , mathSmoothStepf , mathWrapf , mathWrapi , milliSeconds , psystem , putenv , srand , system , ucchar 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54