3 //=============================================================================
5 * @file Method_Request.h
7 * $Id: Method_Request.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Andres Kruse <Andres.Kruse@cern.ch>
10 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
12 //=============================================================================
15 #ifndef ACE_METHOD_REQUEST_H
16 #define ACE_METHOD_REQUEST_H
18 #include /**/ "ace/pre.h"
20 #include /**/ "ace/ACE_export.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/Global_Macros.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class ACE_Method_Request
33 * @brief Reifies a method into a request. Subclasses must provide
34 * the necessary state and behavior.
36 * An ACE_Method_Request is inserted in an ACE_Activation_Queue,
37 * where it is subsequently removed by a scheduler object (often
38 * derived from ACE_Task), which invokes the @c call() method.
40 * This class is discussed in depth in the Active Object chapter
43 * @sa ACE_Activation_Queue
45 class ACE_Export ACE_Method_Request
48 // = Initialization and termination methods.
50 ACE_Method_Request (unsigned long priority
= 0);
53 virtual ~ACE_Method_Request (void);
57 unsigned long priority (void) const;
61 * Priority values are user-defined. The default (set in the constructor)
62 * is 0. The priority value is used in the ACE_Activation_Queue::enqueue()
63 * method to order the method requests in the queue by priority.
64 * 0 is the lowest priority.
66 * @param prio unsigned long, the new priority value for this object.
68 * @sa ACE_Activation_Queue::enqueue
70 void priority (unsigned long prio
);
72 // = Invocation method (must be overridden by subclasses).
73 /// Invoked by the scheduler to execute the request.
75 * This method must be implemented by the subclass to perform the
78 * @return int; not interpreted by ACE. The scheduler class must
79 * decide the meaning of this return value and act on it
82 virtual int call (void) = 0;
86 /// Disallow copying and assignment.
87 ACE_Method_Request (const ACE_Method_Request
&);
88 void operator= (const ACE_Method_Request
&);
91 /// The priority of the request.
92 unsigned long priority_
;
96 ACE_END_VERSIONED_NAMESPACE_DECL
99 #include /**/ "ace/post.h"
100 #endif /* ACE_METHOD_REQUEST_H */