summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/performance-tests/RTEvent/lib/Peer_Base.h
blob: 3733441998bd1cfed8da35c3f362ded3a972cebe (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
67
68
69
70
71
72
73
74
75
76
77
/**
 * @file Peer_Base.h
 *
 * $Id$
 *
 * @author Carlos O'Ryan <coryan@uci.edu>
 *
 */

#ifndef TAO_RTEC_PERF_PEER_BASE_H
#define TAO_RTEC_PERF_PEER_BASE_H

#include "Federated_TestS.h"
#include "orbsvcs/RtecEventChannelAdminC.h"

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

class RTServer_Setup;

/**
 * @class Peer_Base
 *
 * @brief Implement the shared portions of Federated_Test::Peer
 *        servants
 *
 */
class TAO_RTEC_Perf_Export Peer_Base
 : public virtual POA_Federated_Test::Peer
 , public virtual PortableServer::RefCountServantBase
{
public:
  /// Constructor
  Peer_Base (CORBA::ORB_ptr orb,
             RTServer_Setup &rtserver_setup
             ACE_ENV_ARG_DECL);

  /// Destructor
  virtual ~Peer_Base (void);

  //@{
  /** @name The Federated_Test::Peer methods
   */
  virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((CORBA::SystemException));

  virtual CORBA::Object_ptr
      channel (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
        ACE_THROW_SPEC ((CORBA::SystemException));

  virtual void connect (Federated_Test::Peer_ptr remote_peer
                        ACE_ENV_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((CORBA::SystemException));

  Federated_Test::Loopback_ptr setup_loopback (CORBA::Long experiment_id,
                                               CORBA::Long base_event_type
                                               ACE_ENV_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((CORBA::SystemException));

  PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((CORBA::SystemException));
  //@}

protected:
  /// Keep a reference to the ORB, used in shutdown
  CORBA::ORB_var orb_;

  /// The POA used for the suppliers, consumers, activate the EC and
  /// as this servant's _default_POA()
  PortableServer::POA_var poa_;

  /// Event Channel references
  RtecEventChannelAdmin::EventChannel_var event_channel_;
};

#endif /* TAO_RTEC_PERF_PEER_BASE_H */