27
An example execute() method is in the section Simple Java Version
on page 28.
C++ Procs If the computation is to be performed in C++, the CNKProc class will
be a simple class extending
CNKProc with information on what C++
class to use. This information is specified in the
createPeerObject()
method.
public void createPeerObject() {
createCNKObject(“cnkmisc”,
new String[] { "CNKProcKMeans", "CNKProc",
"CNKObj" });
}
The section The TIBCO Spotfire Pipeline on page 50 discusses the
C++ pipeline classes including the C++
CNKProc class that will be
extended to perform the computations in C++. An example using
C++ is available in the section Simple C++ Version on page 32.
C++ Tips Here are some useful tips regarding the computational code
requirements.
• When creating a Java node calling a C++, the
createPeerObject() method is the key Java method. This
specifies the peer C++ class, and which shared object library
to load.
• When creating a C++ proc, the key methods are the
constructor, destructor,
init(), execute(), setProperty(),
and
getProperty().
• In a C++ proc, be sure to call the super-class
init() method
from the
init() method in your child class.
• In a C++ proc, be sure to set and get the properties using
consistent types. If you set a property as one type and get it as
another, the result will be incorrect.
• In a C++ proc, be sure to include the
CNK_DEFINE_ACCESSIBLE_CLASS macro at the top of your code.
This is necessary for the C++ CNKProc object to be created.
Comentarios a estos manuales