63
These methods are similar to getPropAsInt, etc., except that they can
interpret the objects representing pointers to
CNKBuf and CNKProc
objects. For
getPropAsCNKBuf/getPropAsCNKProc, if the argument is
not a valid
CNKBuf/CNKProc, they return NULL.
CNKPropertyInfo::
virtual CNKPropertyInfo* getNextProp();
Some code will store a series of properties in an array or linked list.
When this is the case,
getNextProp() can be used to get the next
property in the list.
CNKPropertyInfo::
void* getPropAsObject();
virtual void* getPropAsObjectEnv();
const char* getPropAsObjectType();
void setPropAsObject(void* object);
These methods can be used to set and get a C pointer to some
unknown object. With Java, this would be a Java JNI object.They are
passed as
void* pointers, and the calling C code must be able to cast
these pointers and interpret them correctly.
getPropAsObjectType()
returns a string specifying the particular type of object system that the
properties come from: in the case of Java, this would be the string
"java". Other systems such as Spotfire S+ that may communicate
with this library may pass other types of objects.
getPropAsObjectEnv() returns an environment variable associated
with the object, if the system has such a variable. In Java, this would
be a
JNIEnv object.
CNKPropertyInfo::
void setPropToUnknownPropertyFlag();
This method sets the argument value to a special value that can be
used to detect that a property name has not been found. This is called
in
CNKObj::setProperty and CNKObj::getProperty when none of the
properties match.
The normal way to implement
setProperty is with code such as the
following:
void CNKProcRandomReader::setProperty(
CNKPropertyInfo* propInfo) {
Comentários a estes Manuais