diff options
author | dai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-10-19 00:27:51 +0000 |
---|---|---|
committer | dai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-10-19 00:27:51 +0000 |
commit | b29e5800752ecefbe4e9317ac908e40d9c6eded0 (patch) | |
tree | 3bdec835860a692ca76bdcd5baa5f069645bf248 /TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h | |
parent | 189f1baf20ea719b1724adef186b8699706eb065 (diff) | |
download | ATCD-b29e5800752ecefbe4e9317ac908e40d9c6eded0.tar.gz |
Tue Oct 18 17:24:26 MST 2005 Yan Dai <dai_y@ociweb.com>
Diffstat (limited to 'TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h')
-rw-r--r-- | TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h b/TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h new file mode 100644 index 00000000000..a9029d65703 --- /dev/null +++ b/TAO/performance-tests/CSD_Strategy/TestApps/ServerApp.h @@ -0,0 +1,95 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file ServerApp.h + * + * $Id$ + * + * @author Tim Bradley <bradley_t@ociweb.com> + */ +//============================================================================= +#ifndef SERVERAPP_H +#define SERVERAPP_H + +#include "TestInf/TestAppBase.h" +#include "TestInf/ServantList_T.h" +#include "TestInf/ClientTask.h" +#include "TestServant/Foo_i.h" +#include "TestServant/Foo_Statistics.h" +#include "tao/CSD_ThreadPool/CSD_TP_Strategy.h" +#include "ace/SString.h" + + +class ServerApp : public TestAppBase +{ + public: + + ServerApp(); + virtual ~ServerApp(); + + + protected: + + virtual int run_i(int argc, char* argv[] ACE_ENV_ARG_DECL); + + + private: + + // These are all called, in order, by the run_i() method. + int init(int argc, char* argv[] ACE_ENV_ARG_DECL); + void poa_setup(ACE_ENV_SINGLE_ARG_DECL); + void csd_setup(ACE_ENV_SINGLE_ARG_DECL); + void servant_setup(ACE_ENV_SINGLE_ARG_DECL); + void collocated_setup(); + void poa_activate(ACE_ENV_SINGLE_ARG_DECL); + void run_collocated_clients(ACE_ENV_SINGLE_ARG_DECL); + void run_orb_event_loop(ACE_ENV_SINGLE_ARG_DECL); + bool check_results(); + void cleanup(); + + + // Helper methods used by the methods above. + int parse_args(int argc, char* argv[]); + + int set_arg(unsigned& value, + const char* arg, + char opt, + const char* name, + int min = 0); + + void usage_statement(); + int arg_dependency_checks(); + + + PortableServer::POA_ptr create_poa(CORBA::ORB_ptr orb, + const char* poa_name + ACE_ENV_ARG_DECL); + + typedef ServantList<Foo_i> ServantListType; + + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + TAO::CSD::TP_Strategy_Handle tp_strategy_; + + ServantListType servants_; + + ClientTask collocated_client_task_; + + ACE_CString exe_name_; + ACE_CString ior_filename_prefix_; + unsigned num_servants_; + unsigned num_csd_threads_; + unsigned num_orb_threads_; + unsigned num_remote_clients_; + unsigned num_collocated_clients_; + unsigned num_loops_; + unsigned use_csd_; + + ACE_CString scenario_id_; + unsigned trial_id_; + + Foo_Statistics stats_; +}; + +#endif |