diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-10-28 07:57:07 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-10-28 07:57:07 +0000 |
commit | 55e8d7c6f2dce15286b6b7087f8e792587a31f8f (patch) | |
tree | 7c0fc8cef72b08324fcd21d888872bfe4a300ac9 /TAO/orbsvcs | |
parent | b02c515a2f513cb9089939610e6cfe31d4a07332 (diff) | |
download | ATCD-55e8d7c6f2dce15286b6b7087f8e792587a31f8f.tar.gz |
Thu Oct 28 07:51:17 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
* orbsvcs/examples/ImR/Advanced/TestServer.h:
* orbsvcs/examples/RtEC/MCast/MCast.cpp:
* orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h:
* orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.inl:
* orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h:
* orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h:
* orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp:
* orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h:
* orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.inl:
* orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h:
* orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.inl:
* orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h:
* orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl:
* orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h:
* orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.inl:
* orbsvcs/tests/EC_MT_Mcast/MCast.cpp:
* orbsvcs/tests/EC_Mcast/EC_Mcast.h:
* orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h:
* orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp:
* orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp:
* orbsvcs/tests/Event/Mcast/Complex/consumer.cpp:
* orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
* orbsvcs/tests/Event/Mcast/Simple/consumer.cpp:
* orbsvcs/tests/Event/Mcast/Two_Way/application.cpp:
* orbsvcs/tests/Event/UDP/receiver.cpp:
* orbsvcs/tests/Event/UDP/sender.cpp:
Removed TAO_EC_Servant_Var, use PortableServer::Servant_var instead
Diffstat (limited to 'TAO/orbsvcs')
27 files changed, 51 insertions, 362 deletions
diff --git a/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp index b00f7b96444..c5dcf5764b7 100644 --- a/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp +++ b/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_MCast_Federated/EchoEventSupplierMain.cpp @@ -144,7 +144,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) RtecUDPAdmin::AddrServer::_narrow(addr_srv_obj.in()); // Create and initialize the sender object - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender = + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender = TAO_ECG_UDP_Sender::create(); TAO_ECG_UDP_Out_Endpoint endpoint; if (endpoint.dgram ().open (ACE_Addr::sap_any) == -1) { @@ -166,7 +166,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) sender->connect (sub); // Create and initialize the receiver - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver = + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver = TAO_ECG_UDP_Receiver::create(); // TAO_ECG_UDP_Receiver::init() takes a TAO_ECG_Refcounted_Endpoint. diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h index e655a120dc9..666f526a014 100644 --- a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h +++ b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h @@ -43,7 +43,7 @@ private: std::string baseDir_; std::string expectedDir_; std::vector<std::pair<std::string, std::string> > expectedEnv_; - TAO::Utils::Servant_Var<Messenger_i> servant_; + PortableServer::Servant_var<Messenger_i> servant_; CORBA::ORB_var orb_; IORTable::Table_var iorTable_; diff --git a/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp b/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp index 08d2812c92e..90e95851b3e 100644 --- a/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp +++ b/TAO/orbsvcs/examples/RtEC/MCast/MCast.cpp @@ -141,7 +141,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } // Now we setup the sender: - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender = TAO_ECG_UDP_Sender::create(); + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender = + TAO_ECG_UDP_Sender::create(); sender->init (event_channel.in (), address_server.in (), endpoint); @@ -161,7 +162,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) sender->connect (sub); // To receive events we need to setup an event handler: - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver = TAO_ECG_UDP_Receiver::create(); + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver = + TAO_ECG_UDP_Receiver::create(); TAO_ECG_Mcast_EH mcast_eh (&(*receiver)); // The event handler uses the ORB reactor to wait for multicast diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h index d5cf9b79530..06a54ac2b5a 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.h @@ -58,7 +58,7 @@ public: * <is_source_mapping> flag indicates whether this * server maps based on event header source or event header type. */ - static TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> + static PortableServer::Servant_var<TAO_ECG_Complex_Address_Server> create (int is_source_mapping = 1); /// Destructor diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.inl b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.inl index b47e2db3e68..bafa73ad26f 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.inl +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Complex_Address_Server.inl @@ -4,10 +4,10 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> +ACE_INLINE PortableServer::Servant_var<TAO_ECG_Complex_Address_Server> TAO_ECG_Complex_Address_Server::create (int is_source_mapping) { - TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> s; + PortableServer::Servant_var<TAO_ECG_Complex_Address_Server> s; ACE_NEW_RETURN (s, TAO_ECG_Complex_Address_Server (is_source_mapping), s); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h index 490f03f17e1..bdaaa102762 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_EH.h @@ -267,7 +267,7 @@ private: /// Event Channel Observer. Detects changes in EC consumer subscriptions. /// ORDER DEPENDENCY: this member should be declared before /// <auto_observer_disconnect_>. - TAO_EC_Servant_Var<Observer> observer_; + PortableServer::Servant_var<Observer> observer_; /// Manages connection of our observer to the Event Channel. /// ORDER DEPENDENCY: this member should be declared AFTER <observer_>. diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp index aa41d68c8e8..3dfa28aa6c9 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp @@ -20,18 +20,14 @@ #include "orbsvcs/Event/ECG_Mcast_Gateway.inl" #endif /* __ACE_INLINE__ */ - - - TAO_BEGIN_VERSIONED_NAMESPACE_DECL -typedef TAO_EC_Shutdown_Command<TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> > +typedef TAO_EC_Shutdown_Command<PortableServer::Servant_var<TAO_ECG_UDP_Sender> > UDP_Sender_Shutdown; -typedef TAO_EC_Shutdown_Command<TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> > +typedef TAO_EC_Shutdown_Command<PortableServer::Servant_var<TAO_ECG_UDP_Receiver> > UDP_Receiver_Shutdown; - int TAO_ECG_Mcast_Gateway::init_svcs (void) { @@ -364,7 +360,7 @@ TAO_ECG_Mcast_Gateway::init_address_server (void) if (this->address_server_type_ == ECG_ADDRESS_SERVER_BASIC) { - TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> impl = + PortableServer::Servant_var<TAO_ECG_Simple_Address_Server> impl = TAO_ECG_Simple_Address_Server::create (); if (!impl.in ()) return 0; @@ -378,7 +374,7 @@ TAO_ECG_Mcast_Gateway::init_address_server (void) else if (this->address_server_type_ == ECG_ADDRESS_SERVER_SOURCE) { - TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> impl = + PortableServer::Servant_var<TAO_ECG_Complex_Address_Server> impl = TAO_ECG_Complex_Address_Server::create (1); if (!impl.in ()) return 0; @@ -392,7 +388,7 @@ TAO_ECG_Mcast_Gateway::init_address_server (void) else if (this->address_server_type_ == ECG_ADDRESS_SERVER_TYPE) { - TAO_EC_Servant_Var<TAO_ECG_Complex_Address_Server> impl = + PortableServer::Servant_var<TAO_ECG_Complex_Address_Server> impl = TAO_ECG_Complex_Address_Server::create (0); if (!impl.in ()) return 0; @@ -484,13 +480,13 @@ TAO_ECG_Mcast_Gateway::init_handler (TAO_ECG_Dgram_Handler *receiver, return handler; } -TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> +PortableServer::Servant_var<TAO_ECG_UDP_Sender> TAO_ECG_Mcast_Gateway::init_sender ( RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr) { - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender (TAO_ECG_UDP_Sender::create ()); if (!sender.in ()) return sender; @@ -527,13 +523,13 @@ TAO_ECG_Mcast_Gateway::init_sender ( return sender; } -TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> +PortableServer::Servant_var<TAO_ECG_UDP_Receiver> TAO_ECG_Mcast_Gateway::init_receiver ( RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr) { - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver (TAO_ECG_UDP_Receiver::create ()); if (!receiver.in ()) return receiver; @@ -612,7 +608,7 @@ TAO_ECG_Mcast_Gateway::run (CORBA::ORB_ptr orb, address_server_deactivator); TAO_ECG_Refcounted_Endpoint endpoint_rptr; - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender; + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender; // Set up event sender. if (this->service_type_ == ECG_MCAST_SENDER @@ -636,7 +632,7 @@ TAO_ECG_Mcast_Gateway::run (CORBA::ORB_ptr orb, } // Set up event receiver. - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver; + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver; if (this->service_type_ == ECG_MCAST_RECEIVER || this->service_type_ == ECG_MCAST_TWO_WAY) { diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h index e0e03268511..8a588a2dc9e 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h @@ -239,12 +239,12 @@ private: PortableServer::ServantBase * init_address_server (void); - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> + PortableServer::Servant_var<TAO_ECG_UDP_Sender> init_sender (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr); - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> init_receiver (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h index b2bc0405641..76341f6ad02 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.h @@ -35,7 +35,7 @@ public: /// Create a new TAO_ECG_Simple_Address_Server object. /// (Constructor access is restricted to insure that all /// TAO_ECG_Simple_Address_Server objects are heap-allocated.) - static TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> create (void); + static PortableServer::Servant_var<TAO_ECG_Simple_Address_Server> create (void); /// Destructor virtual ~TAO_ECG_Simple_Address_Server (void); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.inl b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.inl index 0aa18cada97..b8ed7f25560 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.inl +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Simple_Address_Server.inl @@ -4,10 +4,10 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> +ACE_INLINE PortableServer::Servant_var<TAO_ECG_Simple_Address_Server> TAO_ECG_Simple_Address_Server::create (void) { - TAO_EC_Servant_Var<TAO_ECG_Simple_Address_Server> s; + PortableServer::Servant_var<TAO_ECG_Simple_Address_Server> s; ACE_NEW_RETURN (s, TAO_ECG_Simple_Address_Server, s); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h index 2cb717b5ac8..3d15661f91d 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.h @@ -113,7 +113,7 @@ public: /// Create a new TAO_ECG_UDP_Receiver object. /// (Constructor access is restricted to insure that all /// TAO_ECG_UDP_Receiver objects are heap-allocated.) - static TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> create (CORBA::Boolean perform_crc = 0); + static PortableServer::Servant_var<TAO_ECG_UDP_Receiver> create (CORBA::Boolean perform_crc = 0); ~TAO_ECG_UDP_Receiver (void); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.inl b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.inl index 130b967dd1d..f344699998c 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.inl +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.inl @@ -66,10 +66,10 @@ TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc) { } -ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> +ACE_INLINE PortableServer::Servant_var<TAO_ECG_UDP_Receiver> TAO_ECG_UDP_Receiver::create (CORBA::Boolean perform_crc) { - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> r; + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> r; ACE_NEW_RETURN (r, TAO_ECG_UDP_Receiver (perform_crc), r); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h index 1ff0410b42a..d449b50cb4b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.h @@ -112,7 +112,7 @@ public: /// Create a new TAO_ECG_UDP_Sender object. /// (Constructor access is restricted to insure that all /// TAO_ECG_UDP_Sender objects are heap-allocated.) - static TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> create (CORBA::Boolean crc = 0); + static PortableServer::Servant_var<TAO_ECG_UDP_Sender> create (CORBA::Boolean crc = 0); ~TAO_ECG_UDP_Sender (void); diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl index db0e235abbd..99ab17a08c5 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Sender.inl @@ -6,10 +6,10 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> +ACE_INLINE PortableServer::Servant_var<TAO_ECG_UDP_Sender> TAO_ECG_UDP_Sender::create (CORBA::Boolean crc) { - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> s; + PortableServer::Servant_var<TAO_ECG_UDP_Sender> s; ACE_NEW_RETURN (s, TAO_ECG_UDP_Sender (crc), s); diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h index 3ddd3c845a9..986268fa7ae 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.h @@ -90,99 +90,6 @@ private: T target_; }; -//*************************************************************************** - -/** - * @class Servant_Var - * - * @brief Provides a type safe counted reference to servants. - */ -template <class T> -class TAO_EC_Servant_Var -{ -public: - //! Constructor. Assumes ownership of \c p. - TAO_EC_Servant_Var(T * p = 0); - - //! Copy constructor. Adds reference to \c rhs. - TAO_EC_Servant_Var(TAO_EC_Servant_Var<T> const & rhs); - - //! Assignment operator. Adds reference to \c rhs. - TAO_EC_Servant_Var<T> & operator=(TAO_EC_Servant_Var<T> const & rhs); - - //! Destructor. Removes a reference from the underlying object, - //! possibly destroying it. - ~TAO_EC_Servant_Var(); - - //! Assignment operator. Assumes ownership of \c p. - TAO_EC_Servant_Var<T> & operator=(T * p); - - //! Template member constructor from a pointer that will implicitly - //! cast to type T. Assumes ownership of \c p. - //! This constructor allows constructs such as: - //! Servant_Base<Base> p(new Derived); - template <class Y> - TAO_EC_Servant_Var(Y * p); - - //! Template member copy constructor from a TAO_EC_Servant_Var<Y>, where - //! Y can be implicitly cast to type T. - template <class Y> - TAO_EC_Servant_Var(TAO_EC_Servant_Var<Y> const & rhs); - - //! Template member assignment operator from a TAO_EC_Servant_Var<Y>, where - //! Y can be implicitly cast to type T. - template <class Y> - TAO_EC_Servant_Var<T> & operator=(TAO_EC_Servant_Var<Y> const & rhs); - - //! Template member assignment operator from a pointer to Y, where Y - //! can be implicitly cast to type T. - template <class Y> - TAO_EC_Servant_Var<T> & operator=(Y * p); - - //! Smart pointer operator-> provides access to the underlying object. - T const * operator->() const; - - //! Smart pointer operator-> provides access to the underlying object. - T * operator->(); - - //! Dereference the underlying object. - T const & operator*() const; - - //! Dereference the underlying object. - T & operator*(); - - //! Return a void pointer to the underlying object. This allows - //! it to be used in conditional code and tested against 0. - operator void const * () const; - - //! As an IN parameter. - T * in() const; - - //! As an INOUT parameter. - T *& inout(); - - //! As an OUT parameter. - T *& out(); - - // Return a pointer to the underlying object, and this counted - // reference will no longer own the object. - T * _retn(); - -private: - T * ptr_; -}; - -//! Compare two TAO_EC_Servant_Vars for equivalence. -template <class X, class Y> -bool operator==(TAO_EC_Servant_Var<X> const & x, - TAO_EC_Servant_Var<Y> const & y); - -//! Compare two TAO_EC_Servant_Vars for non-equivalence. -template <class X, class Y> -bool operator!=(TAO_EC_Servant_Var<X> const & x, - TAO_EC_Servant_Var<Y> const & y); - - TAO_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.inl b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.inl index 5f9083577ae..34a3123876b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.inl +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Lifetime_Utils_T.inl @@ -109,223 +109,5 @@ TAO_EC_Shutdown_Command<T>::execute (void) //*************************************************************************** - TAO_END_VERSIONED_NAMESPACE_DECL -// Life would be much easier if _add_ref() and _remove_ref() -// had throw specs of "throw ()" - -#include <algorithm> - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T>:: -TAO_EC_Servant_Var(T * p) - : ptr_(p) -{ -} - -// If _add_ref throws, this object will not be completely constructed -// so the destructor will not be called. -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T>:: -TAO_EC_Servant_Var(TAO_EC_Servant_Var<T> const & rhs) - : ptr_(rhs.ptr_) -{ - if (ptr_) - { - try - { - ptr_->_add_ref (); - } - catch (...) - { - throw; - } - } -} - -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>:: -operator=(TAO_EC_Servant_Var<T> const & rhs) -{ - TAO_EC_Servant_Var<T> tmp(rhs); - - // std::swap(tmp.ptr_, ptr_); - T * swap_temp = tmp.ptr_; - tmp.ptr_ = ptr_; - ptr_ = swap_temp; - - return *this; -} - -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>:: -operator=(T * p) -{ - TAO_EC_Servant_Var<T> tmp(p); - - // std::swap(tmp.ptr_, ptr_); - T * swap_temp = tmp.ptr_; - tmp.ptr_ = ptr_; - ptr_ = swap_temp; - - return *this; -} - -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T>:: -~TAO_EC_Servant_Var() -{ - // Unfortunately, there is no throw spec on _remove_ref, so we - // can't assume that it will not throw. If it does, then we are in - // trouble. In any event, we can't let the exception escape our - // destructor. - if (ptr_ != 0) - { - try - { - ptr_->_remove_ref (); - } - catch (...) - { - } - } -} - -template <class T> template <class Y> -ACE_INLINE TAO_EC_Servant_Var<T>:: -TAO_EC_Servant_Var(Y * p) - : ptr_(p) -{ -} - -template <class T> template <class Y> -ACE_INLINE TAO_EC_Servant_Var<T>:: -TAO_EC_Servant_Var(TAO_EC_Servant_Var<Y> const & rhs) - : ptr_(rhs.in()) -{ - if (ptr_) - { - ptr_->_add_ref(); - } -} - -template <class T> template <class Y> -ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>:: -operator=(TAO_EC_Servant_Var<Y> const & rhs) -{ - TAO_EC_Servant_Var<T> tmp(rhs); - - // std::swap(tmp.ptr_, ptr_); - T * swap_temp = tmp.ptr_; - tmp.ptr_ = ptr_; - ptr_ = swap_temp; - - return *this; -} - -template <class T> template <class Y> -ACE_INLINE TAO_EC_Servant_Var<T> & TAO_EC_Servant_Var<T>:: -operator=(Y * p) -{ - TAO_EC_Servant_Var<T> tmp(p); - - // std::swap(tmp.ptr_, ptr_); - T * swap_temp = tmp.ptr_; - tmp.ptr_ = ptr_; - ptr_ = swap_temp; - - return *this; -} - -template <class T> -ACE_INLINE T const * TAO_EC_Servant_Var<T>:: -operator->() const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T * TAO_EC_Servant_Var<T>:: -operator->() -{ - return ptr_; -} - -template <class T> -ACE_INLINE T const & TAO_EC_Servant_Var<T>:: -operator*() const -{ - return *ptr_; -} - -template <class T> -ACE_INLINE T & TAO_EC_Servant_Var<T>:: -operator*() -{ - return *ptr_; -} - -template <class T> -ACE_INLINE TAO_EC_Servant_Var<T>:: -operator void const * () const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T * TAO_EC_Servant_Var<T>:: -in() const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T *& TAO_EC_Servant_Var<T>:: -inout() -{ - return ptr_; -} - -template <class T> -ACE_INLINE T *& TAO_EC_Servant_Var<T>:: -out() -{ - TAO_EC_Servant_Var<T> tmp; - - // std::swap(tmp.ptr_, ptr_); - T * swap_temp = tmp.ptr_; - tmp.ptr_ = ptr_; - ptr_ = swap_temp; - - return ptr_; -} - -template <class T> -ACE_INLINE T * TAO_EC_Servant_Var<T>:: -_retn() -{ - T * rval = ptr_; - ptr_ = 0; - return rval; -} - -template <class X, class Y> -ACE_INLINE bool -operator==(TAO_EC_Servant_Var<X> const & x, - TAO_EC_Servant_Var<Y> const & y) -{ - return x.in() == y.in(); -} - -template <class X, class Y> -ACE_INLINE bool -operator!=(TAO_EC_Servant_Var<X> const & x, - TAO_EC_Servant_Var<Y> const & y) -{ - return x.in() != y.in(); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp index aaffd1ee6a0..d4c4d253821 100644 --- a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp +++ b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp @@ -172,7 +172,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } // Now we setup the sender: - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender; + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender; sender = TAO_ECG_UDP_Sender::create(); sender->init (event_channel.in (), @@ -194,7 +194,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) sender->connect (sub); // To receive events we need to setup an event handler: - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver; + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver; receiver = TAO_ECG_UDP_Receiver::create(); TAO_ECG_Mcast_EH mcast_eh (&*receiver); diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h index c9d20cce869..8a7d89da3a4 100644 --- a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h +++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h @@ -141,7 +141,7 @@ private: char** consumer_names_; CORBA::ULong* consumer_ipaddr_; - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender_; + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender_; // The sender TAO_EC_Simple_AddrServer addr_server_; @@ -345,7 +345,7 @@ private: // The last time we changed our publication, so we don't change too // often. - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver_; + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver_; // This object reads the events and pushes them into the EC. Notice // that it can receive events from multiple Event Handlers. diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp index ce760d23290..4d7b998dd0a 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp @@ -10,10 +10,10 @@ EC_Wrapper::EC_Wrapper (void) { } -TAO_EC_Servant_Var<EC_Wrapper> +PortableServer::Servant_var<EC_Wrapper> EC_Wrapper::create (void) { - TAO_EC_Servant_Var<EC_Wrapper> w; + PortableServer::Servant_var<EC_Wrapper> w; ACE_NEW_RETURN (w, EC_Wrapper, w); diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h index 83874c32241..56b377c7878 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h @@ -32,7 +32,7 @@ public: /// Create a new EC_Wrapper object. /// (Constructor access is restricted to insure that all /// EC_Wrapper objects are heap-allocated.) - static TAO_EC_Servant_Var<EC_Wrapper> create (void); + static PortableServer::Servant_var<EC_Wrapper> create (void); /// Destructor. Destroys the Event Channel implementation. virtual ~EC_Wrapper (void); @@ -72,7 +72,7 @@ private: /// Event Channel implementation. /* * Once Event Channel implementation is made reference-counted, this - * pointer should turn into a Servant_Var. + * pointer should turn into a Servant_var. */ TAO_EC_Event_Channel *ec_impl_; diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp index 9b3800d166d..943195e2bb9 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp @@ -105,7 +105,7 @@ Gateway_EC::run (int argc, ACE_TCHAR ** argv) manager->activate (); // Set up EC. - TAO_EC_Servant_Var<EC_Wrapper> ec_wrapper (EC_Wrapper::create ()); + PortableServer::Servant_var<EC_Wrapper> ec_wrapper (EC_Wrapper::create ()); if (!ec_wrapper.in ()) return -1; diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp index e2d4ebd7219..bc9c677cd1d 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp @@ -157,7 +157,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) return 1; // Create the consumer and register it with POA. - TAO_EC_Servant_Var<EC_Consumer> consumer_impl = + PortableServer::Servant_var<EC_Consumer> consumer_impl = new EC_Consumer (orb, ec); if (!consumer_impl.in ()) diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp index 50216f31ff9..6940a518994 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp @@ -150,7 +150,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) RtecUDPAdmin::AddrServer::_narrow(tmpobj.in()); // Create and initialize the sender object - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender = + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender = TAO_ECG_UDP_Sender::create(); TAO_ECG_UDP_Out_Endpoint endpoint; // need to be explicit about the address type when built with @@ -179,7 +179,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) sender->connect (sub); // Create and initialize the receiver - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver = + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver = TAO_ECG_UDP_Receiver::create(); // TAO_ECG_UDP_Receiver::init() takes a TAO_ECG_Refcounted_Endpoint. diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp index ce905b3945c..2738362a2a6 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp @@ -126,7 +126,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) return 1; // Create the consumer and register it with POA. - TAO_EC_Servant_Var<EC_Consumer> consumer_impl = + PortableServer::Servant_var<EC_Consumer> consumer_impl = new EC_Consumer (orb, ec); if (!consumer_impl.in ()) diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp index 90e1eda5d73..3ac17021462 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp @@ -571,7 +571,7 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { // We may want this to be alive beyond the next block. - TAO_EC_Servant_Var<Heartbeat_Application> app; + PortableServer::Servant_var<Heartbeat_Application> app; try { diff --git a/TAO/orbsvcs/tests/Event/UDP/receiver.cpp b/TAO/orbsvcs/tests/Event/UDP/receiver.cpp index 6ecc827b526..2b94d185d48 100644 --- a/TAO/orbsvcs/tests/Event/UDP/receiver.cpp +++ b/TAO/orbsvcs/tests/Event/UDP/receiver.cpp @@ -155,7 +155,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_ES_EVENT_SOURCE_ANY; // Any source is OK // To receive events we need to setup an event handler: - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver = TAO_ECG_UDP_Receiver::create(); + PortableServer::Servant_var<TAO_ECG_UDP_Receiver> receiver = + TAO_ECG_UDP_Receiver::create(); TAO_ECG_Mcast_EH mcast_eh (&(*receiver)); // The event handler uses the ORB reactor to wait for multicast diff --git a/TAO/orbsvcs/tests/Event/UDP/sender.cpp b/TAO/orbsvcs/tests/Event/UDP/sender.cpp index bb2955b1c44..3a83d94c10d 100644 --- a/TAO/orbsvcs/tests/Event/UDP/sender.cpp +++ b/TAO/orbsvcs/tests/Event/UDP/sender.cpp @@ -139,7 +139,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } // Now we setup the sender: - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender = TAO_ECG_UDP_Sender::create(); + PortableServer::Servant_var<TAO_ECG_UDP_Sender> sender = + TAO_ECG_UDP_Sender::create(); sender->init (event_channel.in (), address_server.in (), endpoint); |