2005/5/9

     
 

class System

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

acdk::lang::System Class Reference

#include <System.h>

Inheritance diagram for acdk::lang::System:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Represends the host running this programm.

API: Java & ACDK

Author:
Roger Rene Kommer
Version:
Revision
1.47
Date:
Date
2005/04/28 15:00:04


Public Member Functions

virtual ACDK_CORE_PUBLIC::acdk::lang::dmi::ClazzInfo * getClazzInfo ()
 returns the ClazzInfo of this object instance must not be 0

virtual ACDK_CORE_PUBLIC void getCollectableFields (FieldReferences &fields)
 retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set.

template<class T> template_static void arraycopy (IN(RBasicArray< T >) src, int srcpos, IN(RBasicArray< T >) dst, int dstpos, int length)
 copy an array

template<class T> template_static void arraycopy (IN(RObjectArrayImpl< T >) src, int srcpos, IN(RObjectArrayImpl< T >) dst, int dstpos, int length)
 copy an array

template<class T> template_static void arraycopy (const T *src, int srcpos, IN(RBasicArray< T >) dst, int dstpos, int length)
template<class T> template_static const RefHolder<
T > & 
registerStaticReference (RefHolder< T > &obj)
template<class T> template_static const InterfaceHolder<
T > & 
registerStaticReference (InterfaceHolder< T > &obj)

Static Public Member Functions

ACDK_CORE_PUBLIC::acdk::lang::dmi::ClazzInfo * clazzInfo ()
 return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc

ACDK_CORE_PUBLIC::acdk::lang::RClass GetClass ()
unsigned int getStackBase ()
ACDK_CORE_PUBLIC OUT (int) getSystemStatus()
 return a combination of SystemStatus flags

ACDK_CORE_PUBLIC void exit (int status)
 Calls ::exit() after deinitialization of System Normally you should not call this method.

ACDK_CORE_PUBLIC bool gc ()
 call the garbage collector

ACDK_CORE_PUBLIC jlong currentTimeMillis ()
 return a counter in milli seconds

ACDK_CORE_PUBLIC void registerStaticReference (Object *obj)
ACDK_CORE_PUBLIC int main (ACDK_MainFunc mainfunc, int argc, char *argv[], char **envptr=0, const char **addargs=0)
 Wrapper translating c-main to ACDK/Java main.

ACDK_CORE_PUBLIC int main2 (ACDK_MainFunc mainfunc, int argc, char *argv[], char **envptr, const char **addargs)
 do the real work

ACDK_CORE_PUBLIC int main (ACDK_MainFunc mainfunc, HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, const char **addargs=0)
ACDK_CORE_PUBLIC void initAsSharedLibrary ()
ACDK_CORE_PUBLIC void deInitAsSharedLibrary ()
ACDK_CORE_PUBLIC OUT (int) getArgc()
 Api: ACDK Returns the argc value given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC char ** getArgv ()
 Api: ACDK Returns the argv list given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC OUT (int) getOriginalArgc()
 Api: ACDK Returns the original argc value given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC char ** getOriginalArgv ()
 Api: ACDK Returns the original argv list given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC RSystemImpl getSystem ()
ACDK_CORE_PUBLIC RStringArray getArguments ()
 return the arguments passed to ACDK application main The internal options, filtered by ACDK or other library used for initialization are not contained in this arguments.

ACDK_CORE_PUBLIC RStringArray getUnfilteredArguments ()
 return all arguments, including internal options

ACDK_CORE_PUBLIC acdk::util::RProperties getProperties ()
 return the system properties

ACDK_CORE_PUBLIC acdk::util::RProperties getEnvironment ()
 return the system environment

ACDK_CORE_PUBLIC RString getProperty (IN(RString) key)
 return the property value of given key

ACDK_CORE_PUBLIC RString getProperty (IN(RString) key, IN(RString) def)
 return the property value of given key

