summaryrefslogtreecommitdiff
path: root/TAO/tests/Portable_Interceptors/PolicyFactory/Policy.h
blob: fdebe1daa6f7649e9d436d283f62a9c17ed69286 (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
// -*- C++ -*-

//=============================================================================
/**
 * @file Policy.h
 *
 * $Id$
 *
 * Implementation header for the test Policy.
 *
 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
 */
//=============================================================================

#ifndef POLICY_H
#define POLICY_H

#include "testC.h"
#include "tao/LocalObject.h"

/**
 * @class Policy
 *
 * @brief Implementation of the Test::Policy interface.
 *
 * This policy merely returns the value that was passed to it when it
 * was constructed.
 */
class Policy
  : public virtual Test::Policy,
    public virtual TAO_Local_RefCounted_Object
{
public:

  /// Constructor.
  Policy (CORBA::ULong val);

  /// Test method defined in test IDL.
  virtual CORBA::ULong value (void);

  virtual CORBA::PolicyType policy_type (void);

  virtual CORBA::Policy_ptr copy (void);

  virtual void destroy (void);

protected:

  /// Destructor.
  /**
   * Protected destructor to enforce proper memory management through
   * the reference counting mechanism.
   */
  ~Policy (void);

private:

  /// Pseudo-reference to the ORB.
  const CORBA::ULong value_;

};

#endif  /* POLICY_H */