1 #ifndef BOOST_STATECHART_EVENT_PROCESSOR_INCLUDED
2 #define BOOST_STATECHART_EVENT_PROCESSOR_INCLUDED
3 //////////////////////////////////////////////////////////////////////////////
4 // Copyright 2002-2008 Andreas Huber Doenni
5 // Distributed under the Boost Software License, Version 1.0. (See accompany-
6 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 //////////////////////////////////////////////////////////////////////////////
22 //////////////////////////////////////////////////////////////////////////////
23 template< class Scheduler
>
27 //////////////////////////////////////////////////////////////////////////
28 virtual ~event_processor() {}
30 Scheduler
& my_scheduler() const
35 typedef typename
Scheduler::processor_handle processor_handle
;
37 processor_handle
my_handle() const
47 void process_event( const event_base
& evt
)
49 process_event_impl( evt
);
58 //////////////////////////////////////////////////////////////////////////
59 typedef const typename
Scheduler::processor_context
& my_context
;
61 event_processor( my_context ctx
) :
62 myScheduler_( ctx
.my_scheduler() ),
63 myHandle_( ctx
.my_handle() )
68 //////////////////////////////////////////////////////////////////////////
69 virtual void initiate_impl() = 0;
70 virtual void process_event_impl( const event_base
& evt
) = 0;
71 virtual void terminate_impl() = 0;
73 // avoids C4512 (assignment operator could not be generated)
74 event_processor
& operator=( const event_processor
& );
76 Scheduler
& myScheduler_
;
77 const processor_handle myHandle_
;
82 } // namespace statechart