ACDK_CORE_PUBLIC void setProperties (IN(acdk::util::RProperties) props)
 set the system properties

ACDK_CORE_PUBLIC RString setProperty (IN(RString) key, IN(RString) value)
 set the property value of given key

ACDK_CORE_PUBLIC void setErr (IN(acdk::io::RPrintWriter) newerr)
 set system error writer

ACDK_CORE_PUBLIC void setIn (IN(acdk::io::RInputReader) newin)
 set system input reader

ACDK_CORE_PUBLIC void setOut (IN(acdk::io::RPrintWriter) newout)
 set system standard output writer

ACDK_CORE_PUBLIC RString getModulePath ()
ACDK_CORE_PUBLIC RString getModuleName (bool stripExt=true)
ACDK_CORE_PUBLIC RString getModuleDir ()
ACDK_CORE_PUBLIC RString getAcdkHome ()
 return the path of acdk home evaluates -acdk-home of command line or ACDKHOME or ACDK_HOME of environmnet

ACDK_CORE_PUBLIC RString getAcdkToolsHome ()
 return the path of acdk tools home evaluates -acdk--tools-home of command line or ACDK_TOOLS_HOME of environmnet if not set return the parent-parent directory of the executable (/acdk/bin/myexecutable -> /acdk is ACDK_TOOLS_HOME)

ACDK_CORE_PUBLIC RStringArray getEnvPath ()
 returns the list of directories in the PATH enviromnet variable

ACDK_CORE_PUBLIC RStringArray getAcdkPath ()
 return the path, where to look after shared libraries.

ACDK_CORE_PUBLIC void addAcdkPath (IN(RString) dir)
 add dir at end of path list

ACDK_CORE_PUBLIC void insertAcdkPath (IN(RString) dir)
ACDK_CORE_PUBLIC void printStackTrace (int ignoreFromTop=0)
 Print the current callstack of the current thread.

ACDK_CORE_PUBLIC void printStackTrace (IN(acdk::io::RPrintWriter) out, int ignoreFromTop=0)
 Print the current callstack of the current thread.

ACDK_CORE_PUBLIC void printStackTrace (IN(acdk::io::RPrintWriter) out, IN(RStackFrameArray) stackTrace, int ignoreFromTop=0)
ACDK_CORE_PUBLIC int identityHashCode (IN(RObject) obj)
 return just the address of obj casted to an int

ACDK_CORE_PUBLIC void reinit ()
 re-initialize System In normal case load Config-Files etc.

ACDK_CORE_PUBLIC void registerForInitialization (Initializer *inizializer)
ACDK_CORE_PUBLIC bool isInMain ()
 Checks if current execution frame is valide, which means inside System::main.

ACDK_CORE_PUBLIC bool isInUserMain ()
 return true if currently running inside users main function

ACDK_CORE_PUBLIC bool configurationLoaded ()
 returns true if basic configuration is loaded

ACDK_CORE_PUBLIC bool afterUsersMain ()
 return true if users main function leaved

ACDK_CORE_PUBLIC bool afterMain ()
 return true if Systems main function leaved

ACDK_CORE_PUBLIC int getErrno ()
 return information about last system-error.

ACDK_CORE_PUBLIC void resetErrno ()
 set system errno variable to 0

ACDK_CORE_PUBLIC RString getErrmsg ()
 return last erno message

ACDK_CORE_PUBLIC RString getErrmsg (int errnumber)
 return stringified erno message for a given errnumber

ACDK_CORE_PUBLIC RString getLastError ()
 equal to getErrmsg on unix, GetLastError on windows

ACDK_CORE_PUBLIC RString getSystemCmdLineOps ()
 return the help for command line options parsed by System::main

ACDK_CORE_PUBLIC void loadLibrary (IN(RString) libname)
 load given library

ACDK_CORE_PUBLIC jlong getMaxMemoryUsage ()
 return the overal limit of memory usage

