35
* DLL
*/
public void createPeerObject() {
createCNKObject("cnkcopy", new String[] {
"CNKProcCppSecondCopy", "CNKProc", "CNKObj" });
}
}
C++ CNKProc Now that we’ve written the necessary Java code for our second
implementation, it’s time to construct the C++ code that does the
actual computation. We’ll need a C++ header file and
implementation.
Header File
The CNKProcCppSecondCopy.h file will contain:
#if !defined(CNKProcCppSecondCopy_INCLUDED_)
#define CNKProcCppSecondCopy_INCLUDED_
#include "CNKObj.h"
#include "CNKBuf.h"
#include "CNKBufReader.h"
#include "CNKProc.h"
class CNKProcCppSecondCopy : public CNKProc
{
public:
CNKProcCppSecondCopy();
virtual ~CNKProcCppSecondCopy();
virtual void init();
virtual void execute();
};
#endif // !defined(CNKProcCppSecondCopy_INCLUDED_)
If we had any property information to exchange with Java, we would
also declare and implement
setProperty() and getProperty().
Implementation
The CNKProcCppSecondCopy.cpp file will contain:
Comentarios a estos manuales