summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
blob: 20f686fdd4a2217a3beb3b84e8dfab668b9e05a9 (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
/**
 * @file Auto_Disconnect.h
 *
 * @author Carlos O'Ryan <coryan@uci.edu>
 */
#ifndef TAO_PERF_RTEC_AUTO_DISCONNECT_H
#define TAO_PERF_RTEC_AUTO_DISCONNECT_H

#include "tao/corba.h"
#include "ace/Auto_Functor.h"

/**
 * @class Disconnect
 *
 * @brief Helper functor to call the disconnect() method of a class.
 */
template<class Client>
class Disconnect
{
public:
  void operator() (Client *client);
};

/**
 * @class Auto_Disconnect
 *
 * @brief Automatically invoke the disconnect() operation on some
 *        RTEC client.
 */
template<class Client>
class Auto_Disconnect : public ACE_Utils::Auto_Functor<Client,Disconnect<Client> >
{
public:
  /// Constructor
  /**
   * @param client The client
   */
  explicit Auto_Disconnect (Client *s = 0);

  /// Assignment operator
  Auto_Disconnect<Client>& operator= (Client *client);
};

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

#include "Auto_Disconnect.cpp"

#endif /* TAO_PERF_RTEC_AUTO_DISCONNECT_H */