Main Page | Compound List | Compound Members

pie::PieSystem Class Reference

Provides support for interoperability with other C/C++ libraries and APIs. More...

#include <pie/PieSystem.h>

List of all members.

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.


Detailed Description

Provides support for interoperability with other C/C++ libraries and APIs.

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.


Member Function Documentation

void pie::PieSystem::attachMainThread void *  nativeThread  )  [static]
 

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.

Parameters:
nativeThread Native thread

pi_native pi_byteAR pie::PieSystem::convertUnicodeToBytes const pi_char *  unicodeText,
pi_int  length
[static]
 

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.

Parameters:
unicodeText Unicode character array
length Length of Unicode character array
Returns:
Byte array of characters in platform-specific default character encoding, which is not null-terminated.

pi_native pi_byteAR pie::PieSystem::convertUnicodeToBytes const pi_char *  unicodeText  )  [static]
 

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.

Parameters:
unicodeText Unicode character array, null-terminated
Returns:
Byte array of characters in platform-specific default character encoding, which is not null-terminated.

pi_native pi_byteAR pie::PieSystem::convertUnicodeToByteString const pi_char *  text,
pi_int  length
[static]
 

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.

Parameters:
text Unicode character array, which need not be null-terminated
length Length of Unicode character array
Returns:
Null-terminated single-byte/multi-byte character array

pi_byteAR pie::PieSystem::convertUnicodeToByteString const pi_char *  text  )  [static]
 

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:

// Note: This example assumes that sizeof(wchar_t) ==
// sizeof(pi_char) and sizeof(char) == sizeof(pi_byte).

pi_byteAR byteString = pie::PieSystem::convertUnicodeToByteString(L"Simple string");

pi_byte* byteStringPtr = pie::PieSystem::getByteArrayElements(*byteString);

int count = strlen(byteStringPtr);

Parameters:
text Null-terminated Unicode character array
Returns:
Null-terminated single-byte/multi-byte character array

static ::java::lang::ClassR pie::PieSystem::createClass const std::type_info &  rttiTypeInfo  ) 
 

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.

Parameters:
rttiTypeInfo Run-time type info (RTTI)
Returns:
Class object for specified run-time type info (RTTI)

java::io::FileDescriptorR pie::PieSystem::createFileDescriptor java::lang::ObjectR  impl  )  [static]
 

This method is for private internal use only.

Parameters:
impl Platform-specific implementation object

static ::java::lang::StringR pie::PieSystem::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.

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

Parameters:
value1 First object. May be a null reference. If null, "null" is used as string representation.
value2 Second object. May be a null reference. If null, "null" is used as string representation.
Returns:
New string object

java::lang::StringR pie::PieSystem::createString const pi_char *  text,
pi_int  length
[static]
 

Create string from specified Unicode character array and specified length.

Parameters:
text Unicode character array, which need not be null-terminated
length Length of character array in characters not bytes
Returns:
New string

java::lang::StringR pie::PieSystem::createString const pi_char *  text  )  [static]
 

Create string from specified null-terminated Unicode character string.

If text is a string literal, createStringUsingLiteral() or createStringUsingLiteralEscape() should be used instead.

Parameters:
text Null-terminated Unicode character string
Returns:
New string

java::lang::StringR pie::PieSystem::createString pi_double  value,
pi_const java::lang::String *  string2
[static]
 

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

Parameters:
value Double value
string2 String
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_const java::lang::String *  string1,
pi_double  value
[static]
 

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

Parameters:
string1 String
value Double value
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_long  value,
pi_const java::lang::String *  string2
[static]
 

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

Parameters:
value Long integer value
string2 String
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_const java::lang::String *  string1,
pi_long  value
[static]
 

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

Parameters:
string1 String
value Long integer value
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_int  value,
pi_const java::lang::String *  string2
[static]
 

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

Parameters:
value Integer value
string2 String
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_const java::lang::String *  string1,
pi_int  value
[static]
 

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

Parameters:
string1 String
value Integer value
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_char  character,
pi_const java::lang::String *  string2
[static]
 

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

Parameters:
character Character
string2 String
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_const java::lang::String *  string1,
pi_char  character
[static]
 

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

Parameters:
string1 String
character Character
Returns:
new string

