diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-10-27 17:52:08 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-10-27 17:52:08 +0000 |
commit | dac602c36c0f832296475c695ae297dd313248f1 (patch) | |
tree | ce30d2a1b75653ab9df8a39bf112e295e8aa09ea /TAO/tao/Utils | |
parent | 710de5b760fa3228ceb6f59baf5e49292e32d40c (diff) | |
download | ATCD-dac602c36c0f832296475c695ae297dd313248f1.tar.gz |
Wed Oct 27 17:45:45 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* docs/idltocpp0x/IDLC++0xRFP.odt:
Updated to new draft
* orbsvcs/performance-tests/RTEvent/lib/RIR_Narrow.cpp:
Unicode fixes
* tao/Utils/Server_Main.h:
* tao/Utils/Server_Main.cpp:
Layout changes
* tao/Utils/Utils.mpc:
* tao/Utils/Servant_Var.h:
* tao/Utils/Servant_Var.inl:
* tao/Utils/Servant_Var.cpp:
Removed Servant_Var
Diffstat (limited to 'TAO/tao/Utils')
-rw-r--r-- | TAO/tao/Utils/Servant_Var.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/Utils/Servant_Var.h | 174 | ||||
-rw-r--r-- | TAO/tao/Utils/Servant_Var.inl | 200 | ||||
-rw-r--r-- | TAO/tao/Utils/Server_Main.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/Utils/Server_Main.h | 7 | ||||
-rw-r--r-- | TAO/tao/Utils/Utils.mpc | 1 |
6 files changed, 7 insertions, 401 deletions
diff --git a/TAO/tao/Utils/Servant_Var.cpp b/TAO/tao/Utils/Servant_Var.cpp deleted file mode 100644 index 99d6cfda1bb..00000000000 --- a/TAO/tao/Utils/Servant_Var.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ - -#ifndef TAO_UTILS_SERVANT_VAR_CPP -#define TAO_UTILS_SERVANT_VAR_CPP - -#include "tao/Utils/Servant_Var.h" - -#if !defined (__ACE_INLINE__) -# include "tao/Utils/Servant_Var.inl" -#endif /* __ACE_INLINE__ */ - -#endif /*TAO_UTILS_SERVANT_VAR_CPP*/ diff --git a/TAO/tao/Utils/Servant_Var.h b/TAO/tao/Utils/Servant_Var.h deleted file mode 100644 index 3c5d6362e6e..00000000000 --- a/TAO/tao/Utils/Servant_Var.h +++ /dev/null @@ -1,174 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Var.h - * - * $Id$ - * - * @author Jody Hagins <jody@atdesk.com> - * @author Carlos O'Ryan <coryan@atdesk.com> - * - * @deprecated Use PortableServer::Servant_var instead. - */ -//============================================================================= - -#ifndef TAO_UTILS_SERVANT_VAR_H -#define TAO_UTILS_SERVANT_VAR_H -#include /**/ "ace/pre.h" -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Utils - { - - /** - * @class Servant_Var - * - * @brief Provides a type safe counted reference to servants. - * - * @author Jody Hagins - * - * @todo Life would be much easier if _add_ref() and _remove_ref() had - * throw specs of "throw ()", that can be hidden in static - * methods though. - */ - template<class T> - class Servant_Var - { - public: - typedef T Servant_Type; - - /// Constructor. Assumes ownership of @c p. - Servant_Var(T * p = 0); - - /// Copy constructor. Adds reference to @c rhs. - Servant_Var(Servant_Var<T> const & rhs); - - /// Assignment operator. Adds reference to @c rhs. - Servant_Var<T> & operator=(Servant_Var<T> const & rhs); - - /// Destructor. Removes a reference from the underlying object, - /// possibly destroying it. - ~Servant_Var() throw (); - - /// Assignment operator. Assumes ownership of @c p. - Servant_Var<T> & operator=(T * p); - -# if !defined(ACE_LACKS_MEMBER_TEMPLATES) - /// 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> - Servant_Var(Y * p); - - /// Template member copy constructor from a Servant_Var<Y>, where - /// Y can be implicitly cast to type T. - template <class Y> - Servant_Var(Servant_Var<Y> const & rhs); - - /// Template member assignment operator from a Servant_Var<Y>, where - /// Y can be implicitly cast to type T. - template <class Y> - Servant_Var<T> & operator=(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> - Servant_Var<T> & operator=(Y * p); -# endif /* ACE_LACKS_MEMBER_TEMPLATES */ - - /// 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(); - - /// Increment the reference count and return the servant. - /** - * It is safe to pass in a null pointer, the pointer is simply - * returned in that case. - * - * @todo We might want to add a throw spec and catch all (potential) - * exceptions in _add_ref() - * - * @todo It might be useful to add an _release() method that handles - * any potential exceptions... - */ - static T * _duplicate (T *); - - /// Swap the contents of a Servant_Var<T> with another - /// Servant_Var<T> - /** - * Often used to implement strong exception safety. - */ - void swap(Servant_Var<T> & rhs) throw (); - - private: - T * ptr_; - }; - -#ifndef ACE_LACKS_MEMBER_TEMPLATES - /// Compare two Servant_Vars for equivalence. - template <class X, class Y> - bool operator==(Servant_Var<X> const & x, - Servant_Var<Y> const & y); - - /// Compare two Servant_Vars for non-equivalence. - template <class X, class Y> - bool operator!=(Servant_Var<X> const & x, - Servant_Var<Y> const & y); -#endif /* ! ACE_LACKS_MEMBER_TEMPLATES */ - - } // namespace Utils -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/Utils/Servant_Var.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/Utils/Servant_Var.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Servant_Var.cpp") -#endif - -#include /**/ "ace/post.h" -#endif /*TAO_UTILS_SERVANT_VAR_H*/ diff --git a/TAO/tao/Utils/Servant_Var.inl b/TAO/tao/Utils/Servant_Var.inl deleted file mode 100644 index 8c7c03374be..00000000000 --- a/TAO/tao/Utils/Servant_Var.inl +++ /dev/null @@ -1,200 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include <algorithm> - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template <class T> -ACE_INLINE T * -TAO::Utils::Servant_Var<T>::_duplicate (T * p) -{ - if (p != 0) - { - p->_add_ref (); - } - - return p; -} - -template <class T> -ACE_INLINE void -TAO::Utils::Servant_Var<T>::swap (Servant_Var<T> & rhs) throw () -{ - std::swap (this->ptr_, rhs.ptr_); -} - -template <class T> -ACE_INLINE TAO::Utils::Servant_Var<T>::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::Utils::Servant_Var<T>::Servant_Var (Servant_Var<T> const & rhs) - : ptr_ (Servant_Var<T>::_duplicate(rhs.ptr_)) -{ -} - -template <class T> -ACE_INLINE TAO::Utils::Servant_Var<T> & -TAO::Utils::Servant_Var<T>::operator= (Servant_Var<T> const & rhs) -{ - TAO::Utils::Servant_Var<T> tmp (rhs); - this->swap (tmp); - return *this; -} - -template <class T> -ACE_INLINE typename TAO::Utils::Servant_Var<T> & -TAO::Utils::Servant_Var<T>::operator= (T * p) -{ - if (this->ptr_ != p) - { - // This constructor doesn't increase the reference count so we - // we must check for self-assignment. Otherwise the reference - // count would be prematurely decremented upon exiting this - // scope. - TAO::Utils::Servant_Var<T> tmp (p); - this->swap (tmp); - } - - return *this; -} - -template <class T> ACE_INLINE -TAO::Utils::Servant_Var<T>::~Servant_Var (void) throw () -{ - if (ptr_ != 0) - { - ptr_->_remove_ref (); - } -} - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) -template <class T> template <class Y> -ACE_INLINE TAO::Utils::Servant_Var<T>::Servant_Var (Y * p) - : ptr_ (p) -{ -} - -template <class T> template <class Y> -ACE_INLINE TAO::Utils::Servant_Var<T>::Servant_Var (Servant_Var<Y> const & rhs) - : ptr_ (Servant_Var<T>::_duplicate (rhs.in ())) -{ -} - -template <class T> template <class Y> -ACE_INLINE typename TAO::Utils::Servant_Var<T> & -TAO::Utils::Servant_Var<T>:: -operator=(Servant_Var<Y> const & rhs) -{ - TAO::Utils::Servant_Var<T> tmp (rhs); - this->swap (tmp); - return *this; -} - -template <class T> template <class Y> -ACE_INLINE typename TAO::Utils::Servant_Var<T> & -TAO::Utils::Servant_Var<T>::operator= (Y * p) -{ - if (this->ptr_ != p) - { - // This constructor doesn't increase the reference count so we - // we must check for self-assignment. Otherwise the reference - // count would be prematurely decremented upon exiting this - // scope. - TAO::Utils::Servant_Var<T> tmp (p); - this->swap (tmp); - } - - return *this; -} -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -template <class T> -ACE_INLINE T const * -TAO::Utils::Servant_Var<T>::operator->() const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T * -TAO::Utils::Servant_Var<T>::operator->() -{ - return ptr_; -} - -template <class T> -ACE_INLINE T const & TAO::Utils::Servant_Var<T>::operator*() const -{ - return *ptr_; -} - -template <class T> -ACE_INLINE T & TAO::Utils::Servant_Var<T>::operator*() -{ - return *ptr_; -} - -template <class T> -ACE_INLINE TAO::Utils::Servant_Var<T>::operator void const * () const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T * -TAO::Utils::Servant_Var<T>::in (void) const -{ - return ptr_; -} - -template <class T> -ACE_INLINE T *& -TAO::Utils::Servant_Var<T>::inout (void) -{ - return ptr_; -} - -template <class T> -ACE_INLINE T *& -TAO::Utils::Servant_Var<T>::out (void) -{ - TAO::Utils::Servant_Var<T> tmp; - this->swap (tmp); - return ptr_; -} - -template <class T> -ACE_INLINE T * -TAO::Utils::Servant_Var<T>::_retn (void) -{ - T * rval = ptr_; - ptr_ = 0; - return rval; -} - -#if !defined (ACE_LACKS_MEMBER_TEMPLATES) -template <class X, class Y> -ACE_INLINE bool -operator== (typename TAO::Utils::Servant_Var<X> const & x, - typename TAO::Utils::Servant_Var<Y> const & y) -{ - return x.in () == y.in (); -} - -template <class X, class Y> -ACE_INLINE bool -operator!= (typename TAO::Utils::Servant_Var<X> const & x, - typename TAO::Utils::Servant_Var<Y> const & y) -{ - return x.in () != y.in (); -} -#endif /* ! ACE_LACKS_MEMBER_TEMPLATES */ - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Utils/Server_Main.cpp b/TAO/tao/Utils/Server_Main.cpp index cdba47cbfc6..e2387d9d2eb 100644 --- a/TAO/tao/Utils/Server_Main.cpp +++ b/TAO/tao/Utils/Server_Main.cpp @@ -42,17 +42,13 @@ int TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) { int result = 0; - // hide unicode if necessary. - ACE_Argv_Type_Converter command_line (argc, argv); - - ACE_TCHAR ** asciiArgv = command_line.get_TCHAR_argv (); try { // Initialize the orb CORBA::ORB_var orb = - CORBA::ORB_init (argc, asciiArgv, name_); + CORBA::ORB_init (argc, argv, name_); if (! ::CORBA::is_nil(orb.in ())) { @@ -69,7 +65,7 @@ TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) if (result == 0) { ACE_ERROR ((LM_INFO, - "%T %s (%P|%t) Ready %s\n", name_, servant.identity () + "%T %C (%P|%t) Ready %C\n", name_, servant.identity () )); ////////////////////////////////// @@ -91,7 +87,7 @@ TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) orb->shutdown (1); ACE_ERROR ((LM_INFO, - "%T %s (%P|%t) Terminated normally. %s\n", + "%T %C (%P|%t) Terminated normally. %C\n", name_, servant.identity () )); @@ -99,7 +95,7 @@ TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) else { ACE_ERROR ((LM_ERROR, - "%T %s (%P|%t) Registration failed: %m\n", name_ + "%T %C (%P|%t) Registration failed: %m\n", name_ )); result = -1; } @@ -107,7 +103,7 @@ TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) else { ACE_ERROR ((LM_ERROR, - "%T %s (%P|%t) ORB manager init failed\n", name_ + "%T %C (%P|%t) ORB manager init failed\n", name_ )); result = -1; } diff --git a/TAO/tao/Utils/Server_Main.h b/TAO/tao/Utils/Server_Main.h index 8054c5cd5f9..fd563ecb9c8 100644 --- a/TAO/tao/Utils/Server_Main.h +++ b/TAO/tao/Utils/Server_Main.h @@ -59,6 +59,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/orbconf.h" +#include "ace/Copy_Disabled.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -67,7 +68,7 @@ namespace TAO namespace Utils { template <typename SERVANT> - class Server_Main + class Server_Main : private ACE_Copy_Disabled { public: Server_Main(const char * name); @@ -76,10 +77,6 @@ namespace TAO int run (int argc, ACE_TCHAR *argv[]); private: - Server_Main( const Server_Main &); - Server_Main & operator = (const Server_Main &); - - private: const char * name_; }; } // namespace UTILS diff --git a/TAO/tao/Utils/Utils.mpc b/TAO/tao/Utils/Utils.mpc index 04df38ff1ab..70a2631a5dc 100644 --- a/TAO/tao/Utils/Utils.mpc +++ b/TAO/tao/Utils/Utils.mpc @@ -5,7 +5,6 @@ project (TAO_Utils) : taolib, tao_output, install, portableserver, pi { Template_Files { RIR_Narrow.cpp - Servant_Var.cpp Server_Main.cpp } |