summaryrefslogtreecommitdiff
path: root/ace/Method_Request.h
blob: b545648712a5909257a5e4033831c00bea702502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    Method_Request.h
 *
 *  $Id$
 *
 *  @author Andres Kruse <Andres.Kruse@cern.ch>
 *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
 */
//=============================================================================


#ifndef ACE_METHOD_REQUEST_H
#define ACE_METHOD_REQUEST_H
#include "ace/pre.h"

#include "ace/OS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

/**
 * @class ACE_Method_Request
 *
 * @brief Reifies a method into a request.  Subclasses provide
 * the necessary state and behavior.
 *
 * A <Method_Request> is inserted in the <Activation_Queue>,
 * where it is subsequently removed by a <Scheduler>, which
 * invokes the <call> method.
 */
class ACE_Export ACE_Method_Request
{
public:
  // = Initialization and termination methods.
  /// Constructor.
  ACE_Method_Request (u_long priority = 0);

  /// Destructor.
  virtual ~ACE_Method_Request (void);

  // = Accessors.
  /// Get priority.
  u_long priority (void) const;

  /// Set priority.
  void priority (u_long);

  // = Invocation method (must be overridden by subclasses).
  /// Invoked when the <Method_Request> is scheduled to run.
  virtual int call (void) = 0;

protected:
  /// The priority of the request.
  u_long priority_;

private:
  ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Method_Request &))
  ACE_UNIMPLEMENTED_FUNC (ACE_Method_Request (const ACE_Method_Request &))
};

#include "ace/post.h"
#endif /* ACE_METHOD_REQUEST_H */