java::lang::StringR pie::PieSystem::createString pi_const java::lang::String *  string1,
pi_const java::lang::String *  string2
[static]
 

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

Parameters:
string1 First string
string2 Second string
Returns:
new string

java::lang::StringR pie::PieSystem::createStringUsingLiteral const pi_char *  text  )  [static]
 

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")

Parameters:
text Text, which must be a string literal. Note: String literals are always null-terminated.
Returns:
New string

java::lang::StringR pie::PieSystem::createStringUsingLiteralEscape const pi_char *  text,
pi_int  length
[static]
 

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")

Parameters:
text Text, which must be a string literal. Note: String literals are always null-terminated, such that text[length] equals null terminator. Embedded Unicode escape sequences take the form "\\uHHHH" instead of "\uHHHH" as in the Java language. Due to this form of Unicode escape sequences in Pie Library, the normal "\\u" sequence must be encoded as "\\\\u".
length Length of Unicode character array, which must be the actual length of the string literal and one less than the sizeof the literal.
Returns:
New string

java::lang::StringR pie::PieSystem::createStringWithAdoption pi_char *  text,
pi_int  length
[static]
 

Create specified by adopting specified text data.

Parameters:
text Unicode character string, which must be null-terminated such that text[length] equals null terminator.
Note: Text data must be allocated using C++ new operator.
length Length of text in characters not bytes
Returns:
New string

java::lang::StringR pie::PieSystem::createStringWithAdoption pi_char *  text  )  [static]
 

Create string by adopting specified text data.

Parameters:
text Null-terminated Unicode character string.
Note: Text data must be allocated using C++ new operator.
Returns:
New string

void* pie::PieSystem::getArrayElements const PieArrayBase *  arrayBase  )  [static]
 

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.

Parameters:
arrayBase Array base
Returns:
pointer to array elements

PieArrayBase::_ArrayType pie::PieSystem::getArrayType const PieArrayBase *  arrayBase  )  [static]
 

Answer type of specified array.

This method is for private internal use only.

Parameters:
arrayBase Array base
Returns:
array type

bool* pie::PieSystem::getBooleanArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified boolean array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of boolean array

pi_byte* pie::PieSystem::getByteArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified byte array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of byte array

pi_char* pie::PieSystem::getCharArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified char array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of char array

static ::java::lang::ClassR pie::PieSystem::getClass ::java::lang::StringR  className  ) 
 

Answer class object of specified class name.

This method is for private internal use only. Class forName() should be used instead.

Parameters:
className Class name
Returns:
class object of specified class name

void* pie::PieSystem::getClassMainMethod java::lang::StringR  className  )  [static]
 

Answer address of static main method of specified class.

This method is for private internal use only.

Parameters:
className Class name
Returns:
address of static main method of specified class

const pi_char* pie::PieSystem::getCString pi_const java::lang::String *  string  )  [static]
 

Answer null-terminated C-language string, like STL basic_string::c_str(), for specified String object.

Parameters:
string String object.
Note: This is declared as a pointer to prevent reference count from being unnecessarily incremented and decremented.
Returns:
Pointer to constant null-terminated pi_char C-language string array.

pi_double* pie::PieSystem::getDoubleArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified double array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of double array

pi_float* pie::PieSystem::getFloatArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified float array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of float array

pi_int* pie::PieSystem::getIntArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified char array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of char array

PieInterfaceReference< void >* pie::PieSystem::getInterfaceArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer generic pointer to array elements of specified interface array.

Parameters:
arrayBase Array base
Returns:
generic pointer to elements of Object array

pi_long* pie::PieSystem::getLongArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified long array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of long array

static ::java::lang::ThreadR pie::PieSystem::getMainThread  ) 
 

Answer main thread object.

This method is for private internal use only.

Returns:
main thread object

static ::java::lang::ObjectR* pie::PieSystem::getObjectArrayElements const PieArrayBase *  arrayBase  ) 
 

Answer pointer to array elements of specified Object array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of Object array

pi_short* pie::PieSystem::getShortArrayElements const PieArrayBase *  arrayBase  )  [static]
 

Answer pointer to array elements of specified short array.

Parameters:
arrayBase Array base
Returns:
pointer to elements of short array

static ::java::lang::ThreadGroupR pie::PieSystem::getTopLevelThreadGroup  ) 
 

