5 * @author Pradeep Gore <pradeep@oomworks.com>
8 #ifndef TAO_Notify_Tests_PEER_T_H
9 #define TAO_Notify_Tests_PEER_T_H
10 #include /**/ "ace/pre.h"
12 #if !defined (ACE_LACKS_PRAGMA_ONCE)
14 #endif /* ACE_LACKS_PRAGMA_ONCE */
17 #include "tao/PortableServer/Servant_Base.h"
20 * @class TAO_Notify_Tests_Peer_T
22 * @brief Base implementation for all Supplier and Consumer Classes.
24 template <class Peer_Traits
>
25 class TAO_Notify_Tests_Peer_T
: public TAO_Notify_Tests_Peer
, public Peer_Traits::SKELETON
27 typedef typename
Peer_Traits::Admin_Traits Admin_Traits
;
28 typedef typename
Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits
;
29 typedef typename
Peer_Traits::Proxy_Traits Proxy_Traits
;
31 typedef typename
Peer_Traits::PTR Peer_Traits_PTR
;
33 typedef typename
Proxy_Traits::INTERFACE Proxy_Traits_INTERFACE
;
34 typedef typename
Proxy_Traits::PTR Proxy_Traits_PTR
;
35 typedef typename
Proxy_Traits::ID Proxy_Traits_ID
;
37 typedef typename
Admin_Traits::PTR Admin_Traits_PTR
;
39 typedef typename
Admin_Ext_Traits::INTERFACE Admin_Ext_Traits_INTERFACE
;
40 typedef typename
Admin_Ext_Traits::PTR Admin_Ext_Traits_PTR
;
44 TAO_Notify_Tests_Peer_T ();
47 virtual ~TAO_Notify_Tests_Peer_T ();
49 // Activates this servant with the POA supplied in init.
50 // Connects to given proxy.
51 void connect (Proxy_Traits_PTR proxy
, Proxy_Traits_ID proxy_id
);
53 // Activates this servant with the POA supplied in init.
54 // Creates a new proxy supplier and connects to it.
55 void connect (Admin_Traits_PTR admin_ptr
);
57 /// Connect using options parsed and set initial QoS.
58 virtual void connect ();
60 // Disconnect from the Peer.
64 void set_qos (CosNotification::QoSProperties
& qos
);
69 // Accessor for <proxy_>.
70 Proxy_Traits_PTR
get_proxy ();
72 /// Deactivate the object.
75 // = ServantBase operations
76 virtual PortableServer::POA_ptr
_default_POA ();
79 /// Activate this object in the default POA.
80 virtual Peer_Traits_PTR
activate ();
82 ///= To be implemented by specializations.
85 virtual void connect_to_peer (Proxy_Traits_PTR proxy_ptr
, Peer_Traits_PTR peer_ptr
) = 0;
88 virtual Proxy_Traits_PTR
obtain_proxy (Admin_Traits_PTR admin_ptr
) = 0;
90 /// Obtain Proxy with QoS.
91 virtual Proxy_Traits_PTR
obtain_proxy (Admin_Ext_Traits_PTR admin_ptr
92 , CosNotification::QoSProperties
& qos
) = 0;
94 /// Disconnect from proxy.
95 virtual void disconnect_from_proxy () = 0;
99 /// The proxy that we are connected to.
100 typename
Proxy_Traits::VAR proxy_
;
102 /// This <proxy_> id.
103 typename
Proxy_Traits::ID proxy_id_
;
106 #include "Peer_T.cpp"
108 #include /**/ "ace/post.h"
109 #endif /* TAO_Notify_Tests_PEER_T_H */