ACDK_CORE_PUBLIC void setMaxMemoryUsage (jlong maxmem)
 limit overall usage of memory.

ACDK_CORE_PUBLIC jlong getThreadMaxMemoryUsage ()
 return the limit of memory usage inside this thread

ACDK_CORE_PUBLIC void setThreadMaxMemoryUsage (jlong maxmem)
 same as setMaxMemoryUsage() but on per thread basis

ACDK_CORE_PUBLIC int getPlatformFlags ()
 returns a combination of PlatformFlags

ACDK_CORE_PUBLIC RObjectArray getRootObjects (bool includeStaticReferences=true)
 return all known Object instances, which are not references as members by other objects.

ACDK_CORE_PUBLIC RObjectArray getObjectList (int flags)

Static Public Attributes

ACDK_CORE_PUBLIC bool _unixMode
ACDK_CORE_PUBLIC bool hasConsole
ACDK_CORE_PUBLIC sys::ObjectHeap::HeapType defaultHeapType
ACDK_CORE_PUBLIC acdk::io::RInputReader in
 The standard character based in reader.

ACDK_CORE_PUBLIC acdk::io::RPrintWriter out
 The standard character base out writer.

ACDK_CORE_PUBLIC acdk::io::RPrintWriter err
 The standard character base error writer.


Static Private Member Functions

void _saveStackBase (unsigned int SP)

Static Private Attributes

ACDK_CORE_PUBLIC RSystemImpl _gSystem
ACDK_CORE_PUBLIC int _argc
ACDK_CORE_PUBLIC char ** _argv

Friends

class SystemImpl


Member Function Documentation

void acdk::lang::System::_saveStackBase unsigned int  SP  )  [static, private]
 

ACDK_CORE_PUBLIC void acdk::lang::System::addAcdkPath IN(RString dir  )  [static]
 

add dir at end of path list

ACDK_CORE_PUBLIC bool acdk::lang::System::afterMain  )  [inline, static]
 

return true if Systems main function leaved

See also:
SystemStatus

ACDK_CORE_PUBLIC bool acdk::lang::System::afterUsersMain  )  [inline, static]
 

return true if users main function leaved

See also:
SystemStatus

template<class T>
template_static void acdk::lang::System::arraycopy const T *  src,
int  srcpos,
IN(RBasicArray< T >)  dst,
int  dstpos,
int  length
[inline]
 

template<class T>
template_static void acdk::lang::System::arraycopy IN(RObjectArrayImpl< T >)  src,
int  srcpos,
IN(RObjectArrayImpl< T >)  dst,
int  dstpos,
int  length
[inline]
 

copy an array

Exceptions:
NullPointerException if one array is nil
ArrayIndexOutOfBoundsException if a index position is invalid

template<class T>
template_static void acdk::lang::System::arraycopy IN(RBasicArray< T >)  src,
int  srcpos,
IN(RBasicArray< T >)  dst,
int  dstpos,
int  length
[inline]
 

copy an array

Exceptions:
NullPointerException if one array is nil
ArrayIndexOutOfBoundsException if a index position is invalid

ACDK_CORE_PUBLIC ::acdk::lang::dmi::ClazzInfo* acdk::lang::System::clazzInfo  )  [static]
 

return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc

Reimplemented from acdk::lang::ObjectBase.

ACDK_CORE_PUBLIC bool acdk::lang::System::configurationLoaded  )  [inline, static]
 

returns true if basic configuration is loaded

See also:
SystemStatus

ACDK_CORE_PUBLIC jlong acdk::lang::System::currentTimeMillis  )  [static]
 

return a counter in milli seconds

ACDK_CORE_PUBLIC void acdk::lang::System::deInitAsSharedLibrary  )  [static]
 

ACDK_CORE_PUBLIC void acdk::lang::System::exit int  status  )  [static]
 

Calls ::exit() after deinitialization of System Normally you should not call this method.

