summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/performance-tests
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-05-07 16:24:44 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-05-07 16:24:44 +0000
commit697540d80c4b08bde7781323f3cb5b41907d01b8 (patch)
treee248b3d248d1f6536da057e14faccd62d2df7825 /TAO/orbsvcs/performance-tests
parentc7ba4c75ddc819804a4ec3d62e51657cb4363b2a (diff)
downloadATCD-697540d80c4b08bde7781323f3cb5b41907d01b8.tar.gz
Fri May 7 10:34:24 2004 Carlos O'Ryan <coryan@atdesk.com>
Diffstat (limited to 'TAO/orbsvcs/performance-tests')
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp6
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h4
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl2
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.cpp61
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.h58
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.inl19
-rw-r--r--TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp7
8 files changed, 10 insertions, 149 deletions
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp
index fecdc263dd7..71562c11e2d 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp
@@ -10,7 +10,6 @@
#include "Client_Options.h"
#include "Implicit_Deactivator.h"
#include "Shutdown.h"
-#include "Auto_Functor.h"
#include "ORB_Task.h"
#include "ORB_Task_Activator.h"
@@ -18,6 +17,7 @@
#include "tao/RTPortableServer/RTPortableServer.h"
#include "tao/Strategies/advanced_resource.h"
#include "tao/Messaging/Messaging.h"
+#include "ace/Auto_Functor.h"
#include "ace/Auto_Ptr.h"
#include "ace/High_Res_Timer.h"
#include "ace/Basic_Stats.h"
@@ -93,7 +93,7 @@ public:
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
+ ACE_Utils::Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
for (int i = 0; i != this->iterations_; ++i)
{
@@ -158,7 +158,7 @@ public:
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
+ ACE_Utils::Auto_Functor<Test::Session,Shutdown<Test::Session> > auto_shutdown (session.in ());
for (;;)
{
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp
index 79426e39a24..5acd660e5c4 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.cpp
@@ -17,7 +17,7 @@
template<class Client> Auto_Disconnect<Client>&
Auto_Disconnect<Client>::operator= (Client *client)
{
- this->Auto_Functor<Client,Disconnect<Client> >::operator= (client);
+ this->reset(client);
return *this;
}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
index 5e70bcf06e0..8b99c64b433 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.h
@@ -8,8 +8,8 @@
#ifndef TAO_PERF_RTEC_AUTO_DISCONNECT_H
#define TAO_PERF_RTEC_AUTO_DISCONNECT_H
-#include "Auto_Functor.h"
#include "tao/corba.h"
+#include "ace/Auto_Functor.h"
/**
* @class Disconnect
@@ -30,7 +30,7 @@ public:
* RTEC client.
*/
template<class Client>
-class Auto_Disconnect : public Auto_Functor<Client,Disconnect<Client> >
+class Auto_Disconnect : public ACE_Utils::Auto_Functor<Client,Disconnect<Client> >
{
public:
/// Constructor
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl
index 84c0df08c1b..52bb76e1740 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Disconnect.inl
@@ -15,6 +15,6 @@ Disconnect<Client>::operator () (Client *client
template<class Client> ACE_INLINE
Auto_Disconnect<Client>::Auto_Disconnect (Client *client)
- : Auto_Functor<Client,Disconnect<Client> > (client)
+ : ACE_Utils::Auto_Functor<Client,Disconnect<Client> > (client)
{
}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.cpp
deleted file mode 100644
index 1145ea6f18a..00000000000
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file Auto_Functor.cpp
- *
- * $Id$
- *
- * @author Carlos O'Ryan <coryan@uci.edu>
- */
-#ifndef TAO_PERF_RTEC_AUTO_FUNCTOR_CPP
-#define TAO_PERF_RTEC_AUTO_FUNCTOR_CPP
-
-#include "Auto_Functor.h"
-#include "tao/Environment.h"
-#include "ace/Swap.h"
-
-#if !defined(__ACE_INLINE__)
-#include "Auto_Functor.inl"
-#endif /* __ACE_INLINE__ */
-
-template<class Client, class Functor>
-Auto_Functor<Client,Functor>::Auto_Functor (const Auto_Functor<Client,Functor> &rhs)
- : client_ (0)
-{
- ACE_Swap<Client*>::swap (this->client_, rhs.client_);
-}
-
-template<class Client, class Functor> Auto_Functor<Client,Functor>&
-Auto_Functor<Client,Functor>::operator= (const Auto_Functor<Client,Functor> &rhs)
-{
- Auto_Functor<Client,Functor> tmp (rhs);
- ACE_Swap<Client*>::swap (this->client_, tmp.client_);
- return *this;
-}
-
-template<class Client, class Functor>
-Auto_Functor<Client,Functor>::~Auto_Functor ()
-{
- if (this->client_ == 0)
- return;
-
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY {
- Functor functor;
- functor (this->client_
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- } ACE_CATCHANY {
- // @@ TODO This event should be logged. Cannot throw because that
- // would make it impossible to use this class effectively.
- // Read Servant_var.cpp for more details.
- } ACE_ENDTRY;
-}
-
-template<class Client, class Functor> Auto_Functor<Client,Functor>&
-Auto_Functor<Client,Functor>::operator= (Client *client)
-{
- Auto_Functor<Client,Functor> tmp (client);
- ACE_Swap<Client*>::swap (this->client_, tmp.client_);
- return *this;
-}
-
-#endif /* TAO_PERF_RTEC_AUTO_FUNCTOR_CPP */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.h
deleted file mode 100644
index 3217452d6ba..00000000000
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file Auto_Functor.h
- *
- * $Id$
- *
- * @author Carlos O'Ryan <coryan@uci.edu>
- */
-#ifndef TAO_PERF_RTEC_AUTO_FUNCTOR_H
-#define TAO_PERF_RTEC_AUTO_FUNCTOR_H
-
-#include "ace/config-all.h"
-
-/**
- * @class Auto_Functor
- *
- * @brief Automatically invoke the disconnect() operation on some
- * RTEC client.
- *
- * @todo This template can be extended to work with non-pointer
- * arguments, but needs a little work to get there (and some
- * specializations of the swap() method).
- */
-template<class Client, class Functor>
-class Auto_Functor
-{
-public:
- /// Constructor
- /**
- * @param client The client
- */
- ACE_EXPLICIT Auto_Functor (Client *s = 0);
- Auto_Functor (const Auto_Functor<Client,Functor>& rhs);
- Auto_Functor<Client,Functor>& operator= (const Auto_Functor<Client,Functor>& rhs);
-
- /// Destructor
- ~Auto_Functor (void);
-
- /// Assignment operator
- Auto_Functor<Client,Functor>& operator= (Client *client);
-
- /// Release the client, i.e. the destructor does not call any
- /// methods.
- void release (void);
-
-private:
- /// The client
- Client *client_;
-};
-
-#if defined(__ACE_INLINE__)
-#include "Auto_Functor.inl"
-#endif /* __ACE_INLINE__ */
-
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Auto_Functor.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#endif /* TAO_PERF_RTEC_AUTO_FUNCTOR_H */
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.inl b/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.inl
deleted file mode 100644
index c76f3f5b1b8..00000000000
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Auto_Functor.inl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * @file Auto_Functor.inl
- *
- * $Id$
- *
- * @author Carlos O'Ryan <coryan@uci.edu>
- */
-
-template<class Client, class Functor> ACE_INLINE
-Auto_Functor<Client,Functor>::Auto_Functor (Client *client)
- : client_ (client)
-{
-}
-
-template<class Client, class Functor> ACE_INLINE void
-Auto_Functor<Client,Functor>::release (void)
-{
- this->client_ = 0;
-}
diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp
index 3b5b84d224d..86f846853d5 100644
--- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp
+++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp
@@ -9,7 +9,6 @@
#include "Control.h"
#include "ORB_Shutdown.h"
#include "Shutdown.h"
-#include "Auto_Functor.h"
#include "Auto_Disconnect.h"
#include "orbsvcs/orbsvcs/Event_Service_Constants.h"
@@ -61,10 +60,10 @@ Control::join (Federated_Test::Peer_ptr peer
}
/// Automatically shutdown the ORB
- Auto_Functor<CORBA::ORB,ORB_Shutdown> orb_shutdown (this->orb_.in ());
+ ACE_Utils::Auto_Functor<CORBA::ORB,ORB_Shutdown> orb_shutdown (this->orb_.in ());
/// Automatically shutdown the peers
- typedef Auto_Functor<Federated_Test::Peer,Shutdown<Federated_Test::Peer> > Peer_Shutdown;
+ typedef ACE_Utils::Auto_Functor<Federated_Test::Peer,Shutdown<Federated_Test::Peer> > Peer_Shutdown;
ACE_Auto_Basic_Array_Ptr<Peer_Shutdown> peer_shutdown (
new Peer_Shutdown[this->peers_count_]
);
@@ -72,7 +71,7 @@ Control::join (Federated_Test::Peer_ptr peer
size_t i;
for (i = 0; i != this->peers_count_; ++i)
{
- peer_shutdown[i] = this->peers_[i].in ();
+ peer_shutdown[i].reset(this->peers_[i].in());
}
ACE_DEBUG ((LM_DEBUG,