00001 #if !defined(__EVENTCONTEXT_HPP)
00002 #define __EVENTCONTEXT
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined(__COMMON_HPP)
00025 #include <corelinux/Common.hpp>
00026 #endif
00027
00028 #if !defined(__THREADCONTEXT_HPP)
00029 #include <corelinux/ThreadContext.hpp>
00030 #endif
00031
00032 #if !defined(__EVENTSEMAPHOREGROUP_HPP)
00033 #include <corelinux/EventSemaphoreGroup.hpp>
00034 #endif
00035
00036 typedef Int (*ArgumentFunctionPtr)( CORELINUX(EventSemaphoreGroupPtr) );
00037
00038 DECLARE_CLASS( EventContext )
00039
00040
00046 class EventContext : public CORELINUX(ThreadContext)
00047 {
00048
00049 public:
00050
00051
00052
00053
00054
00056
00057 EventContext
00058 (
00059 ArgumentFunctionPtr,
00060 CORELINUX(EventSemaphoreGroupPtr)
00061 )
00062 throw ( CORELINUX( Assertion ) );
00063
00065
00066 EventContext
00067 (
00068 ArgumentFunctionPtr,
00069 CORELINUX(Size),
00070 CORELINUX(EventSemaphoreGroupPtr)
00071 )
00072 throw ( CORELINUX( Assertion ) );
00073
00075
00076 EventContext( EventContextCref )
00077 throw ( CORELINUX( Assertion ) );
00078
00080
00081 virtual ~EventContext( void );
00082
00083
00084
00085
00086
00096 EventContextRef operator=( EventContextCref )
00097 throw( CORELINUX( Assertion ) );
00098
00099
00106 bool operator==( EventContextCref ) const;
00107
00108
00109
00110
00111
00113
00114 CORELINUX(EventSemaphoreGroupPtr) getArgument( void ) const;
00115
00116
00117
00118
00119
00120
00122
00123 void setArgument( CORELINUX(EventSemaphoreGroupPtr) ) ;
00124
00125
00126 protected:
00127
00128
00129
00130
00131
00133
00134 EventContext( void )
00135 throw ( CORELINUX( Assertion ) );
00136
00137
00138
00139
00141
00142 ArgumentFunctionPtr getArgumentFunction( void );
00143
00144 private:
00145
00154 static CORELINUX(ThreadContextPtr) argumentContextCreate
00155 (
00156 CORELINUX(ThreadContextRef)
00157 );
00158
00164 static void argumentContextDestroy( CORELINUX(ThreadContextPtr) );
00165
00166 static Int argumentFrame( CORELINUX(ThreadContextPtr) );
00167
00168
00169 private:
00170
00172
00173 CORELINUX(EventSemaphoreGroupPtr) theSemaphoreGroup;
00174 };
00175
00176
00177 #endif
00178
00179
00180
00181
00182
00183
00184
00185
00186