ACDK_CORE_PUBLIC bool acdk::lang::System::gc  )  [static]
 

call the garbage collector

ACDK_CORE_PUBLIC RString acdk::lang::System::getAcdkHome  )  [static]
 

return the path of acdk home evaluates -acdk-home of command line or ACDKHOME or ACDK_HOME of environmnet

ACDK_CORE_PUBLIC RStringArray acdk::lang::System::getAcdkPath  )  [static]
 

return the path, where to look after shared libraries.

See also

ACDK_CORE_PUBLIC RString acdk::lang::System::getAcdkToolsHome  )  [static]
 

return the path of acdk tools home evaluates -acdk--tools-home of command line or ACDK_TOOLS_HOME of environmnet if not set return the parent-parent directory of the executable (/acdk/bin/myexecutable -> /acdk is ACDK_TOOLS_HOME)

ACDK_CORE_PUBLIC RStringArray acdk::lang::System::getArguments  )  [static]
 

return the arguments passed to ACDK application main The internal options, filtered by ACDK or other library used for initialization are not contained in this arguments.

Use getUnfilteredArgs() to receive all arguments

ACDK_CORE_PUBLIC char** acdk::lang::System::getArgv  )  [static]
 

Api: ACDK Returns the argv list given to function int main(int argc, char* argv[], char** envptr).

All acdk specific arguments are removed.

ACDK_CORE_PUBLIC ::acdk::lang::RClass acdk::lang::System::GetClass  )  [static]
 

Reimplemented from acdk::lang::Object.

virtual ACDK_CORE_PUBLIC ::acdk::lang::dmi::ClazzInfo* acdk::lang::System::getClazzInfo  )  [inline, virtual]
 

returns the ClazzInfo of this object instance must not be 0

Implements acdk::lang::dmi::StdDispatch.

virtual ACDK_CORE_PUBLIC void acdk::lang::System::getCollectableFields FieldReferences fields  )  [virtual]
 

retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set.

Reimplemented from acdk::lang::ObjectBase.

ACDK_CORE_PUBLIC acdk::util::RProperties acdk::lang::System::getEnvironment  )  [static]
 

return the system environment

ACDK_CORE_PUBLIC RStringArray acdk::lang::System::getEnvPath  )  [static]
 

returns the list of directories in the PATH enviromnet variable

ACDK_CORE_PUBLIC RString acdk::lang::System::getErrmsg int  errnumber  )  [static]
 

return stringified erno message for a given errnumber

ACDK_CORE_PUBLIC RString acdk::lang::System::getErrmsg  )  [static]
 

return last erno message

ACDK_CORE_PUBLIC int acdk::lang::System::getErrno  )  [static]
 

return information about last system-error.

ACDK_CORE_PUBLIC RString acdk::lang::System::getLastError  )  [static]
 

equal to getErrmsg on unix, GetLastError on windows

ACDK_CORE_PUBLIC jlong acdk::lang::System::getMaxMemoryUsage  )  [static]
 

return the overal limit of memory usage

ACDK_CORE_PUBLIC RString acdk::lang::System::getModuleDir  )  [static]
 

Returns:
the relativ directory of the module

ACDK_CORE_PUBLIC RString acdk::lang::System::getModuleName bool  stripExt = true  )  [static]
 

Returns:
the base name of the executable without extension
Parameters:
stripExt return without .exe suffix on windows

ACDK_CORE_PUBLIC RString acdk::lang::System::getModulePath  )  [static]
 

Returns:
the fully qualified executable name

ACDK_CORE_PUBLIC RObjectArray acdk::lang::System::getObjectList int  flags  )  [static]
 

Parameters:
flags combination of ListObjectsFlags

ACDK_CORE_PUBLIC char** acdk::lang::System::getOriginalArgv  )  [static]
 

Api: ACDK Returns the original argv list given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC int acdk::lang::System::getPlatformFlags  )  [static]
 

returns a combination of PlatformFlags

ACDK_CORE_PUBLIC acdk::util::RProperties acdk::lang::System::getProperties  )  [static]
 

return the system properties

ACDK_CORE_PUBLIC RString acdk::lang::System::getProperty IN(RString key,
IN(RString def
[static]
 

return the property value of given key

See also:
acdk::util::Properties

ACDK_CORE_PUBLIC RString acdk::lang::System::getProperty IN(RString key  )  [static]
 

return the property value of given key

See also:
acdk::util::Properties

ACDK_CORE_PUBLIC RObjectArray acdk::lang::System::getRootObjects bool  includeStaticReferences = true  )  [static]
 

return all known Object instances, which are not references as members by other objects.

unsigned int acdk::lang::System::getStackBase  )  [static]
 

ACDK_CORE_PUBLIC RSystemImpl acdk::lang::System::getSystem  )  [static]
 

ACDK_CORE_PUBLIC RString acdk::lang::System::getSystemCmdLineOps  )  [static]
 

return the help for command line options parsed by System::main

ACDK_CORE_PUBLIC jlong acdk::lang::System::getThreadMaxMemoryUsage  )  [static]
 

return the limit of memory usage inside this thread

ACDK_CORE_PUBLIC RStringArray acdk::lang::System::getUnfilteredArguments  )  [static]
 

return all arguments, including internal options

ACDK_CORE_PUBLIC int acdk::lang::System::identityHashCode IN(RObject obj  )  [static]
 

return just the address of obj casted to an int

ACDK_CORE_PUBLIC void acdk::lang::System::initAsSharedLibrary  )  [static]
 

ACDK_CORE_PUBLIC void acdk::lang::System::insertAcdkPath IN(RString dir  )  [static]
 

ACDK_CORE_PUBLIC bool acdk::lang::System::isInMain  )  [inline, static]
 

Checks if current execution frame is valide, which means inside System::main.

ACDK_CORE_PUBLIC bool acdk::lang::System::isInUserMain  )  [inline, static]
 

return true if currently running inside users main function

See also:
SystemStatus

ACDK_CORE_PUBLIC void acdk::lang::System::loadLibrary IN(RString libname  )  [static]
 

load given library

See also:
acdk::lang::SharedLibrary

ACDK_CORE_PUBLIC int acdk::lang::System::main ACDK_MainFunc  mainfunc,
HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow,
const char **  addargs = 0
[static]
 

ACDK_CORE_PUBLIC int acdk::lang::System::main ACDK_MainFunc  mainfunc,
int  argc,
char *  argv[],
char **  envptr = 0,
const char **  addargs = 0
[static]
 

Wrapper translating c-main to ACDK/Java main.

Use this, before calling any further calls to ACDK, because inside this wrapper some initialisation for the ACDK will be done.

Parameters:
mainfunc Function pointer to function like this:
    class MyClass
    {
    public:
      static int main(RStringArray args);
    };
argc argc given from c-main
argv argv given from c-main
envptr envptr given from c-main or 0
addargs additionally arguments, terminated with 0
Returns:
exit status of the process

ACDK_CORE_PUBLIC int acdk::lang::System::main2 ACDK_MainFunc  mainfunc,
int  argc,
char *  argv[],
char **  envptr,
const char **  addargs
[static]
 

do the real work

ACDK_CORE_PUBLIC acdk::lang::System::OUT int   )  [static]
 

Api: ACDK Returns the original argc value given to function int main(int argc, char* argv[], char** envptr).

ACDK_CORE_PUBLIC acdk::lang::System::OUT int   )  [static]
 

Api: ACDK Returns the argc value given to function int main(int argc, char* argv[], char** envptr).

All acdk specific arguments are removed.

ACDK_CORE_PUBLIC acdk::lang::System::OUT int   )  [static]
 

return a combination of SystemStatus flags

ACDK_CORE_PUBLIC void acdk::lang::System::printStackTrace IN(acdk::io::RPrintWriter out,
IN(RStackFrameArray stackTrace,
int  ignoreFromTop = 0
[static]
 

ACDK_CORE_PUBLIC void acdk::lang::System::printStackTrace IN(acdk::io::RPrintWriter out,
int  ignoreFromTop = 0
[static]
 

Print the current callstack of the current thread.

ACDK_CORE_PUBLIC void acdk::lang::System::printStackTrace int  ignoreFromTop = 0  )  [static]
 

Print the current callstack of the current thread.

ACDK_CORE_PUBLIC void acdk::lang::System::registerForInitialization Initializer inizializer  )  [static]
 

ACDK_CORE_PUBLIC void acdk::lang::System::registerStaticReference Object obj  )  [static]
 

template<class T>
template_static const InterfaceHolder<T>& acdk::lang::System::registerStaticReference InterfaceHolder< T > &  obj  )  [inline]
 

template<class T>
template_static const RefHolder<T>& acdk::lang::System::registerStaticReference RefHolder< T > &  obj  )  [inline]
 

ACDK_CORE_PUBLIC void acdk::lang::System::reinit  )  [static]
 

re-initialize System In normal case load Config-Files etc.

API: ACDK

ACDK_CORE_PUBLIC void acdk::lang::System::resetErrno  )  [static]
 

set system errno variable to 0

ACDK_CORE_PUBLIC void acdk::lang::System::setErr IN(acdk::io::RPrintWriter newerr  )  [static]
 

set system error writer

ACDK_CORE_PUBLIC void acdk::lang::System::setIn IN(acdk::io::RInputReader newin  )  [static]
 

set system input reader

ACDK_CORE_PUBLIC void acdk::lang::System::setMaxMemoryUsage jlong  maxmem  )  [static]
 

limit overall usage of memory.

If maximum memory is consumed in this process, ACDK try call the garbage collector. If after garbage collection still not enough (below given value) memory is available a OutOfMemoryException will be thrown.

ACDK_CORE_PUBLIC void acdk::lang::System::setOut IN(acdk::io::RPrintWriter newout  )  [static]
 

set system standard output writer

ACDK_CORE_PUBLIC void acdk::lang::System::setProperties IN(acdk::util::RProperties props  )  [static]
 

set the system properties

See also:
acdk::util::Properties

ACDK_CORE_PUBLIC RString acdk::lang::System::setProperty IN(RString key,
IN(RString value
[static]
 

set the property value of given key

See also:
acdk::util::Properties

ACDK_CORE_PUBLIC void acdk::lang::System::setThreadMaxMemoryUsage jlong  maxmem  )  [static]
 

same as setMaxMemoryUsage() but on per thread basis


Friends And Related Function Documentation

friend class SystemImpl [friend]
 


Member Data Documentation

ACDK_CORE_PUBLIC int acdk::lang::System::_argc [static, private]
 

ACDK_CORE_PUBLIC char** acdk::lang::System::_argv [static, private]
 

ACDK_CORE_PUBLIC RSystemImpl acdk::lang::System::_gSystem [static, private]
 

ACDK_CORE_PUBLIC bool acdk::lang::System::_unixMode [static]
 

ACDK_CORE_PUBLIC sys::ObjectHeap::HeapType acdk::lang::System::defaultHeapType [static]
 

ACDK_CORE_PUBLIC acdk::io::RPrintWriter acdk::lang::System::err [static]
 

The standard character base error writer.

ACDK_CORE_PUBLIC bool acdk::lang::System::hasConsole [static]
 

ACDK_CORE_PUBLIC acdk::io::RInputReader acdk::lang::System::in [static]
 

The standard character based in reader.

ACDK_CORE_PUBLIC acdk::io::RPrintWriter acdk::lang::System::out [static]
 

The standard character base out writer.