3 //=============================================================================
5 * @file Method_Request.h
7 * @author Andres Kruse <Andres.Kruse@cern.ch>
8 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
10 //=============================================================================
13 #ifndef ACE_METHOD_REQUEST_H
14 #define ACE_METHOD_REQUEST_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/ACE_export.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/Global_Macros.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 * @class ACE_Method_Request
31 * @brief Reifies a method into a request. Subclasses must provide
32 * the necessary state and behavior.
34 * An ACE_Method_Request is inserted in an ACE_Activation_Queue,
35 * where it is subsequently removed by a scheduler object (often
36 * derived from ACE_Task), which invokes the @c call() method.
38 * This class is discussed in depth in the Active Object chapter
41 * @sa ACE_Activation_Queue
43 class ACE_Export ACE_Method_Request
47 ACE_Method_Request (unsigned long priority
= 0);
50 virtual ~ACE_Method_Request () = default;
54 unsigned long priority () const;
58 * Priority values are user-defined. The default (set in the constructor)
59 * is 0. The priority value is used in the ACE_Activation_Queue::enqueue()
60 * method to order the method requests in the queue by priority.
61 * 0 is the lowest priority.
63 * @param prio unsigned long, the new priority value for this object.
65 * @sa ACE_Activation_Queue::enqueue
67 void priority (unsigned long prio
);
69 // = Invocation method (must be overridden by subclasses).
70 /// Invoked by the scheduler to execute the request.
72 * This method must be implemented by the subclass to perform the
75 * @return int; not interpreted by ACE. The scheduler class must
76 * decide the meaning of this return value and act on it
79 virtual int call () = 0;
82 ACE_Method_Request (const ACE_Method_Request
&) = delete;
83 void operator= (const ACE_Method_Request
&) = delete;
84 ACE_Method_Request (ACE_Method_Request
&&) = delete;
85 void operator= (ACE_Method_Request
&&) = delete;
88 /// The priority of the request.
89 unsigned long priority_
;
92 ACE_END_VERSIONED_NAMESPACE_DECL
95 #include /**/ "ace/post.h"
96 #endif /* ACE_METHOD_REQUEST_H */