#include <OMKEvent.h>
Inheritance diagram for OMK::Event:
member function for event manipulation | |
Event (const Event &originalEvent) | |
copy constructor | |
Event & | operator= (const Event &originalEvent) |
assignement | |
virtual Event * | clone () const |
cloning | |
virtual void | insertInStream (std::ostream &out=std::cout) const |
insert in a stream | |
virtual void | extract (std::istream &in=std::cin) |
extract from a stream | |
virtual void | unpack (IncomingSynchronisationMessage &) |
unpack from a message when this member function is called, the 4 base fields (eventId, date, sender and receiver) have allready been unpacked. | |
virtual void | pack (OutgoingSynchronisationMessage &) const |
pack in a message | |
Event (const EventIdentifier &event, const Date &date, const Name &sender, const Name &receiver) | |
the constructor | |
virtual | ~Event () |
the destructor. | |
virtual bool | isSystem () const |
is the event a system event | |
static Event * | insertInList (std::list< Event * > *alist, Event *) |
insert an event in an event list, so that events are ordered from oldest to most recent | |
Public Attributes | |
The four base fields | |
EventIdentifier | eventId |
the event identifier | |
Date | date |
date of sending | |
Name | sender |
sender of the event | |
Name | receiver |
intended receiver | |
Static Protected Attributes | |
static EventCreator * | _myEventCreator |
Definition at line 36 of file OMKEvent.h.
Event::Event | ( | const Event & | originalEvent | ) |
Event::Event | ( | const EventIdentifier & | event, | |
const Date & | date, | |||
const Name & | sender, | |||
const Name & | receiver | |||
) |
the constructor
event | : the event | |
date | : date of sending | |
sender | : sender | |
receiver | : receiver |
Definition at line 94 of file OMKEvent.cpp.
00094 : 00095 eventId ( eventId ), 00096 date ( date ), 00097 sender ( sender ), 00098 receiver (receiver ) 00099 { 00100 #ifdef _DEBUGEVT 00101 cerr<<"Event::Event(const EventIdentifier & eventId, const Date & date, const Name & sender, const Name & receiver )"<<endl; 00102 #endif 00103 }
Event::~Event | ( | ) | [virtual] |
assignement
Definition at line 43 of file OMKEvent.cpp.
References date, eventId, receiver, and sender.
Referenced by OMK::ValuedEvent< UserType >::operator=().
00044 { 00045 eventId = evenement.eventId ; 00046 date = evenement.date ; 00047 sender = evenement.sender ; 00048 receiver = evenement.receiver ; 00049 return(*this); 00050 }
Event * Event::clone | ( | ) | const [virtual] |
cloning
Reimplemented in OMK::ValuedEvent< UserType >.
Definition at line 52 of file OMKEvent.cpp.
References Event().
Referenced by OMK::Controller::actOnSystemEvent(), OMK::PvmLocalObjectHandle::broadcastEvent(), OMK::PvmDuplicatedObjectHandle::broadcastEvent(), OMK::DistributedController::broadcastEventsForSignal(), OMK::ReferenceObjectHandle::receiveEvent(), and OMK::SimulatedObject::sendEvent().
00052 { 00053 return new Event (*this) ; 00054 }
void Event::insertInStream | ( | std::ostream & | out = std::cout |
) | const [virtual] |
insert in a stream
out | the stream where the event must be printed |
Implements OMK::Flowable.
Reimplemented in OMK::ValuedEvent< UserType >.
Definition at line 79 of file OMKEvent.cpp.
References date, eventId, receiver, and sender.
Referenced by OMK::ValuedEvent< UserType >::insertInStream().
00080 { 00081 out << eventId << " " 00082 << date << " " 00083 << sender << " " 00084 << receiver << " " ; 00085 }
void Event::extract | ( | std::istream & | in = std::cin |
) | [virtual] |
extract from a stream
in | the stream from which the event must be extracted |
Implements OMK::Flowable.
Reimplemented in OMK::ValuedEvent< UserType >.
Definition at line 87 of file OMKEvent.cpp.
References date, eventId, receiver, and sender.
Referenced by OMK::ValuedEvent< UserType >::extract().
void Event::unpack | ( | IncomingSynchronisationMessage & | ) | [virtual] |
unpack from a message when this member function is called, the 4 base fields (eventId, date, sender and receiver) have allready been unpacked.
This is necessary to enable correct un packing of valuedEvents
Reimplemented from OMK::Flowable.
Reimplemented in OMK::ValuedEvent< UserType >.
Definition at line 58 of file OMKEvent.cpp.
Referenced by OMK::PvmController::parseSynchronisationMessage(), OMK::ValuedEvent< UserType >::unpack(), OMK::PvmReferenceObjectHandle::unpack(), OMK::PvmLocalObjectHandle::unpack(), and OMK::PvmDuplicatedObjectHandle::unpack().
void Event::pack | ( | OutgoingSynchronisationMessage & | ) | const [virtual] |
pack in a message
Reimplemented from OMK::Flowable.
Reimplemented in OMK::ValuedEvent< UserType >.
Definition at line 64 of file OMKEvent.cpp.
References date, eventId, receiver, and sender.
00065 { 00066 static Name eventWithNoValue ("Event") ; 00067 #ifdef _DEBUGPVMMESS 00068 cerr<<"Event::pack"<<endl; 00069 #endif 00070 out << eventWithNoValue 00071 << eventId 00072 << OMK::Type::SimpleTypeT< Date >( date ) 00073 << sender 00074 << receiver ; 00075 }
bool Event::isSystem | ( | ) | const [virtual] |
is the event a system event
Definition at line 111 of file OMKEvent.cpp.
References eventId, and OMK::EventIdentifier::isSystemEvent().
Referenced by OMK::ReferenceObjectHandle::receiveEvent().
00111 { 00112 return eventId.isSystemEvent () ; 00113 }
insert an event in an event list, so that events are ordered from oldest to most recent
Definition at line 117 of file OMKEvent.cpp.
References date.
Referenced by OMK::Controller::actOnSystemEvent(), and OMK::ReferenceObjectHandle::receiveEvent().
00117 { 00118 00119 list<Event *>::reverse_iterator i = aList->rbegin () ; 00120 00121 while ( i != aList->rend() && 00122 (event->date < (*i)->date ) ) 00123 { 00124 ++i ; 00125 } 00126 aList-> insert (i.base(),event) ; 00127 return event ; 00128 }
the event identifier
Definition at line 43 of file OMKEvent.h.
Referenced by extract(), insertInStream(), isSystem(), operator=(), OMK::ValuedEvent< UserType >::pack(), pack(), OMK::Iii::InteractorExtension::processCurrentValuesSent(), OMK::Vis::VisBase::processEvent(), OMK::ValuedEventListenerCallBack< CallerClass, PrmType >::processEvent(), OMK::Inp::InputCreatorListener::processEvent(), OMK::InputConnectionEventListener< T >::processEvent(), OMK::DistributedController::processEvent(), OMK::Controller::processEvent(), OMK::Controller::reactToControlledObjectsSystemEvents(), OMK::ReferenceObjectHandle::receiveEvent(), OMK::SimulatedObject::sendEvent(), and OMK::SignalDispatcher::sendEventsForSignal().
date of sending
Definition at line 47 of file OMKEvent.h.
Referenced by extract(), insertInList(), insertInStream(), operator=(), OMK::ValuedEvent< UserType >::pack(), pack(), OMK::DistributedController::processEvent(), OMK::Controller::processEvent(), OMK::ReferenceObjectHandle::receiveEvent(), and OMK::SimulatedObject::sendEvent().
sender of the event
Definition at line 51 of file OMKEvent.h.
Referenced by OMK::ValuedEvent< UserType >::ValuedEventCreator::createRealEvent(), extract(), OMK::Vis::VisServiceExtension::handleVisuInfoEvent(), insertInStream(), operator=(), OMK::ValuedEvent< UserType >::pack(), pack(), OMK::Iii::InteractiveExtension::processControlRelease(), OMK::Iii::InteractiveExtension::processControlUnfreeze(), OMK::ValuedEventListenerCallBack< CallerClass, PrmType >::processEvent(), OMK::InputConnectionEventListener< T >::processEvent(), OMK::DistributedController::processEvent(), and OMK::IAttribute::processGetValue().
intended receiver
Definition at line 55 of file OMKEvent.h.
Referenced by OMK::Controller::actOnSystemEvent(), OMK::Controller::addToPendingEvents(), OMK::ValuedEvent< UserType >::ValuedEventCreator::createRealEvent(), OMK::DistributedController::dispatchEvent(), extract(), insertInStream(), operator=(), OMK::ValuedEvent< UserType >::pack(), pack(), OMK::DistributedController::processEvent(), OMK::Controller::reactToControlledObjectsSystemEvents(), OMK::ReferenceObjectHandle::receiveEvent(), OMK::SimulatedObject::sendEvent(), and OMK::SignalDispatcher::sendEventsForSignal().
EventCreator * Event::_myEventCreator [static, protected] |
Definition at line 119 of file OMKEvent.h.
Documentation generated on Mon Jun 9 11:46:01 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |