class MyScheduler : public UserScheduler { public: static const char* stName; MyScheduler(); ~MyScheduler(); void init(); static char* serialize(MyScheduler* GS); static MyScheduler* deserialize(const char* serializedScheduler); /* Overriden UserScheduler class aggregate method. */ int aggregate(corba_response_t* aggrResp, size_t max_srv, const size_t nb_responses, const corba_response_t* responses); }; const char* MyScheduler::stName="UserGS"; MyScheduler::~MyScheduler() { } MyScheduler::MyScheduler() { this->name = this->stName; this->nameLength = strlen(this->name); } int MyScheduler::aggregate(corba_response_t* aggrResp, size_t max_srv, const size_t nb_responses, const corba_response_t* responses) { ... } SCHEDULER\_CLASS(MyScheduler)After defining the scheduler class, the developer just has to use the SCHEDULER_CLASS macro to define it as a scheduler class loadable from an agent.
In our example, the call to SCHEDULER_CLASS(MyScheduler) - after the class declaration - makes the class loadable by a DIET agent.