#include <pie/PieSystem.h>
Public Types | |
| enum | _AllocationType { _kClearMemory } |
| This type is for private internal use only. | |
Public Member Functions | |
| static::java::lang::ObjectR * | getObjectArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified Object array. | |
| static::java::lang::StringR | createString (const::java::lang::ObjectR &value1, const::java::lang::ObjectR &value2) |
| Create new string made up of string representations of value1 followed by string representations of value2. | |
| static::java::lang::ThreadR | getMainThread () |
| Answer main thread object. | |
| static::java::lang::ThreadGroupR | getTopLevelThreadGroup () |
| Answer top-level thread group. | |
| static::java::lang::ClassR | createClass (const std::type_info &rttiTypeInfo) |
| Create Class object for specified run-time type info (RTTI). | |
| static::java::lang::ClassR | getClass (::java::lang::StringR className) |
| Answer class object of specified class name. | |
Static Public Member Functions | |
| pi_native bool | initialize (pi_int majorVersion, pi_int minorVersion) |
| Initialize the Pie Run-time Library. | |
| pi_native bool | isInitialized () |
| Answer true if Pie Run-time Library has been succesfully initialized. | |
| pi_native void | handleEvents () |
| Handle events. | |
| pi_native void | terminate () |
| Terminate usage of the Pie Run-time Library. | |
| pi_byte * | getByteArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified byte array. | |
| pi_char * | getCharArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified char array. | |
| pi_short * | getShortArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified short array. | |
| pi_int * | getIntArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified char array. | |
| pi_long * | getLongArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified long array. | |
| pi_float * | getFloatArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified float array. | |
| pi_double * | getDoubleArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified double array. | |
| bool * | getBooleanArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified boolean array. | |
| PieInterfaceReference< void > * | getInterfaceArrayElements (const PieArrayBase *arrayBase) |
| Answer generic pointer to array elements of specified interface array. | |
| void * | getArrayElements (const PieArrayBase *arrayBase) |
| Answer pointer to array elements of specified array. | |
| PieArrayBase::_ArrayType | getArrayType (const PieArrayBase *arrayBase) |
| Answer type of specified array. | |
| java::lang::StringR | toString (const pi_byte *text) |
| Convert null-terminated single-byte/multi-byte character string to String object. | |
| java::lang::StringR | toString (const pi_byte *text, pi_int length) |
| Convert character array in platform-specific default character encoding to String object. | |
| pi_byteAR | convertUnicodeToByteString (const pi_char *text) |
| Convert null-terminated Unicode character array to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. | |
| pi_native pi_byteAR | convertUnicodeToByteString (const pi_char *text, pi_int length) |
| Convert Unicode character array, which may or may not be null-terminated, to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. | |
| pi_native pi_byteAR | convertUnicodeToBytes (const pi_char *unicodeText) |
| Convert null-terminated Unicode character array to single-byte/multi-byte character array, which is not null-terminated, encoded in platform-specific default character encoding. | |
| pi_native pi_byteAR | convertUnicodeToBytes (const pi_char *unicodeText, pi_int length) |
| Convert Unicode character array, which may or may not be null-terminated, to single-byte/multi-byte character array, which is not null-terminated, encoded in platform-specific default character encoding. | |
| pi_byteAR | toByteString (::java::lang::StringR text) |
| Convert String object to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. | |
| pi_byteAR | toByteString (::java::lang::StringR text, pi_int length) |
| Convert String object to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. | |
| const pi_char * | getCString (pi_const java::lang::String *string) |
| Answer null-terminated C-language string, like STL basic_string::c_str(), for specified String object. | |
| java::lang::StringR | createString (pi_const java::lang::String *string1, pi_const java::lang::String *string2) |
| Create new string which is made up of string1 followed by string2. | |
| java::lang::StringR | createString (pi_const java::lang::String *string1, pi_char character) |
| Create new string which is made up of string1 followed by specified character. | |
| java::lang::StringR | createString (pi_char character, pi_const java::lang::String *string2) |
| Create new string which is made up of specified character followed by string2. | |
| java::lang::StringR | createString (pi_const java::lang::String *string1, pi_int value) |
| Create new string which is made up of string1 followed by specified integer value represented as string. | |
| java::lang::StringR | createString (pi_int value, pi_const java::lang::String *string2) |
| Create new string which is made up of specified integer value represented as string followed by string2. | |
| java::lang::StringR | createString (pi_const java::lang::String *string1, pi_long value) |
| Create new string which is made up of string1 followed by specified long integer value represented as string. | |
| java::lang::StringR | createString (pi_long value, pi_const java::lang::String *string2) |
| Create new string which is made up of specified long integer value represented as string followed by string2. | |
| java::lang::StringR | createString (pi_const java::lang::String *string1, pi_double value) |
| Create new string which is made up of string1 followed by specified double value represented as string. | |
| java::lang::StringR | createString (pi_double value, pi_const java::lang::String *string2) |
| Create new string which is made up of specified double value represented as string followed by string2. | |
| java::lang::StringR | createStringUsingLiteral (const pi_char *text) |
| Create specified string using string literal that does not contain any Unicode escape sequences. | |
| java::lang::StringR | createStringUsingLiteralEscape (const pi_char *text, pi_int length) |
| Create specified string using string literal, which may contain Unicode escape sequences. | |
| java::lang::StringR | createString (const pi_char *text) |
| Create string from specified null-terminated Unicode character string. | |
| java::lang::StringR | createString (const pi_char *text, pi_int length) |
| Create string from specified Unicode character array and specified length. | |
| java::lang::StringR | createStringWithAdoption (pi_char *text) |
| Create string by adopting specified text data. | |
| java::lang::StringR | createStringWithAdoption (pi_char *text, pi_int length) |
| Create specified by adopting specified text data. | |
| void | attachMainThread (void *nativeThread) |
| Attach specified native thread as main thread. | |
| void | registerClass (const wchar_t classNameString[],::java::lang::ObjectR(*classNewInstance)(), bool(*classIsInstance)(::java::lang::ObjectR), bool isInterface_=false, bool isPrimitive_=false, bool isArray_=false) |
| Register class. | |
| void | registerClass (::java::lang::ClassR classObject) |
| Register class. | |
| void | registerMainClass (const wchar_t classNameString[],::java::lang::ObjectR(*classNewInstance)(), bool(*classIsInstance)(::java::lang::ObjectR), void(*classMainMethod)(java::lang::StringAR), bool isInterface_=false, bool isPrimitive_=false, bool isArray_=false) |
| Register main class. | |
| void | registerMainClass (::java::lang::ClassR classObject) |
| Register main class. | |
| void * | getClassMainMethod (java::lang::StringR className) |
| Answer address of static main method of specified class. | |
| void | unmanageObject (java::lang::Object *object) |
| Unmanage specified object. | |
| void | throwNullPointerException () |
| Throw (reference to) exception that indicates invalid use of null pointer. | |
| java::io::FileDescriptorR | createFileDescriptor (java::lang::ObjectR impl) |
| This method is for private internal use only. | |
PieSystem class is primarily intended for applications which use other C/C++ libraries and APIs along with the Pie Run-time Library. These libraries may include the ANSI C++ Standard Library, especially STL. On the Windows platform, these may also include the Win32 API or MFC.
For applications which only use the Pie Run-time Library and its constructs, it should not be necessary to use this class or its methods directly. For example, initialization and termination is automatically taken care of by starters. (See "pie/x-startup" directory.) In addition, many methods are provided indirectly through Pie macros, which are preferred to using PieSystem methods directly. For example, creating String objects from string literals should be accomplished using the PI_T() macro instead of a PieSystem method.
Important: Any methods, including public methods, which are marked "for private internal use only" should not be used directly. They are provided for supporting public Pie macros and other library constructs, which in turn use such methods indirectly.
Important Note About Thread-safety: All methods which take pointers do not and cannot guarantee that the objects or storage that they are dereferencing will remain alive during the operation that is being performed. In order to guarantee that these operations are threadsafe, you must make sure that at least one reference to the object or storage is being maintained locally. For example,
// Say that m_text is a static String field, which may be reassigned
// externally by another thread. To make sure that the low-level
// pointer to character data in m_text can be safely accessed, do the
// following.
// 1. Maintain a local reference to m_text.
// Now even if m_text is reassigned you still have a valid copy of it.
StringR localString = m_text;
// 2. Dereference the local reference not the static one
const pi_char* stringPtr = pie::PieSystem::getCString(*localString);
// 3. Use stringPtr as you wish
int count = wcslen(stringPtr);
// Note that stringPtr will be valid until localString goes out of
// scope even if m_text is reassigned by another thread.
|
|
Attach specified native thread as main thread. Note: This also creates top-level thread group and adds specified (native) thread as its child. This method is for private internal use only.
|
|
||||||||||||
|
Convert Unicode character array, which may or may not be null-terminated, to single-byte/multi-byte character array, which is not null-terminated, encoded in platform-specific default character encoding.
|
|
|
Convert null-terminated Unicode character array to single-byte/multi-byte character array, which is not null-terminated, encoded in platform-specific default character encoding.
|
|
||||||||||||
|
Convert Unicode character array, which may or may not be null-terminated, to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding.
|
|
|
Convert null-terminated Unicode character array to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. This method, when used in conjunction with getByteArrayElements(), is ideal for providing constant null-terminated byte strings to methods in other C/C++ libraries and APIs. Here is an example using strlen() in the ANSI C++ Standard Library:
|
|
|
Create Class object for specified run-time type info (RTTI). This method is for private internal use only. Object getClass() should be used instead. To register the class, use PIE_DECLARE_CLASS and PIE_DEFINE_CLASS instead.
|
|
|
This method is for private internal use only.
|
|
||||||||||||
|
Create new string made up of string representations of value1 followed by string representations of value2. Note: This method is used for implementing using operator+ on two objects. This method is for private internal use only. You should use the following form instead of this method: value1 + value2
|
|
||||||||||||
|
Create string from specified Unicode character array and specified length.
|
|
|
Create string from specified null-terminated Unicode character string. If text is a string literal, createStringUsingLiteral() or createStringUsingLiteralEscape() should be used instead.
|
|
||||||||||||
|
Create new string which is made up of specified double value represented as string followed by string2. This method is for private internal use only. You should use the following form instead of this method: value + string2
|
|
||||||||||||
|
Create new string which is made up of string1 followed by specified double value represented as string. This method is for private internal use only. You should use the following form instead of this method: string1 + value
|
|
||||||||||||
|
Create new string which is made up of specified long integer value represented as string followed by string2. This method is for private internal use only. You should use the following form instead of this method: value + string2
|
|
||||||||||||
|
Create new string which is made up of string1 followed by specified long integer value represented as string. This method is for private internal use only. You should use the following form instead of this method: string1 + value
|
|
||||||||||||
|
Create new string which is made up of specified integer value represented as string followed by string2. This method is for private internal use only. You should use the following form instead of this method: value + string2
|
|
||||||||||||
|
Create new string which is made up of string1 followed by specified integer value represented as string. This method is for private internal use only. You should use the following form instead of this method: string1 + value
|
|
||||||||||||
|
Create new string which is made up of specified character followed by string2. This method is for private internal use only. You should use the following form instead of this method: character + string2
|
|
||||||||||||
|
Create new string which is made up of string1 followed by specified character. This method is for private internal use only. You should use the following form instead of this method: string1 + character
|
|
||||||||||||
|
Create new string which is made up of string1 followed by string2. This method is for private internal use only. You should use the following form instead of this method: string1 + string2
|
|
|
Create specified string using string literal that does not contain any Unicode escape sequences. This method is for private internal use only. PI_T() macro should be used instead of this method, as in: PI_T("some literal text")
|
|
||||||||||||
|
Create specified string using string literal, which may contain Unicode escape sequences. Note: If the Unicode escape sequence is invalid, this will be indicated by the leading null being changed to a '\' in the new string returned. In the debug version, this will also trigger an assertion condition. This method is for private internal use only. PI_TE() macro should be used instead of this method, as in: PI_TE("some\\u0020literal text")
|
|
||||||||||||
|
Create specified by adopting specified text data.
|
|
|
Create string by adopting specified text data.
|
|
|
Answer pointer to array elements of specified array. This method is for private internal use only. You should use the appropriate get..ArrayElements() method instead.
|
|
|
Answer type of specified array. This method is for private internal use only.
|
|
|
Answer pointer to array elements of specified boolean array.
|
|
|
Answer pointer to array elements of specified byte array.
|
|
|
Answer pointer to array elements of specified char array.
|
|
|
Answer class object of specified class name. This method is for private internal use only. Class forName() should be used instead.
|
|
|
Answer address of static main method of specified class. This method is for private internal use only.
|
|
|
Answer null-terminated C-language string, like STL basic_string::c_str(), for specified String object.
|
|
|
Answer pointer to array elements of specified double array.
|
|
|
Answer pointer to array elements of specified float array.
|
|
|
Answer pointer to array elements of specified char array.
|
|
|
Answer generic pointer to array elements of specified interface array.
|
|
|
Answer pointer to array elements of specified long array.
|
|
|
Answer main thread object. This method is for private internal use only.
|
|
|
Answer pointer to array elements of specified Object array.
|
|
|
Answer pointer to array elements of specified short array.
|
|
|
Answer top-level thread group. This method is for private internal use only.
|
|
|
Handle events. On the Windows platform, this is the main message loop. |
|
||||||||||||
|
Initialize the Pie Run-time Library. Note: This must be done once in each program which uses the Pie Run-time Library. This is taken care of automatically by applications that use starters. (See "pie/x-startup" directory.)
|
|
|
Answer true if Pie Run-time Library has been succesfully initialized.
|
|
|
Register class. This method is for private internal use only. PIE_DECLARE_CLASS and PIE_DEFINE_CLASS should be used instead. A given class name may only be registered for one class and it may only be registered once for that class.
|
|
||||||||||||||||||||||||||||
|
Register class. This method is for private internal use only. PIE_DECLARE_CLASS and PIE_DEFINE_CLASS should be used instead. A given class name may only be registered for one class and it may only be registered once for that class.
|
|
|
Register main class. This method is for private internal use only. PIE_DECLARE_MAIN_CLASS and PIE_DEFINE_MAIN_CLASS should be used instead. A given class name may only be registered for one class and it may only be registered once for that class.
|
|
||||||||||||||||||||||||||||||||
|
Register main class. This method is for private internal use only. PIE_DECLARE_MAIN_CLASS and PIE_DEFINE_MAIN_CLASS should be used instead. A given class name may only be registered for one class and it may only be registered once for that class.
|
|
|
Terminate usage of the Pie Run-time Library. Note: This should be done once in each program which uses the Pie Run-time Library. This is taken care of automatically by applications that use starters. (See "pie/x-startup" directory.) |
|
|
Throw (reference to) exception that indicates invalid use of null pointer. This method is for private internal use only. Instead of using this method, you should throw (reference to) NullPointerException itself.
|
|
||||||||||||
|
Convert String object to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. This method, when used in conjunction with getByteArrayElements(), is ideal for providing constant null-terminated byte strings to methods in other C/C++ libraries and APIs. Here is an example using strlen() in the ANSI C++ Standard Library:
|
|
|
Convert String object to null-terminated single-byte/multi-byte character array, which is also known as a byte string, encoded in platform-specific default character encoding. This method, when used in conjunction with getByteArrayElements(), is ideal for providing constant null-terminated byte strings to methods in other C/C++ libraries and APIs. Here is an example using strlen() in the ANSI C++ Standard Library:
|
|
||||||||||||
|
Convert character array in platform-specific default character encoding to String object.
|
|
|
Convert null-terminated single-byte/multi-byte character string to String object.
|
|
|
Unmanage specified object. This will prevent object from ever being deleted. This must be done for static and stack based objects which are not created using new operator. This method is for private internal use only.
|
1.3.3