| 1 |
#include "CSequencedEvent.h" |
| 2 |
|
| 3 |
CSequencedEvent::CSequencedEvent(bool c) |
| 4 |
: done(false), concurrent(c), d(NULL), init(false), refCount(1) |
| 5 |
{ |
| 6 |
start(); |
| 7 |
} |
| 8 |
|
| 9 |
CSequencedEvent::CSequencedEvent(const CSequencedEvent &e) |
| 10 |
: done(e.done), concurrent(e.concurrent), running(e.running), refCount(e.refCount) |
| 11 |
{ |
| 12 |
d = (e.d ? e.d->getCopy() : NULL); |
| 13 |
} |
| 14 |
|
| 15 |
const CSequencedEvent& CSequencedEvent::operator=(const CSequencedEvent &e) |
| 16 |
{ |
| 17 |
if (&e != this) // don't allow assignment to self |
| 18 |
{ |
| 19 |
delete d; // free old memory |
| 20 |
|
| 21 |
d = (e.d ? e.d->getCopy() : NULL); |
| 22 |
done = e.done; |
| 23 |
concurrent = e.concurrent; |
| 24 |
running = e.running; |
| 25 |
refCount = e.refCount; |
| 26 |
} |
| 27 |
return *this; |
| 28 |
} |
| 29 |
|
| 30 |
CSequencedEvent::~CSequencedEvent() |
| 31 |
{ |
| 32 |
delete d; |
| 33 |
} |
| 34 |
|
| 35 |
void CSequencedEvent::update() |
| 36 |
{ |
| 37 |
if(!init) |
| 38 |
{ |
| 39 |
init = true; |
| 40 |
initialize(); |
| 41 |
} |
| 42 |
doUpdate(); |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
void CSequencedEvent::passEventData(CEventData* d) |
| 47 |
{ |
| 48 |
delete CSequencedEvent::d; |
| 49 |
CSequencedEvent::d = d; |
| 50 |
gotEventData(); |
| 51 |
} |