diff options
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/Repository.h')
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Repository.h | 91 |
1 files changed, 25 insertions, 66 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/Repository.h b/TAO/orbsvcs/ImplRepo_Service/Repository.h index 1253be51e7b..7e174e7ff93 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Repository.h +++ b/TAO/orbsvcs/ImplRepo_Service/Repository.h @@ -5,7 +5,7 @@ // // = LIBRARY // TAO/orbsvcs/ImplRepo_Service -// +// // = FILENAME // Repository.h // @@ -14,49 +14,13 @@ // // = AUTHOR // Darrell Brunsch <brunsch@cs.wustl.edu> -// +// // ============================================================================ -#ifndef REPOSITORY_H +#if !defined (REPOSITORY_H) #define REPOSITORY_H -#include "ace/Hash_Map_Manager.h" -#include "ace/Synch.h" -#include "ace/SString.h" - -#if defined (UNICODE) -#define ACE_TString ACE_WString -#else /* UNICODE */ -#define ACE_TString ACE_CString -#endif /* UNICODE */ - -struct Repository_Record -{ - // Constructors - Repository_Record (); - Repository_Record (const Repository_Record &); - Repository_Record (const ASYS_TCHAR *c, - const ASYS_TCHAR *e, - const ASYS_TCHAR *w, - const ASYS_TCHAR *h, - const unsigned short p, - const ASYS_TCHAR *pi); - - - // Destructor - ~Repository_Record (); - - // Assignment Operator - Repository_Record &operator= (Repository_Record &); - - // Fields - ASYS_TCHAR *comm_line; - ASYS_TCHAR *env; - ASYS_TCHAR *wdir; - ASYS_TCHAR *host; - unsigned short port; - ASYS_TCHAR *ping_ior; -}; +#include "ace/Naming_Context.h" class Repository { @@ -64,45 +28,40 @@ public: Repository (); // Default Constructor - typedef ACE_Hash_Map_Entry<ACE_TString, - Repository_Record *> HASH_IR_ENTRY; - - typedef ACE_Hash_Map_Manager_Ex<ACE_TString, - Repository_Record *, - ACE_Hash<ACE_TString>, - ACE_Equal_To<ACE_TString>, - ACE_Null_Mutex> HASH_IR_MAP; - - typedef ACE_Hash_Map_Iterator_Ex<ACE_TString, - Repository_Record *, - ACE_Hash<ACE_TString>, - ACE_Equal_To<ACE_TString>, - ACE_Null_Mutex> HASH_IR_ITER; - - int add (ACE_TString key, const Repository_Record &rec); + struct Record + { + char *comm_line; + char *env; + char *wdir; + char *host; + unsigned short port; + char *ping_ior; + }; + + int add (const char *key, const Repository::Record &rec); // Add a new server to the Repository - int update (ACE_TString key, const Repository_Record &rec); + int update (const char *key, const Repository::Record &rec); // Updates an existing key with <rec> - - int remove (ACE_TString key); + + int remove (const char *key); // Removes the server from the Repository - int resolve (ACE_TString key, Repository_Record &rec); + int resolve (const char *key, Repository::Record &rec); // Find the key record in the Repository // = Accessor methods - int get_comm_line (ACE_TString key, ASYS_TCHAR *&comm_line); - int get_env (ACE_TString key, ASYS_TCHAR *&env); - int get_wdir (ACE_TString key, ASYS_TCHAR *&wdir); - int get_ping_ior (ACE_TString key, ASYS_TCHAR *&ping_ior); - int get_hostport (ACE_TString key, ASYS_TCHAR *&host, unsigned short &port); + int get_comm_line (const char *key, char *&comm_line); + int get_env (const char *key, char *&env); + int get_wdir (const char *key, char *&wdir); + int get_ping_ior (const char *key, char *&ping_ior); + int get_hostport (const char *key, char *&host, unsigned short &port); // Dump method void dump (void); private: - HASH_IR_MAP repository_; + ACE_Naming_Context repository_; }; |