diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-13 07:41:35 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-13 07:41:35 +0000 |
commit | 819386da4ab5e985f1562230df864753fb9d4206 (patch) | |
tree | 2776f62debb48cd92ea5fd1c41f9b04aeedcb54e | |
parent | 802a5c5e95ded2d105e84a3486cf4b1260a82ed9 (diff) | |
download | ATCD-819386da4ab5e985f1562230df864753fb9d4206.tar.gz |
Starting the new Implementation of the Repository.
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Repository.h | 69 |
1 files changed, 48 insertions, 21 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/Repository.h b/TAO/orbsvcs/ImplRepo_Service/Repository.h index 7e174e7ff93..4fee0a9fcf1 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Repository.h +++ b/TAO/orbsvcs/ImplRepo_Service/Repository.h @@ -20,7 +20,35 @@ #if !defined (REPOSITORY_H) #define REPOSITORY_H -#include "ace/Naming_Context.h" +#include "ace/Hash_Map_Manager.h" + +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; +}; class Repository { @@ -28,40 +56,39 @@ public: Repository (); // Default Constructor - 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); + typedef ACE_Hash_Map_Entry<const ASYS_TCHAR *, + Repository_Record *> HASH_STRING_ENTRY; + + typedef ACE_Hash_Map_Manager_Ex<const ASYS_TCHAR *, + Repository_Record *, + ACE_Hash<ASYS_TCHAR *>, + ACE_Equal_To<ASYS_TCHAR *>, + ACE_Null_Mutex> HASH_STRING_MAP; + + int add (const ASYS_TCHAR *key, const Repository_Record &rec); // Add a new server to the Repository - int update (const char *key, const Repository::Record &rec); + int update (const ASYS_TCHAR *key, const Repository_Record &rec); // Updates an existing key with <rec> - int remove (const char *key); + int remove (const ASYS_TCHAR *key); // Removes the server from the Repository - int resolve (const char *key, Repository::Record &rec); + int resolve (const ASYS_TCHAR *key, Repository_Record &rec); // Find the key record in the Repository // = Accessor methods - 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); + int get_comm_line (const ASYS_TCHAR *key, ASYS_TCHAR *&comm_line); + int get_env (const ASYS_TCHAR *key, ASYS_TCHAR *&env); + int get_wdir (const ASYS_TCHAR *key, ASYS_TCHAR *&wdir); + int get_ping_ior (const ASYS_TCHAR *key, ASYS_TCHAR *&ping_ior); + int get_hostport (const ASYS_TCHAR *key, ASYS_TCHAR *&host, unsigned short &port); // Dump method void dump (void); private: - ACE_Naming_Context repository_; + HASH_STRING_MAP repository_; }; |