Answer top-level thread group.

This method is for private internal use only.

Returns:
top-level thread group

pi_native void pie::PieSystem::handleEvents  )  [static]
 

Handle events.

On the Windows platform, this is the main message loop.

pi_native bool pie::PieSystem::initialize pi_int  majorVersion,
pi_int  minorVersion
[static]
 

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.)

Parameters:
majorVersion Reserved, must be 0.
minorVersion Reserved, must be 0.
Returns:
true indicates that Pie Run-time Library initialized successfully, otherwise false

pi_native bool pie::PieSystem::isInitialized  )  [static]
 

Answer true if Pie Run-time Library has been succesfully initialized.

Returns:
true indicates that Pie Run-time Library initialized successfully, otherwise false

void pie::PieSystem::registerClass ::java::lang::ClassR  classObject  )  [static]
 

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.

Parameters:
classObject Class object

void pie::PieSystem::registerClass const wchar_t  classNameString[],
::java::lang::ObjectR(*  classNewInstance)(),
bool(*  classIsInstance)(::java::lang::ObjectR),
bool  isInterface_ = false,
bool  isPrimitive_ = false,
bool  isArray_ = false
[static]
 

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.

Parameters:
classNameString Class name string
classNewInstance Address of static method to create new instance
classIsInstance Address of static method to test if argument is an instance of this class
isInterface_ true indicates this class is an interface, otherwise false (default)
isPrimitive_ true indicates this class is a primitive, otherwise false (default)
isArray_ true indicates this class is an array, otherwise false (default)

void pie::PieSystem::registerMainClass ::java::lang::ClassR  classObject  )  [static]
 

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.

Parameters:
classObject Class object

void pie::PieSystem::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
[static]
 

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.

Parameters:
classNameString Class name string
classNewInstance Address of static method to create new instance
classIsInstance Address of static method to test if argument is an instance of this class
classMainMethod Address of static main method
isInterface_ true indicates this class is an interface, otherwise false (default)
isPrimitive_ true indicates this class is a primitive, otherwise false (default)
isArray_ true indicates this class is an array, otherwise false (default)

pi_native void pie::PieSystem::terminate  )  [static]
 

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.)

void pie::PieSystem::throwNullPointerException  )  [static]
 

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.

Exceptions:
NullPointerException 

pi_byteAR pie::PieSystem::toByteString ::java::lang::StringR  text,
pi_int  length
[static]
 

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:

// Note: This example assumes that sizeof(wchar_t) ==
// sizeof(pi_char) and sizeof(char) == sizeof(pi_byte).

StringR simpleString = PI_T("Simple string");

pi_byteAR byteString = pie::PieSystem::toByteString(simpleString);

pi_byte* byteStringPtr = pie::PieSystem::getByteArrayElements(*byteString);

int count = strlen(byteStringPtr);

Parameters:
text String object
length Number of characters in String object to convert
Returns:
Null-terminated single-byte/multi-byte character array

pi_byteAR pie::PieSystem::toByteString ::java::lang::StringR  text  )  [static]
 

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:

// Note: This example assumes that sizeof(wchar_t) ==
// sizeof(pi_char) and sizeof(char) == sizeof(pi_byte).

StringR simpleString = PI_T("Simple string");

pi_byteAR byteString = pie::PieSystem::toByteString(simpleString);

pi_byte* byteStringPtr = pie::PieSystem::getByteArrayElements(*byteString);

int count = strlen(byteStringPtr);

Parameters:
text String object
Returns:
Null-terminated single-byte/multi-byte character array

java::lang::StringR pie::PieSystem::toString const pi_byte *  text,
pi_int  length
[static]
 

Convert character array in platform-specific default character encoding to String object.

Parameters:
text Character array, which need not be null-terminated
length Length of character array
Returns:
String object

java::lang::StringR pie::PieSystem::toString const pi_byte *  text  )  [static]
 

Convert null-terminated single-byte/multi-byte character string to String object.

Parameters:
text Null-terminated single-byte/multi-byte character string
Returns:
String object

void pie::PieSystem::unmanageObject java::lang::Object *  object  )  [static]
 

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.

Parameters:
object Object to unmanage.


The documentation for this class was generated from the following file:
Generated on Sun Aug 24 22:55:11 2003 for Pie Run-time Library by doxygen 1.3.3