Added a new Examples folder with modified Examples/java files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4f2a579d6d
commit
311ddbc2bf
78 changed files with 3668 additions and 0 deletions
24
Examples/doxygencomments/java/callback/example.h
Normal file
24
Examples/doxygencomments/java/callback/example.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* File : example.h */
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
/** Let's document class CALLBACK! */
|
||||
class Callback {
|
||||
public:
|
||||
virtual ~Callback() { std::cout << "Callback::~Callback()" << std:: endl; }
|
||||
virtual void run() { std::cout << "Callback::run()" << std::endl; }
|
||||
};
|
||||
|
||||
/** Let's document class Caller! */
|
||||
class Caller {
|
||||
private:
|
||||
Callback *_callback;
|
||||
public:
|
||||
Caller(): _callback(0) {}
|
||||
~Caller() { delCallback(); }
|
||||
void delCallback() { delete _callback; _callback = 0; }
|
||||
void setCallback(Callback *cb) { delCallback(); _callback = cb; }
|
||||
void call() { if (_callback) _callback->run(); }
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue