Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Method_Request.h
blob96234416b21c71f137405a8cc58bc028fc2f9c8e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Method_Request.h
7 * @author Andres Kruse <Andres.Kruse@cern.ch>
8 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
9 */
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)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/Global_Macros.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 /**
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
39 * of POSA2.
41 * @sa ACE_Activation_Queue
43 class ACE_Export ACE_Method_Request
45 public:
46 /// Constructor.
47 ACE_Method_Request (unsigned long priority = 0);
49 /// Destructor.
50 virtual ~ACE_Method_Request () = default;
52 // = Accessors.
53 /// Get priority.
54 unsigned long priority () const;
56 /// Set priority.
57 /**
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.
71 /**
72 * This method must be implemented by the subclass to perform the
73 * desired actions.
75 * @return int; not interpreted by ACE. The scheduler class must
76 * decide the meaning of this return value and act on it
77 * if needed.
79 virtual int call () = 0;
81 private:
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;
87 protected:
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 */