#include <OMKEventAssociationList.h>
Collaboration diagram for OMK::EventAssociationList:
Public Member Functions | |
EventAssociationList () | |
constructor | |
virtual | ~EventAssociationList () |
destructor | |
virtual Event * | remove (Event *) |
remove event from the list of assocations | |
virtual void | associate (Event *, Event *) |
add an association to the list | |
Protected Attributes | |
std::list< std::pair< Event *, Event * > > | _associatedEventList |
Definition at line 32 of file OMKEventAssociationList.h.
EventAssociationList::EventAssociationList | ( | ) |
EventAssociationList::~EventAssociationList | ( | ) | [virtual] |
remove event from the list of assocations
Definition at line 33 of file OMKEventAssociationList.cpp.
References _associatedEventList.
00034 { 00035 Event * result = NULL ; 00036 std::list<pair<Event *,Event * > >::iterator i = _associatedEventList.begin() ; 00037 std::list<pair<Event *,Event * > >::iterator toRemove ; 00038 while (i != _associatedEventList.end() ) 00039 { 00040 if ( ( i->first = event ) ) 00041 { 00042 result = i->second ; 00043 toRemove = i ; 00044 i = _associatedEventList.end() ; 00045 _associatedEventList.erase (toRemove) ; 00046 } 00047 else if ( ( i->second = event ) ) 00048 { 00049 result = i->first ; 00050 toRemove = i ; 00051 i = _associatedEventList.end() ; 00052 _associatedEventList.erase (toRemove) ; 00053 } 00054 else 00055 { 00056 i++ ; 00057 } 00058 } 00059 return result ; 00060 }
add an association to the list
Definition at line 62 of file OMKEventAssociationList.cpp.
References _associatedEventList.
00063 { 00064 //push_front because it will probably be the next removed element and that removal starts at the beginning of the list 00065 _associatedEventList.push_front( pair<Event *,Event * > (evt1, evt2) ) ; 00066 }
std::list<std::pair<Event *,Event * > > OMK::EventAssociationList::_associatedEventList [protected] |
Documentation generated on Mon Jun 9 11:46:01 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |