#include <PsnEventAssociationList.h>
Collaboration diagram for PsnEventAssociationList:

Public Methods | |
| PsnEventAssociationList () | |
| constructor | |
| virtual | ~PsnEventAssociationList () |
| destructor | |
| virtual PsEvent * | remove (PsEvent *) |
| remove event from the list of assocations | |
| virtual void | associate (PsEvent *,PsEvent *) |
| add an association to the list | |
Protected Attributes | |
| list< pair< PsEvent *, PsEvent * > > | _associatedEventList |
Definition at line 30 of file PsnEventAssociationList.h.
|
|
constructor
Definition at line 20 of file PsnEventAssociationList.cxx.
00021 {
00022
00023 }
|
|
|
destructor
Definition at line 25 of file PsnEventAssociationList.cxx.
00026 {
00027
00028 }
|
|
||||||||||||
|
add an association to the list
Definition at line 59 of file PsnEventAssociationList.cxx. References _associatedEventList, and list< pair< PsEvent *, PsEvent * > >::push_front().
00060 {
00061 //push_front because it will probably be the next removed element and that removal starts at the beginning of the list
00062 _associatedEventList.push_front( pair<PsEvent *,PsEvent * > (evt1, evt2) ) ;
00063 }
|
|
|
remove event from the list of assocations
Definition at line 30 of file PsnEventAssociationList.cxx. References _associatedEventList, list< pair< PsEvent *, PsEvent * > >::begin(), list< pair< PsEvent *, PsEvent * > >::end(), and list< pair< PsEvent *, PsEvent * > >::erase().
00031 {
00032 PsEvent * result = NULL ;
00033 list<pair<PsEvent *,PsEvent * > >::iterator i = _associatedEventList.begin() ;
00034 list<pair<PsEvent *,PsEvent * > >::iterator toRemove ;
00035 while (i != _associatedEventList.end() )
00036 {
00037 if ( i->first = event)
00038 {
00039 result = i->second ;
00040 toRemove = i ;
00041 i = _associatedEventList.end() ;
00042 _associatedEventList.erase (toRemove) ;
00043 }
00044 else if ( i->second = event )
00045 {
00046 result = i->first ;
00047 toRemove = i ;
00048 i = _associatedEventList.end() ;
00049 _associatedEventList.erase (toRemove) ;
00050 }
00051 else
00052 {
00053 i++ ;
00054 }
00055 }
00056 return result ;
00057 }
|
|
|
Definition at line 46 of file PsnEventAssociationList.h. Referenced by associate(), and remove(). |
| Documentation generated on Mon Nov 25 15:25:59 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |