The processing unit class should inherit from ICppWorker and implement its callback methods.
Public Member Functions | |
virtual const char * | className ()=0 |
Returns the name of the worker class. | |
virtual bool | Destroy ()=0 |
Called prior to the worker becoming eligible for unload. | |
virtual bool | Initialize (IWorkerPeer *Host)=0 |
Holds any initialization code. | |
virtual CommandObjectPtr | run (CommandObjectPtr work)=0 |
Executes the worker's processing code. | |
virtual | ~ICppWorker () |
Destructor. |
virtual ICppWorker::~ICppWorker | ( | ) | [inline, virtual] |
Destructor.
virtual const char* ICppWorker::className | ( | ) | [pure virtual] |
Returns the name of the worker class.
Override this method to return the name of your worker class as specified in the pu.xml file.
For example:
virtual const char* className() { return "ExampleWorker"; }
virtual bool ICppWorker::Destroy | ( | ) | [pure virtual] |
Called prior to the worker becoming eligible for unload.
Override this method to place any cleanup code.
virtual bool ICppWorker::Initialize | ( | IWorkerPeer * | Host | ) | [pure virtual] |
Holds any initialization code.
The method is called upon successful load of the worker via the SBA container. Override this method to include any initialization required.
Host | - The reference back to the Host Container |
virtual CommandObjectPtr ICppWorker::run | ( | CommandObjectPtr | work | ) | [pure virtual] |
Executes the worker's processing code.
Override this method and place here any processing done by the worker.
The method is called by the host container when work is available for the worker. The worker performs the work described within the CommandObject argument. This argument also provides the space Id so that the worker can retrieve the space proxy by calling SpaceFinder::attach. The worker return a results CommandObject back to the caller which can indicate the success of the work performed.
work | - The Command that should be processed. |