int main() { Delegate del1 = NewDelegate(&thing1); Delegate del2 = NewDelegate(NULL); Delegator theDelegator = NewDelegator( 14, "A stellar vista, Baby."); printf("Delegator returns %s\n\n", Delegator_Operation( theDelegator, 3, NULL)); printf("Delegator returns %s\n\n", Delegator_Operation( theDelegator, 3, del1)); printf("Delegator returns %s\n\n", Delegator_Operation( theDelegator, 3, del2)); return 0; }
//! Start process events. void SharedEventScheduler::startProcess() { delegateThreadCallback* callback1 = new delegateThreadCallback; (*callback1) += NewDelegate(this, &SharedEventScheduler::proceedHPEvents); irrgameThread* thread1 = createIrrgameThread(callback1, 0, ETP_NORMAL); delegateThreadCallback* callback2 = new delegateThreadCallback; (*callback2) += NewDelegate(this, &SharedEventScheduler::proceedBGEvents); irrgameThread* thread2 = createIrrgameThread(callback2, 0, ETP_LOW); thread1->start(); thread2->start(); }