5 * @author Venkita Subramonian (venkita@cs.wustl.edu)
7 * Based on previous work by Tim Harrison Chris Gill,
8 * Carlos O'Ryan and other members of the DOC group.
13 #include /**/ "ace/pre.h"
14 #include "ace/Copy_Disabled.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "kokyu_export.h"
23 #include "Kokyu_defs.h"
25 //Currently I am not seeing a way to avoid including these here. The
26 //whole purpose of the pImpl idiom is to avoid this dependency. But
27 //using the auto_ptr<> to store the implementation causes a compile
28 //error (in the destructor) that the implementation definition is not
29 //found. Note that the auto-ptr<T>::~auto_ptr() calls delete on the
30 //internal pointer and at this point the class definition needs to be
31 //visible. Need to revisit this and see whether there is a work
33 #include "Dispatcher_Impl.h"
35 //#################################################################
36 //Beware that this interface will be subject to change in the future
37 //since this is the very initial release. We will be working on
38 //trying to merge the DSRT and EC mechanisms in the future. If you
39 //are a user of this interface, kindly let us know so that we can
40 //coordinate with you when we refactor this interface.
41 //##################################################################
45 //class Dispatcher_Impl;
50 * @brief Interface class for dynamic scheduling of events
52 * The responsibility of this class is to forward all methods to
53 * its delegation/implementation class, e.g.,
54 * @c Default_Dispatcher_Impl. This class follows the pImpl idiom
55 * or the bridge pattern to separate the implementation from the interface.
56 * Dispatcher is the class that users will be using to achieve
57 * dynamic dispatching of events in an event channel.
59 class Kokyu_Export Dispatcher
: private ACE_Copy_Disabled
62 /// Dispatch a command object based on the qos info supplied.
63 int dispatch (const Dispatch_Command
*, const QoSDescriptor
&);
65 /// Shut down the dispatcher. The dispatcher will stop processing requests.
68 /// Supply this interface with an appripriate implementation.
69 void implementation (Dispatcher_Impl
*);
73 /// Non virtual destructor. Read as <b><i>this class not available
74 /// for inheritance<i></b>.
77 /// Auto ptr to the implementation. Implementation will be created on the
78 /// heap and deleted automatically when the dispatcher object is destructed.
79 std::unique_ptr
<Dispatcher_Impl
> dispatcher_impl_
;
82 typedef std::unique_ptr
<Dispatcher
> Dispatcher_Auto_Ptr
;
85 * @class Dispatcher_Factory
87 * @brief Factory class to create one of the dispatcher interface
88 * objects - for events.
90 * Factory class creates a dispatcher for EC and configures the
91 * interface object with the appropriate implementation.
93 class Kokyu_Export Dispatcher_Factory
: private ACE_Copy_Disabled
97 * Create a dispatcher for dynamic dispatching of commands
98 * (eg. events). The caller is responsible for freeing the
99 * returned dynamically allocated memory.
101 * @param config Configuration information for the dispatcher.
103 * @return pointer to the dispatcher.
106 create_dispatcher (const Dispatcher_Attributes
& attr
);
110 #if defined (__ACE_INLINE__)
112 #endif /* __ACE_INLINE__ */
114 #include /**/ "ace/post.h"