summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/performance-tests/RTEvent/lib/Implicit_Deactivator.h
blob: 90fcc23b08e0c2317fe01910a5764163907b7b4b (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
/**
 * @file Implicit_Deactivator.h
 *
 * $Id$
 *
 * @author Carlos O'Ryan <coryan@uci.edu>
 */
#ifndef TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H
#define TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H

#include "rtec_perf_export.h"
#include "tao/PortableServer/PortableServer.h"

/**
 * @class Implicit_Deactivator
 *
 * @brief Automatically deactivate an implicitly activated object.
 */
class TAO_RTEC_Perf_Export Implicit_Deactivator
{
public:
  /// Constructor
  /**
   * @param client The client
   */
  explicit Implicit_Deactivator (PortableServer::Servant servant = 0);
  Implicit_Deactivator (Implicit_Deactivator& rhs);
  Implicit_Deactivator& operator= (Implicit_Deactivator& rhs);

  /// Destructor
  ~Implicit_Deactivator (void);

  /// Assignment operator
  Implicit_Deactivator& operator= (PortableServer::Servant servant);

  /// Release the servant, i.e. the destructor does not deactivate anything
  void release (void);

private:
  /// The POA
  PortableServer::POA_var poa_;

  /// The object id
  PortableServer::ObjectId_var id_;
};

#if defined(__ACE_INLINE__)
#include "Implicit_Deactivator.inl"
#endif /* __ACE_INLINE__ */

#endif /* TAO_PERF_RTEC_IMPLICIT_DEACTIVATOR_H */