diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-03-09 18:44:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 18:44:09 +0100 |
commit | b0a0b92a0ee6bb248700d6ff4e7c51cc44db198f (patch) | |
tree | f78fc5b7b2ea337ffc306a77223018fcc780e507 /TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h | |
parent | 199259c5d2d5f4a6550382a683f5d54ac482fcd1 (diff) | |
parent | adc1dcda981a4c76612bedeba2dddb76aa272d6f (diff) | |
download | ATCD-b0a0b92a0ee6bb248700d6ff4e7c51cc44db198f.tar.gz |
Merge pull request #1446 from jwillemsen/jwi-cpp11cleanup
Various cleanup and use of C++11 features
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h')
-rw-r--r-- | TAO/tests/CSD_Strategy_Tests/TP_Common/ServantList_T.h | 78 |
1 files changed, 37 insertions, 41 deletions
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_; }; |