diff options
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Common')
12 files changed, 104 insertions, 161 deletions
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppHelper.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppHelper.h index 27aaab8a148..1d9c9cbc332 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppHelper.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppHelper.h @@ -70,7 +70,6 @@ struct RefHelper struct CSD_TP_Test_Export AppHelper { - static void ref_to_file(CORBA::ORB_ptr orb, CORBA::Object_ptr obj, const ACE_TCHAR* filename); diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h index a8307ab45b4..bbc8ba0cd90 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/AppShutdown.h @@ -7,29 +7,27 @@ class CSD_TP_Test_Export AppShutdown { - public: +public: + AppShutdown(); + virtual ~AppShutdown(); - AppShutdown(); - virtual ~AppShutdown(); + void init(CORBA::ORB_ptr orb, + unsigned num_clients); - void init(CORBA::ORB_ptr orb, - unsigned num_clients); + void wait (); - void wait (); + void client_done(); - void client_done(); + static AppShutdown* instance (); - static AppShutdown* instance (); +private: + CORBA::ORB_var orb_; + unsigned num_clients_; + ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned> num_clients_shutdown_; - private: - CORBA::ORB_var orb_; - unsigned num_clients_; - ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned> num_clients_shutdown_; - - OrbShutdownTask orb_shutdown_task_; + OrbShutdownTask orb_shutdown_task_; }; - #define TheAppShutdown AppShutdown::instance() #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h index 0a1ce4c76fc..8690c061ff8 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientEngine.h @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file ClientEngine.h @@ -18,19 +16,16 @@ #include "ace/Synch.h" #include "ace/CORBA_macros.h" - class ClientEngine; typedef TAO_Intrusive_Ref_Count_Handle<ClientEngine> ClientEngine_Handle; - class CSD_TP_Test_Export ClientEngine : public TAO_Intrusive_Ref_Count_Base<TAO_SYNCH_MUTEX> { - public: - - ClientEngine(); - virtual ~ClientEngine(); +public: + ClientEngine(); + virtual ~ClientEngine(); - virtual bool execute(void) = 0; + virtual bool execute(void) = 0; }; #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h index ed41fc51f39..29f046e1055 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ClientTask.h @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file ClientTask.h @@ -17,30 +15,27 @@ #include "ace/Vector_T.h" #include "ace/Synch.h" - class CSD_TP_Test_Export ClientTask : public ACE_Task_Base { - public: - - ClientTask(bool shutdown_after_done = false); - virtual ~ClientTask(); - - void add_engine(ClientEngine* engine); +public: + ClientTask(bool shutdown_after_done = false); + virtual ~ClientTask(); - virtual int open(void* arg = 0); - virtual int svc(); - virtual int close(u_long); + void add_engine(ClientEngine* engine); - unsigned failure_count () const; + virtual int open(void* arg = 0); + virtual int svc(); + virtual int close(u_long); - private: + unsigned failure_count () const; - typedef ACE_Vector<ClientEngine_Handle> EngineVector; +private: + typedef ACE_Vector<ClientEngine_Handle> EngineVector; - TAO_SYNCH_MUTEX lock_; - EngineVector engines_; - bool shutdown_after_done_; - unsigned failure_count_; + TAO_SYNCH_MUTEX lock_; + EngineVector engines_; + bool shutdown_after_done_; + unsigned failure_count_; }; #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbRunner.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbRunner.h index 36fff3dd607..c2d1b7a9d91 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbRunner.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbRunner.h @@ -6,18 +6,15 @@ class CSD_TP_Test_Export OrbRunner { - public: +public: + OrbRunner(CORBA::ORB_ptr orb, unsigned num_orb_threads = 1); + virtual ~OrbRunner(); - OrbRunner(CORBA::ORB_ptr orb, unsigned num_orb_threads = 1); - virtual ~OrbRunner(); + void run(); - void run(void); - - - private: - - CORBA::ORB_var orb_; - unsigned num_orb_threads_; +private: + CORBA::ORB_var orb_; + unsigned num_orb_threads_; }; #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp index e0932bd4c38..e97050db4a0 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.cpp @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file OrbShutdownTask.cpp @@ -12,24 +10,16 @@ #include "ace/CORBA_macros.h" #include "ace/OS_NS_unistd.h" - OrbShutdownTask::OrbShutdownTask() { } - -OrbShutdownTask::~OrbShutdownTask() -{ -} - - void OrbShutdownTask::orb(CORBA::ORB_ptr orb) { this->orb_ = CORBA::ORB::_duplicate(orb); } - int OrbShutdownTask::open(void*) { diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.h index 9197b8083d5..94b63769026 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbShutdownTask.h @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file OrbShutdownTask.h @@ -15,24 +13,20 @@ #include "ace/Task.h" #include "tao/ORB.h" - class CSD_TP_Test_Export OrbShutdownTask : public ACE_Task_Base { - public: - - OrbShutdownTask(); - virtual ~OrbShutdownTask(); - - void orb(CORBA::ORB_ptr orb); - - virtual int open(void*); - virtual int svc(); - virtual int close(u_long); +public: + OrbShutdownTask(); + virtual ~OrbShutdownTask() = default; + void orb(CORBA::ORB_ptr orb); - private: + virtual int open(void*); + virtual int svc(); + virtual int close(u_long); - CORBA::ORB_var orb_; +private: + CORBA::ORB_var orb_; }; #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.cpp index 758b9b2d833..097c6c1f494 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.cpp +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.cpp @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file OrbTask.cpp @@ -13,19 +11,12 @@ namespace { enum { MAX_ORB_TASK_WORKER_THREADS = 20 }; } - OrbTask::OrbTask(CORBA::ORB_ptr orb, unsigned num_threads) : orb_(CORBA::ORB::_duplicate(orb)), num_threads_(num_threads) { } - -OrbTask::~OrbTask() -{ -} - - int OrbTask::open(void*) { @@ -87,7 +78,6 @@ OrbTask::svc() return 0; } - int OrbTask::close(u_long) { diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.h index dcacb31119d..e7d61ee0b18 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/OrbTask.h @@ -1,5 +1,3 @@ -// This may look like C, but it's really -*- C++ -*- - //============================================================================= /** * @file OrbTask.h @@ -17,20 +15,17 @@ class CSD_TP_Test_Export OrbTask : public ACE_Task_Base { - public: - - OrbTask(CORBA::ORB_ptr orb, unsigned num_threads = 1); - virtual ~OrbTask(); - - virtual int open(void* x = 0); - virtual int svc(); - virtual int close(u_long); - +public: + OrbTask(CORBA::ORB_ptr orb, unsigned num_threads = 1); + ~OrbTask() override = default; - private: + int open(void* x = 0) override; + int svc() override; + int close(u_long) override; - CORBA::ORB_var orb_; - unsigned num_threads_; +private: + CORBA::ORB_var orb_; + unsigned num_threads_; }; #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h index 20607775fd3..f8670e65903 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h @@ -5,51 +5,47 @@ #include "tao/PortableServer/Servant_Base.h" #include "ace/Vector_T.h" - // The T type is a concrete servant type. template <class T> class ServantList { - public: - - typedef typename T::_stub_type T_stub; - typedef typename T::_stub_ptr_type T_stub_ptr; - typedef typename T::_stub_var_type T_stub_var; - - ServantList(); - ~ServantList(); - - /// Activate servant and output ior to a file. - void create_and_activate(unsigned num_servants, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const ACE_TCHAR* ior_fname_prefix); - - /// Activate servant and not output ior to a file. - void create_and_activate(unsigned num_servants, - PortableServer::POA_ptr poa); - - // Code not used and not working right now - possible future addition. - //void deactivate(PortableServer::POA_ptr poa); - - /// Get a (copy) of one of the object references (for a specific servant). - T_stub_ptr objref(unsigned index); - /// This doesn't return a copy. - T* servant(unsigned index); - - - private: - - struct ServantRecord - { - T* servant_; - PortableServer::ServantBase_var safe_servant_; - T_stub_var obj_; - }; - - typedef ACE_Vector<ServantRecord> ServantRecordVector; - - ServantRecordVector servant_records_; +public: + typedef typename T::_stub_type T_stub; + typedef typename T::_stub_ptr_type T_stub_ptr; + typedef typename T::_stub_var_type T_stub_var; + + ServantList(); + ~ServantList(); + + /// Activate servant and output ior to a file. + void create_and_activate(unsigned num_servants, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const ACE_TCHAR* ior_fname_prefix); + + /// Activate servant and not output ior to a file. + void create_and_activate(unsigned num_servants, + PortableServer::POA_ptr poa); + + // Code not used and not working right now - possible future addition. + //void deactivate(PortableServer::POA_ptr poa); + + /// Get a (copy) of one of the object references (for a specific servant). + T_stub_ptr objref(unsigned index); + /// This doesn't return a copy. + T* servant(unsigned index); + +private: + struct ServantRecord + { + T* servant_; + PortableServer::ServantBase_var safe_servant_; + T_stub_var obj_; + }; + + typedef ACE_Vector<ServantRecord> ServantRecordVector; + + ServantRecordVector servant_records_; }; diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/StatisticsHelper.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/StatisticsHelper.h index ae95c226bf7..b82edcb91e3 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/StatisticsHelper.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/StatisticsHelper.h @@ -7,17 +7,14 @@ #include "ace/Vector_T.h" #include "ace/SString.h" - typedef ACE_Vector< CORBA::Long, 1000 > LongVector; typedef ACE_Vector< ACE_CString, 1000 > StringVector; typedef ACE_Array< CORBA::Long > LongArray; - extern CSD_TP_Test_Export void swap ( CORBA::Long& x, CORBA::Long& y ); extern CSD_TP_Test_Export void sort ( LongVector & vector ); - #endif diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Common/TestAppBase.h b/TAO/tests/CSD_Strategy_Tests/TP_Common/TestAppBase.h index 0fb4aaaaa9f..40b06e5ca2d 100644 --- a/TAO/tests/CSD_Strategy_Tests/TP_Common/TestAppBase.h +++ b/TAO/tests/CSD_Strategy_Tests/TP_Common/TestAppBase.h @@ -8,25 +8,22 @@ class CSD_TP_Test_Export TestAppBase { - public: +public: + virtual ~TestAppBase(); - virtual ~TestAppBase(); + // Returns 0 for success, and -1 for failure. + int run (int argc, ACE_TCHAR *argv[]); - // Returns 0 for success, and -1 for failure. - int run (int argc, ACE_TCHAR *argv[]); + const char *name() const; - const char *name() const; +protected: + TestAppBase (const char* name); - protected: + // Returns -1 for failure, 0 for success + virtual int run_i (int argc, ACE_TCHAR *argv[]) = 0; - TestAppBase (const char* name); - - // Returns -1 for failure, 0 for success - virtual int run_i (int argc, ACE_TCHAR *argv[]) = 0; - - private: - - ACE_CString name_; +private: + ACE_CString name_; }; #endif |