diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-06 04:25:54 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-06 04:25:54 +0000 |
commit | 0d8ee7e4258f06f26d0a9dbb467ecf573dc5d689 (patch) | |
tree | a00a40326372f5fade152590802b12891788f2a3 /ace | |
parent | 93735413191d08c245df27e593d79aba9482efc2 (diff) | |
download | ATCD-0d8ee7e4258f06f26d0a9dbb467ecf573dc5d689.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Active_Map_Manager.h | 25 | ||||
-rw-r--r-- | ace/Active_Map_Manager.i | 46 | ||||
-rw-r--r-- | ace/Active_Map_Manager_T.cpp | 2 | ||||
-rw-r--r-- | ace/Active_Map_Manager_T.h | 53 | ||||
-rw-r--r-- | ace/Active_Map_Manager_T.i | 132 | ||||
-rw-r--r-- | ace/Hash_Map_Manager.h | 7 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.cpp | 34 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.h | 59 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.i | 68 | ||||
-rw-r--r-- | ace/Makefile | 2 | ||||
-rw-r--r-- | ace/Map.cpp | 25 | ||||
-rw-r--r-- | ace/Map.h | 33 | ||||
-rw-r--r-- | ace/Map.i | 2 | ||||
-rw-r--r-- | ace/Map_Manager.cpp | 32 | ||||
-rw-r--r-- | ace/Map_Manager.h | 20 | ||||
-rw-r--r-- | ace/Map_Manager.i | 26 | ||||
-rw-r--r-- | ace/Map_T.cpp | 18 | ||||
-rw-r--r-- | ace/Map_T.h | 1435 | ||||
-rw-r--r-- | ace/Map_T.i | 1625 | ||||
-rw-r--r-- | ace/OS.h | 52 | ||||
-rw-r--r-- | ace/Pair.cpp | 25 | ||||
-rw-r--r-- | ace/Pair.h | 33 | ||||
-rw-r--r-- | ace/Pair.i | 2 | ||||
-rw-r--r-- | ace/Pair_T.cpp | 18 | ||||
-rw-r--r-- | ace/Pair_T.h | 112 | ||||
-rw-r--r-- | ace/Pair_T.i | 66 | ||||
-rw-r--r-- | ace/ace_dll.dsp | 140 | ||||
-rw-r--r-- | ace/ace_lib.dsp | 184 | ||||
-rw-r--r-- | ace/config-win32-common.h | 5 |
29 files changed, 4155 insertions, 126 deletions
diff --git a/ace/Active_Map_Manager.h b/ace/Active_Map_Manager.h index b28d45f5ea8..90e98caaa7a 100644 --- a/ace/Active_Map_Manager.h +++ b/ace/Active_Map_Manager.h @@ -43,24 +43,31 @@ public: // generation number from the client. u_long index (void) const; - // Get the index. + void index (u_long i); + // Get/Set the index. u_long generation (void) const; - // Get the generation number. + void generation (u_long g); + // Get/Set the generation number. + static size_t size (void); + // Size required to store information about active key. + + void decode (const void *data); + // Recover state of active key from <data>. User must make sure + // that <data> encoded using the <encode> method. + + void encode (void *data) const; + // Encode state of the active key into <data>. <data> must be as + // big as the value returned from <size>. + int operator== (const ACE_Active_Map_Manager_Key &rhs) const; int operator!= (const ACE_Active_Map_Manager_Key &rhs) const; // Compare keys. - // = These really should be protected but because of template + // = This really should be protected but because of template // friends, they are not. - void index (u_long i); - // Set the index. - - void generation (u_long g); - // Set the generation number. - void increment_generation_count (void); // Increment the generation number. diff --git a/ace/Active_Map_Manager.i b/ace/Active_Map_Manager.i index 080b6fd74d1..8980a49002f 100644 --- a/ace/Active_Map_Manager.i +++ b/ace/Active_Map_Manager.i @@ -61,3 +61,49 @@ ACE_Active_Map_Manager_Key::increment_generation_count (void) ++this->generation_; } +/* static */ +ACE_INLINE size_t +ACE_Active_Map_Manager_Key::size (void) +{ + return sizeof (u_long) + sizeof (u_long); +} + +ACE_INLINE void +ACE_Active_Map_Manager_Key::decode (const void *d) +{ + // Cast so that we can do pointer arithmetic. + const char *data = (const char *) d; + + // Grab the index first. + ACE_OS::memcpy (&this->index_, + data, + sizeof this->index_); + + // Move along... + data += sizeof this->index_; + + // Grab the generation second. + ACE_OS::memcpy (&this->generation_, + data, + sizeof this->generation_); +} + +ACE_INLINE void +ACE_Active_Map_Manager_Key::encode (void *d) const +{ + // Cast so that we can do pointer arithmetic. + char *data = (char *) d; + + // Grab the index first. + ACE_OS::memcpy (data, + &this->index_, + sizeof this->index_); + + // Move along... + data += sizeof this->index_; + + // Grab the generation second. + ACE_OS::memcpy (data, + &this->generation_, + sizeof this->generation_); +} diff --git a/ace/Active_Map_Manager_T.cpp b/ace/Active_Map_Manager_T.cpp index b7432589dc0..a544bc28fda 100644 --- a/ace/Active_Map_Manager_T.cpp +++ b/ace/Active_Map_Manager_T.cpp @@ -17,4 +17,4 @@ ACE_RCSID(ace, Active_Map_Manager_T, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Active_Map_Manager) -#endif /* ACE_ACTIVE_MAP_MANAGER_C */ +#endif /* ACE_ACTIVE_MAP_MANAGER_T_C */ diff --git a/ace/Active_Map_Manager_T.h b/ace/Active_Map_Manager_T.h index 9e95fdc1b0f..1c5201e7860 100644 --- a/ace/Active_Map_Manager_T.h +++ b/ace/Active_Map_Manager_T.h @@ -77,6 +77,21 @@ public: // Add <value> to the map. The user does not care about the // corresponding key produced by the Active_Map_Manager. + int bind (ACE_Active_Map_Manager_Key &key, + T *&internal_value); + // Reserves a slot in the internal structure and returns the key and + // a pointer to the value. User should place their <value> into + // <*internal_value>. This method is useful in reducing the number + // of copies required in some cases. Note that <internal_value> is + // only a temporary pointer and will change when the map resizes. + // Therefore, the user should use the pointer immediately and not + // hold on to it. + + int rebind (const ACE_Active_Map_Manager_Key &key, + const T &value); + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map. + int rebind (const ACE_Active_Map_Manager_Key &key, const T &value, T &old_value); @@ -85,9 +100,12 @@ public: // in the map. int rebind (const ACE_Active_Map_Manager_Key &key, - const T &value); - // Reassociate <key> with <value>. The function fails if <key> is - // not in the map. + const T &value, + ACE_Active_Map_Manager_Key &old_key, + T &old_value); + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameter <old_key> and <old_value>. The function + // fails if <key> is not in the map. int find (const ACE_Active_Map_Manager_Key &key, T &value); @@ -96,13 +114,34 @@ public: int find (const ACE_Active_Map_Manager_Key &key); // Is <key> in the map? + int find (const ACE_Active_Map_Manager_Key &key, + T *&internal_value); + // Locate <value> associated with <key>. The value is returned via + // <internal_value> and hence a copy is saved. Note that + // <internal_value> is only a temporary pointer and will change when + // the map resizes. Therefore, the user should use the pointer + // immediately and not hold on to it. + + // Creates a key. User should place their <value> into + // <*internal_value>. This method is useful in reducing the number + // of copies required in some cases. + int unbind (const ACE_Active_Map_Manager_Key &key); // Remove <key> from the map. - int unbind (const ACE_Active_Map_Manager_Key &key, T &value); + int unbind (const ACE_Active_Map_Manager_Key &key, + T &value); // Remove <key> from the map, and return the <value> associated with // <key>. + int unbind (const ACE_Active_Map_Manager_Key &key, + T *&internal_value); + // Locate <value> associated with <key>. The value is returned via + // <internal_value> and hence a copy is saved. Note that + // <internal_value> is only a temporary pointer and will change when + // the map resizes or when this slot is reused. Therefore, the user + // should use the pointer immediately and not hold on to it. + size_t current_size (void); // Return the current size of the map. @@ -130,12 +169,6 @@ protected: typedef ACE_Map_Manager<ACE_Active_Map_Manager_Key, T, ACE_Null_Mutex> ACE_AMM_BASE; // Private base class - int create_key (ACE_Active_Map_Manager_Key &key); - // Creates a key. - - void shared_unbind (const ACE_Active_Map_Manager_Key &key); - // Remove <key> from the map. - private: // = Disallow these operations. diff --git a/ace/Active_Map_Manager_T.i b/ace/Active_Map_Manager_T.i index 357a154db29..b3bffe68fac 100644 --- a/ace/Active_Map_Manager_T.i +++ b/ace/Active_Map_Manager_T.i @@ -1,7 +1,8 @@ // $Id$ template <class T> ACE_INLINE int -ACE_Active_Map_Manager<T>::create_key (ACE_Active_Map_Manager_Key &key) +ACE_Active_Map_Manager<T>::bind (ACE_Active_Map_Manager_Key &key, + T *&internal_value) { size_t index; int result = this->next_free (index); @@ -17,38 +18,44 @@ ACE_Active_Map_Manager<T>::create_key (ACE_Active_Map_Manager_Key &key) // Copy the key for the user. key = this->search_structure_[index].ext_id_; + + // This is where the user should place the value. + internal_value = &this->search_structure_[index].int_id_; + + // Update the current size. + ++this->cur_size_; } return result; } template <class T> ACE_INLINE int -ACE_Active_Map_Manager<T>::bind (const T &value) -{ - ACE_Active_Map_Manager_Key key; - return this->bind (value, key); -} - -template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::bind (const T &value, ACE_Active_Map_Manager_Key &key) { - int result = this->create_key (key); + T *internal_value = 0; + int result = this->bind (key, + internal_value); if (result == 0) { // Store new value. - this->search_structure_[key.index ()].int_id_ = value; - - // Update the current size. - ++this->cur_size_; + *internal_value = value; } return result; } template <class T> ACE_INLINE int -ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key) +ACE_Active_Map_Manager<T>::bind (const T &value) +{ + ACE_Active_Map_Manager_Key key; + return this->bind (value, key); +} + +template <class T> ACE_INLINE int +ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key, + T *&internal_value) { size_t index = key.index (); size_t generation = key.generation (); @@ -56,22 +63,52 @@ ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key) if (index > this->total_size_ || this->search_structure_[index].ext_id_.generation () != generation || this->search_structure_[index].ext_id_.index () == this->free_list_id ()) - return -1; + { + return -1; + } + else + { + // This is where the user value is. + internal_value = &this->search_structure_[index].int_id_; + } return 0; } template <class T> ACE_INLINE int +ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key) +{ + T *internal_value = 0; + return this->find (key, + internal_value); +} + +template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::find (const ACE_Active_Map_Manager_Key &key, T &value) { + T *internal_value = 0; + int result = this->find (key, + internal_value); + + if (result == 0) + { + value = *internal_value; + } + + return result; +} + +template <class T> ACE_INLINE int +ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, + const T &value) +{ int result = this->find (key); if (result == 0) { - // Get current value for key. - size_t index = key.index (); - value = this->search_structure_[index].int_id_; + // Store new value. + this->search_structure_[key.index ()].int_id_ = value; } return result; @@ -98,12 +135,20 @@ ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, - const T &value) + const T &value, + ACE_Active_Map_Manager_Key &old_key, + T &old_value) { int result = this->find (key); if (result == 0) { + // Copy old key. + old_key = this->search_structure_[key.index ()].ext_id_; + + // Copy old value. + old_value = this->search_structure_[key.index ()].int_id_; + // Store new value. this->search_structure_[key.index ()].int_id_ = value; } @@ -111,35 +156,42 @@ ACE_Active_Map_Manager<T>::rebind (const ACE_Active_Map_Manager_Key &key, return result; } -template <class T> ACE_INLINE void -ACE_Active_Map_Manager<T>::shared_unbind (const ACE_Active_Map_Manager_Key &key) +template <class T> ACE_INLINE int +ACE_Active_Map_Manager<T>::unbind (const ACE_Active_Map_Manager_Key &key, + T *&internal_value) { - size_t index = key.index (); + int result = this->find (key, + internal_value); + + if (result == 0) + { + size_t index = key.index (); + + // Move from occupied list to free list + this->move_from_occupied_list_to_free_list (index); - // Move from occupied list to free list - this->move_from_occupied_list_to_free_list (index); + // Reset the index. This will tell us that this entry is free. + this->search_structure_[index].ext_id_.index (this->free_list_id ()); - // Reset the index. This will tell us that this entry is free. - this->search_structure_[index].ext_id_.index (this->free_list_id ()); + // Update the current size. + --this->cur_size_; + } - // Update the current size. - --this->cur_size_; + return result; } template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::unbind (const ACE_Active_Map_Manager_Key &key, T &value) { - int result = this->find (key); + T *internal_value; + int result = this->unbind (key, + internal_value); if (result == 0) { // Copy old value. - size_t index = key.index (); - value = this->search_structure_[index].int_id_; - - // Unbind. - this->shared_unbind (key); + value = *internal_value; } return result; @@ -148,15 +200,9 @@ ACE_Active_Map_Manager<T>::unbind (const ACE_Active_Map_Manager_Key &key, template <class T> ACE_INLINE int ACE_Active_Map_Manager<T>::unbind (const ACE_Active_Map_Manager_Key &key) { - int result = this->find (key); - - if (result == 0) - { - // Unbind. - this->shared_unbind (key); - } - - return result; + T *internal_value; + return this->unbind (key, + internal_value); } template <class T> ACE_INLINE diff --git a/ace/Hash_Map_Manager.h b/ace/Hash_Map_Manager.h index f2735981288..a7b455152a8 100644 --- a/ace/Hash_Map_Manager.h +++ b/ace/Hash_Map_Manager.h @@ -24,12 +24,11 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Include the templates here. -#include "ace/Hash_Map_Manager_T.h" - #if defined (__ACE_INLINE__) #include "ace/Hash_Map_Manager.i" #endif /* __ACE_INLINE__ */ +// Include the templates here. +#include "ace/Hash_Map_Manager_T.h" + #endif /* ACE_HASH_MAP_MANAGER_H */ diff --git a/ace/Hash_Map_Manager_T.cpp b/ace/Hash_Map_Manager_T.cpp index 1921304ccb1..8d1dc0161d5 100644 --- a/ace/Hash_Map_Manager_T.cpp +++ b/ace/Hash_Map_Manager_T.cpp @@ -295,6 +295,40 @@ ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::share template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> int ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +{ + u_long dummy; + if (this->shared_find (ext_id, entry, dummy) == -1) + return this->bind_i (ext_id, int_id); + else + { + entry->ext_id_ = ext_id; + entry->int_id_ = int_id; + return 1; + } +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +{ + u_long dummy; + if (this->shared_find (ext_id, entry, dummy) == -1) + return this->bind_i (ext_id, int_id); + else + { + old_int_id = entry->int_id_; + entry->ext_id_ = ext_id; + entry->int_id_ = int_id; + return 1; + } +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id, ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) diff --git a/ace/Hash_Map_Manager_T.h b/ace/Hash_Map_Manager_T.h index e9ab623d08c..b963bedefae 100644 --- a/ace/Hash_Map_Manager_T.h +++ b/ace/Hash_Map_Manager_T.h @@ -160,6 +160,37 @@ public: // newly created entry, or the existing one. int rebind (const EXT_ID &ext_id, + const INT_ID &int_id); + // Reassociate <ext_id> with <int_id>. If <ext_id> is not in the + // map then behaves just like <bind>. Returns 0 if a new entry is + // bound successfully, returns 1 if an existing entry was rebound, + // and returns -1 if failures occur. + + int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry); + // Same as a normal rebind, except the map entry is also passed back + // to the caller. The entry in this case will either be the newly + // created entry, or the existing one. + + int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id); + // Associate <ext_id> with <int_id>. If <ext_id> is not in the map + // then behaves just like <bind>. Otherwise, store the old value of + // <int_id> into the "out" parameter and rebind the new parameters. + // Returns 0 if a new entry is bound successfully, returns 1 if an + // existing entry was rebound, and returns -1 if failures occur. + + int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry); + // Same as a normal rebind, except the map entry is also passed back + // to the caller. The entry in this case will either be the newly + // created entry, or the existing one. + + int rebind (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id); @@ -167,8 +198,8 @@ public: // then behaves just like <bind>. Otherwise, store the old values // of <ext_id> and <int_id> into the "out" parameters and rebind the // new parameters. This is very useful if you need to have an - // atomic way of updating <ACE_Hash_Map_Entrys> and you also need full - // control over memory allocation. Returns 0 if a new entry is + // atomic way of updating <ACE_Hash_Map_Entrys> and you also need + // full control over memory allocation. Returns 0 if a new entry is // bound successfully, returns 1 if an existing entry was rebound, // and returns -1 if failures occur. @@ -266,6 +297,26 @@ protected: // Performs trybind. Must be called with locks held. int rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id); + // Performs rebind. Must be called with locks held. + + int rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry); + // Performs rebind. Must be called with locks held. + + int rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id); + // Performs rebind. Must be called with locks held. + + int rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry); + // Performs rebind. Must be called with locks held. + + int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id); @@ -360,14 +411,14 @@ public: // = ITERATION methods. - int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry); + int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry) const; // Pass back the next <entry> that hasn't been seen in the Set. // Returns 0 when all items have been seen, else 1. int done (void) const; // Returns 1 when all items have been seen, else 0. - ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void); + ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const; // Returns a reference to the interal element <this> is pointing to. ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void); diff --git a/ace/Hash_Map_Manager_T.i b/ace/Hash_Map_Manager_T.i index c0decdeaf7e..1f5f8e015f2 100644 --- a/ace/Hash_Map_Manager_T.i +++ b/ace/Hash_Map_Manager_T.i @@ -224,6 +224,30 @@ ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::find template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id) +{ + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; + + return this->rebind_i (ext_id, + int_id, + node); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id) +{ + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; + + return this->rebind_i (ext_id, + int_id, + old_int_id, + node); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id) @@ -239,6 +263,46 @@ ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebin template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, int_id, entry); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, int_id, old_int_id); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, int_id, old_int_id, entry); +} + +template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int +ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::rebind (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id) @@ -302,7 +366,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: } template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE int -ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) const { ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::next"); @@ -330,7 +394,7 @@ ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>: template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK> ACE_INLINE ACE_Hash_Map_Entry<EXT_ID, INT_ID> & -ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator* (void) +ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator* (void) const { ACE_TRACE ("ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::operator*"); ACE_Hash_Map_Entry<EXT_ID, INT_ID> *retv = 0; diff --git a/ace/Makefile b/ace/Makefile index 4dc5a4d3dc8..93640e7529b 100644 --- a/ace/Makefile +++ b/ace/Makefile @@ -59,6 +59,7 @@ FILES = Log_Msg \ LSOCK_Stream \ Log_Record \ Malloc \ + Map \ Mem_Map \ Memory_Pool \ Message_Block \ @@ -173,6 +174,7 @@ TEMPLATE_FILES = \ Malloc_T \ Managed_Object \ Map_Manager \ + Map_T \ Message_Block_T \ Message_Queue_T \ Module \ diff --git a/ace/Map.cpp b/ace/Map.cpp new file mode 100644 index 00000000000..f5ff9e3e60e --- /dev/null +++ b/ace/Map.cpp @@ -0,0 +1,25 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Map.cpp +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#define ACE_BUILD_DLL + +#include "ace/Map.h" + +ACE_RCSID(ace, Map, "$Id$") + +#if !defined (__ACE_INLINE__) +#include "ace/Map.i" +#endif /* __ACE_INLINE__ */ + diff --git a/ace/Map.h b/ace/Map.h new file mode 100644 index 00000000000..de488018258 --- /dev/null +++ b/ace/Map.h @@ -0,0 +1,33 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Map.h +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#ifndef ACE_MAP_H +#define ACE_MAP_H + +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (__ACE_INLINE__) +#include "ace/Map.i" +#endif /* __ACE_INLINE__ */ + +// Include the templates here. +#include "ace/Map_T.h" + +#endif /* ACE_MAP_H */ diff --git a/ace/Map.i b/ace/Map.i new file mode 100644 index 00000000000..74e88caa0c5 --- /dev/null +++ b/ace/Map.i @@ -0,0 +1,2 @@ +// $Id$ + diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index 781b5af7d53..92ddb7572bd 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -245,6 +245,38 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, template <class EXT_ID, class INT_ID, class ACE_LOCK> int ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id) +{ + // First try to find the key. + size_t index = 0; + int result = this->find_and_return_index (ext_id, + index); + + if (result == 0) + { + // We found it, so make copies of the old entries and rebind + // current entries. + ENTRY &ss = this->search_structure_[index]; + old_int_id = ss.int_id_; + ss.ext_id_ = ext_id; + ss.int_id_ = int_id; + + // Sync changed entry. + this->allocator_->sync (&ss, sizeof ss); + + return 1; + } + else + { + // We didn't find it, so let's add it. + return this->shared_bind (ext_id, + int_id); + } +} + +template <class EXT_ID, class INT_ID, class ACE_LOCK> int +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id, const INT_ID &int_id) { diff --git a/ace/Map_Manager.h b/ace/Map_Manager.h index 93b9adc5b08..d2d7d26e303 100644 --- a/ace/Map_Manager.h +++ b/ace/Map_Manager.h @@ -159,6 +159,16 @@ public: // and returns -1 if failures occur. int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id); + // Reassociate <ext_id> with <int_id>. If <ext_id> is not in the + // map then behaves just like <bind>. Otherwise, store the old + // values of <int_id> into the "out" parameter and rebind the new + // parameters. Returns 0 if a new entry is bound successfully, + // returns 1 if an existing entry was rebound, and returns -1 if + // failures occur. + + int rebind (const EXT_ID &ext_id, const INT_ID &int_id); // Reassociate <ext_id> with <int_id>. Old values in the map are // ignored. @@ -247,6 +257,12 @@ protected: // values. Must be called with locks held. int rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id); + // Performs a rebinding of <ext_it> to <int_id>. Also, recovers old + // values. Must be called with locks held. + + int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id); // Performs a rebinding of <ext_it> to <int_id>. Must be called // with locks held. @@ -375,14 +391,14 @@ public: // = Iteration methods. - int next (ACE_Map_Entry<EXT_ID, INT_ID> *&next_entry); + int next (ACE_Map_Entry<EXT_ID, INT_ID> *&next_entry) const; // Pass back the next <entry> that hasn't been seen in the Set. // Returns 0 when all items have been seen, else 1. int done (void) const; // Returns 1 when all items have been seen, else 0. - ACE_Map_Entry<EXT_ID, INT_ID>& operator* (void); + ACE_Map_Entry<EXT_ID, INT_ID>& operator* (void) const; // Returns a reference to the interal element <this> is pointing to. ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>& map (void); diff --git a/ace/Map_Manager.i b/ace/Map_Manager.i index 816eaccc890..959ec90966d 100644 --- a/ace/Map_Manager.i +++ b/ace/Map_Manager.i @@ -95,6 +95,28 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id, } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + INT_ID &old_int_id) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, + int_id, + old_int_id); +} + +template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int +ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id) +{ + ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, + int_id); +} + +template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::trybind (const EXT_ID &ext_id, INT_ID &int_id) { @@ -250,7 +272,7 @@ ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Iterator_Base (ACE_Map_ } template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int -ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Map_Entry<EXT_ID, INT_ID> *&mm) +ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Map_Entry<EXT_ID, INT_ID> *&mm) const { if (this->next_ != this->map_man_.occupied_list_id ()) { @@ -301,7 +323,7 @@ ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i (void) template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE ACE_Map_Entry<EXT_ID, INT_ID>& -ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator* (void) +ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator* (void) const { ACE_Map_Entry<EXT_ID, INT_ID> *retv = 0; diff --git a/ace/Map_T.cpp b/ace/Map_T.cpp new file mode 100644 index 00000000000..e2329089630 --- /dev/null +++ b/ace/Map_T.cpp @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef ACE_MAP_T_C +#define ACE_MAP_T_C + +#include "ace/Map_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (__ACE_INLINE__) +#include "ace/Map_T.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ace, Map_T, "$Id$") + +#endif /* ACE_MAP_T_C */ diff --git a/ace/Map_T.h b/ace/Map_T.h new file mode 100644 index 00000000000..2f145845eb2 --- /dev/null +++ b/ace/Map_T.h @@ -0,0 +1,1435 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Map_T.h +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#ifndef ACE_MAP_T_H +#define ACE_MAP_T_H + +#include "ace/Map.h" +#include "ace/Pair.h" +#include "ace/Map_Manager.h" +#include "ace/Hash_Map_Manager.h" +#include "ace/Active_Map_Manager.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> +class ACE_Incremental_Key_Generator +{ + // = TITLE + // Defines a simple incremental key generator. + // + // = DESCRIPTION + // Generates a new key of type T by incrementing current + // value. Requirements on T are: + // + // - Constructor that accepts 0 in the constructor. + // - Prefix increment. + // - Assignment. + // + // Note that a primitive types such as u_long, int, etc., are + // suitable for this class. +public: + + ACE_Incremental_Key_Generator (void); + // Constructor. + + int operator() (T &t); + // Functor method: generates a new key. + + T& current_value (void); + // Returns the current value. + +protected: + + T t_; + // Current value. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> +class ACE_Iterator_Impl +{ + // = TITLE + // Defines a abstract iterator. + // + // = DESCRIPTION + // Implementation to be provided by subclasses. +public: + + virtual ~ACE_Iterator_Impl (void); + // Destructor. + + virtual ACE_Iterator_Impl<T> *clone (void) const = 0; + // Clone. + + virtual int compare (const ACE_Iterator_Impl<T> &rhs) const = 0; + // Comparison. + + virtual T dereference () const = 0; + // Dereference. + + virtual void plus_plus (void) = 0; + // Advance. + + virtual void minus_minus (void) = 0; + // Reverse. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> +class ACE_Reverse_Iterator_Impl +{ + // = TITLE + // Defines a abstract reverse iterator. + // + // = DESCRIPTION + // Implementation to be provided by subclasses. +public: + + virtual ~ACE_Reverse_Iterator_Impl (void); + // Destructor. + + virtual ACE_Reverse_Iterator_Impl<T> *clone (void) const = 0; + // Clone. + + virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const = 0; + // Comparison. + + virtual T dereference () const = 0; + // Dereference. + + virtual void plus_plus (void) = 0; + // Advance. + + virtual void minus_minus (void) = 0; + // Reverse. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> +class ACE_Iterator +{ + // = TITLE + // Defines the iterator interface. + // + // = DESCRIPTION + // Implementation to be provided by forwarding. +public: + + // = Traits. + typedef T value_type; + typedef ACE_Iterator_Impl<T> implementation; + + ACE_Iterator (implementation *impl); + // Constructor. + + ACE_Iterator (const ACE_Iterator<T> &rhs); + // Copy constructor. + + ~ACE_Iterator (void); + // Destructor. + + ACE_Iterator<T> &operator= (const ACE_Iterator<T> &rhs); + // Assignment operator. + + int operator== (const ACE_Iterator<T> &rhs) const; + int operator!= (const ACE_Iterator<T> &rhs) const; + // Comparison operators. + + T operator* () const; + // Dereference operator. + + ACE_Iterator<T> &operator++ (void); + // Prefix advance. + + ACE_Iterator<T> operator++ (int); + // Postfix advance. + + ACE_Iterator<T> &operator-- (void); + // Prefix reverse. + + ACE_Iterator<T> operator-- (int); + // Postfix reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation *implementation_; + // Implementation pointer. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> +class ACE_Reverse_Iterator +{ + // = TITLE + // Defines the reverse iterator interface. + // + // = DESCRIPTION + // Implementation to be provided by forwarding. +public: + + // = Traits. + typedef T value_type; + typedef ACE_Reverse_Iterator_Impl<T> implementation; + + ACE_Reverse_Iterator (implementation *impl); + // Constructor. + + ACE_Reverse_Iterator (const ACE_Reverse_Iterator<T> &rhs); + // Copy constructor. + + ~ACE_Reverse_Iterator (void); + // Destructor. + + ACE_Reverse_Iterator<T> &operator= (const ACE_Reverse_Iterator<T> &rhs); + // Assignment operator. + + int operator== (const ACE_Reverse_Iterator<T> &rhs) const; + int operator!= (const ACE_Reverse_Iterator<T> &rhs) const; + // Comparison operators. + + T operator* () const; + // Dereference operator. + + ACE_Reverse_Iterator<T> &operator++ (void); + // Prefix advance. + + ACE_Reverse_Iterator<T> operator++ (int); + // Postfix advance. + + ACE_Reverse_Iterator<T> &operator-- (void); + // Prefix reverse. + + ACE_Reverse_Iterator<T> operator-- (int); + // Postfix reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation *implementation_; + // Implementation pointer. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE> +class ACE_Map +{ + // = TITLE + // Defines a map interface. + // + // = DESCRIPTION + // Implementation to be provided by subclasses. +public: + + // = Traits. + typedef KEY key_type; + typedef VALUE mapped_type; + typedef ACE_Reference_Pair<const KEY, VALUE> value_type; + typedef ACE_Iterator<value_type> iterator; + typedef ACE_Reverse_Iterator<value_type> reverse_iterator; + typedef ACE_Iterator_Impl<value_type> iterator_implementation; + typedef ACE_Reverse_Iterator_Impl<value_type> reverse_iterator_implementation; + + virtual ~ACE_Map (void); + // Close down and release dynamically allocated resources. + + virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, + ACE_Allocator *alloc = 0) = 0; + // Initialize a <Map> with size <length>. + + virtual int close (void) = 0; + // Close down a <Map> and release dynamically allocated resources. + + virtual int bind (const KEY &key, + const VALUE &value) = 0; + // Add <key>/<value> pair to the map. If <key> is already in the + // map then no changes are made and 1 is returned. Returns 0 on a + // successful addition. This function fails for maps that do not + // allow user specified keys. <key> is an "in" parameter. + + virtual int bind_modify_key (const VALUE &value, + KEY &key) = 0; + // Add <key>/<value> pair to the map. <key> is an "inout" parameter + // and maybe modified/extended by the map to add additional + // information. To recover original key, call the <recover_key> + // method. + + virtual int bind_create_key (const VALUE &value, + KEY &key) = 0; + // Add <value> to the map, and the corresponding key produced by the + // Map is returned through <key> which is an "out" parameter. For + // maps that do not naturally produce keys, the map adapters will + // use the <KEY_GENERATOR> class to produce a key. However, the + // users are responsible for not jeopardizing this key production + // scheme by using user specified keys with keys produced by the key + // generator. + + virtual int bind_create_key (const VALUE &value) = 0; + // Add <value> to the map. The user does not care about the + // corresponding key produced by the Map. For maps that do not + // naturally produce keys, the map adapters will use the + // <KEY_GENERATOR> class to produce a key. However, the users are + // responsible for not jeopardizing this key production scheme by + // using user specified keys with keys produced by the key + // generator. + + virtual int recover_key (const KEY &modified_key, + KEY &original_key) = 0; + // Recovers the original key potentially modified by the map during + // <bind_modify_key>. + + virtual int rebind (const KEY &key, + const VALUE &value) = 0; + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + VALUE &old_value) = 0; + // Reassociate <key> with <value>, storing the old value into the + // "out" parameter <old_value>. The function fails if <key> is not + // in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value) = 0; + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameters <old_key> and <old_value>. The + // function fails if <key> is not in the map for maps that do not + // allow user specified keys. However, for maps that allow user + // specified keys, if the key is not in the map, a new <key>/<value> + // association is created. + + virtual int trybind (const KEY &key, + VALUE &value) = 0; + // Associate <key> with <value> if and only if <key> is not in the + // map. If <key> is already in the map, then the <value> parameter + // is overwritten with the existing value in the map. Returns 0 if a + // new <key>/<value> association is created. Returns 1 if an + // attempt is made to bind an existing entry. This function fails + // for maps that do not allow user specified keys. + + virtual int find (const KEY &key, + VALUE &value) = 0; + // Locate <value> associated with <key>. + + virtual int find (const KEY &key) = 0; + // Is <key> in the map? + + virtual int unbind (const KEY &key) = 0; + // Remove <key> from the map. + + virtual int unbind (const KEY &key, + VALUE &value) = 0; + // Remove <key> from the map, and return the <value> associated with + // <key>. + + virtual size_t current_size (void) = 0; + // Return the current size of the map. + + virtual size_t total_size (void) = 0; + // Return the total size of the map. + + virtual void dump (void) const = 0; + // Dump the state of an object. + + // = STL styled iterator factory functions. + + iterator begin (void); + iterator end (void); + // Return forward iterator. + + reverse_iterator rbegin (void); + reverse_iterator rend (void); + // Return reverse iterator. + +protected: + + // = Protected no-op constructor. + ACE_Map (void); + + virtual iterator_implementation *begin_impl (void) = 0; + virtual iterator_implementation *end_impl (void) = 0; + // Return forward iterator. + + virtual reverse_iterator_implementation *rbegin_impl (void) = 0; + virtual reverse_iterator_implementation *rend_impl (void) = 0; + // Return reverse iterator. + +private: + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map<KEY, VALUE> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Map (const ACE_Map<KEY, VALUE> &)) +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class IMPLEMENTATION, class ENTRY> +class ACE_Map_Impl_Iterator_Adapter : public ACE_Iterator_Impl<T> +{ + // = TITLE + // Defines a iterator implementation for the Map_Impl class. + // + // = DESCRIPTION + // Implementation to be provided by <IMPLEMENTATION>. +public: + + // = Traits. + typedef IMPLEMENTATION implementation; + + ACE_Map_Impl_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Map_Impl_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class IMPLEMENTATION, class ENTRY> +class ACE_Map_Impl_Reverse_Iterator_Adapter : public ACE_Reverse_Iterator_Impl<T> +{ + // = TITLE + // Defines a reverse iterator implementation for the Map_Impl class. + // + // = DESCRIPTION + // Implementation to be provided by IMPLEMENTATION. +public: + + // = Traits. + typedef IMPLEMENTATION implementation; + + ACE_Map_Impl_Reverse_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Map_Impl_Reverse_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Reverse_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class IMPLEMENTATION> +class ACE_Map_Impl : public ACE_Map<KEY, VALUE> +{ + // = TITLE + // Defines a map implementation. + // + // = DESCRIPTION + // Implementation to be provided by <IMPLEMENTATION>. +public: + + // = Traits. + typedef ACE_Map_Impl_Iterator_Adapter<value_type, IMPLEMENTATION::iterator, IMPLEMENTATION::ENTRY> iterator_impl; + typedef ACE_Map_Impl_Reverse_Iterator_Adapter<value_type, IMPLEMENTATION::reverse_iterator, IMPLEMENTATION::ENTRY> reverse_iterator_impl; + typedef IMPLEMENTATION implementation; + + // = Initialization and termination methods. + ACE_Map_Impl (ACE_Allocator *alloc = 0); + // Initialize with the <ACE_DEFAULT_MAP_SIZE>. + + ACE_Map_Impl (size_t size, + ACE_Allocator *alloc = 0); + // Initialize with <size> entries. The <size> parameter is ignore + // by maps for which an initialize size does not make sense. + + virtual ~ACE_Map_Impl (void); + // Close down and release dynamically allocated resources. + + virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, + ACE_Allocator *alloc = 0); + // Initialize a <Map> with size <length>. + + virtual int close (void); + // Close down a <Map> and release dynamically allocated resources. + + virtual int bind (const KEY &key, + const VALUE &value); + // Add <key>/<value> pair to the map. If <key> is already in the + // map then no changes are made and 1 is returned. Returns 0 on a + // successful addition. This function fails for maps that do not + // allow user specified keys. <key> is an "in" parameter. + + virtual int bind_modify_key (const VALUE &value, + KEY &key); + // Add <key>/<value> pair to the map. <key> is an "inout" parameter + // and maybe modified/extended by the map to add additional + // information. To recover original key, call the <recover_key> + // method. + + virtual int bind_create_key (const VALUE &value, + KEY &key); + // Add <value> to the map, and the corresponding key produced by the + // Map is returned through <key> which is an "out" parameter. For + // maps that do not naturally produce keys, the map adapters will + // use the <KEY_GENERATOR> class to produce a key. However, the + // users are responsible for not jeopardizing this key production + // scheme by using user specified keys with keys produced by the key + // generator. + + virtual int bind_create_key (const VALUE &value); + // Add <value> to the map. The user does not care about the + // corresponding key produced by the Map. For maps that do not + // naturally produce keys, the map adapters will use the + // <KEY_GENERATOR> class to produce a key. However, the users are + // responsible for not jeopardizing this key production scheme by + // using user specified keys with keys produced by the key + // generator. + + virtual int recover_key (const KEY &modified_key, + KEY &original_key); + // Recovers the original key potentially modified by the map during + // <bind_modify_key>. + + virtual int rebind (const KEY &key, + const VALUE &value); + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old value into the + // "out" parameter <old_value>. The function fails if <key> is not + // in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameters <old_key> and <old_value>. The + // function fails if <key> is not in the map for maps that do not + // allow user specified keys. However, for maps that allow user + // specified keys, if the key is not in the map, a new <key>/<value> + // association is created. + + virtual int trybind (const KEY &key, + VALUE &value); + // Associate <key> with <value> if and only if <key> is not in the + // map. If <key> is already in the map, then the <value> parameter + // is overwritten with the existing value in the map. Returns 0 if a + // new <key>/<value> association is created. Returns 1 if an + // attempt is made to bind an existing entry. This function fails + // for maps that do not allow user specified keys. + + virtual int find (const KEY &key, + VALUE &value); + // Locate <value> associated with <key>. + + virtual int find (const KEY &key); + // Is <key> in the map? + + virtual int unbind (const KEY &key); + // Remove <key> from the map. + + virtual int unbind (const KEY &key, + VALUE &value); + // Remove <key> from the map, and return the <value> associated with + // <key>. + + virtual size_t current_size (void); + // Return the current size of the map. + + virtual size_t total_size (void); + // Return the total size of the map. + + virtual void dump (void) const; + // Dump the state of an object. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. + + // = STL styled iterator factory functions. + + virtual iterator_implementation *begin_impl (void); + virtual iterator_implementation *end_impl (void); + // Return forward iterator. + + virtual reverse_iterator_implementation *rbegin_impl (void); + virtual reverse_iterator_implementation *rend_impl (void); + // Return reverse iterator. + +private: + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Map_Impl (const ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION> &)) +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class VALUE> +class ACE_Active_Map_Manager_Iterator_Adapter : public ACE_Iterator_Impl<T> +{ + // = TITLE + // Defines a iterator implementation for the Active_Map_Manager_Adapter. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Active_Map_Manager::iterator. +public: + + // = Traits. + typedef ACE_Active_Map_Manager<VALUE>::iterator implementation; + + ACE_Active_Map_Manager_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Active_Map_Manager_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class VALUE> +class ACE_Active_Map_Manager_Reverse_Iterator_Adapter : public ACE_Reverse_Iterator_Impl<T> +{ + // = TITLE + // Defines a reverse iterator implementation for the Active_Map_Manager_Adapter. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Active_Map_Manager::reverse_iterator. +public: + + // = Traits. + typedef ACE_Active_Map_Manager<VALUE>::reverse_iterator implementation; + + ACE_Active_Map_Manager_Reverse_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Active_Map_Manager_Reverse_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Reverse_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class KEY_ADAPTER> +class ACE_Active_Map_Manager_Adapter : public ACE_Map<KEY, VALUE> +{ + // = TITLE + // Defines a map implementation. + // + // = DESCRIPTION + // Implementation to be provided by <ACE_Active_Map_Manager>. +public: + + // = Traits. + typedef ACE_Pair<KEY, VALUE> expanded_value; + typedef ACE_Active_Map_Manager_Iterator_Adapter<value_type, expanded_value> iterator_impl; + typedef ACE_Active_Map_Manager_Reverse_Iterator_Adapter<value_type, expanded_value> reverse_iterator_impl; + typedef ACE_Active_Map_Manager<expanded_value> implementation; + + // = Initialization and termination methods. + ACE_Active_Map_Manager_Adapter (ACE_Allocator *alloc = 0); + // Initialize with the <ACE_DEFAULT_MAP_SIZE>. + + ACE_Active_Map_Manager_Adapter (size_t size, + ACE_Allocator *alloc = 0); + // Initialize with <size> entries. The <size> parameter is ignore + // by maps for which an initialize size does not make sense. + + virtual ~ACE_Active_Map_Manager_Adapter (void); + // Close down and release dynamically allocated resources. + + virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, + ACE_Allocator *alloc = 0); + // Initialize a <Map> with size <length>. + + virtual int close (void); + // Close down a <Map> and release dynamically allocated resources. + + virtual int bind (const KEY &key, + const VALUE &value); + // Add <key>/<value> pair to the map. If <key> is already in the + // map then no changes are made and 1 is returned. Returns 0 on a + // successful addition. This function fails for maps that do not + // allow user specified keys. <key> is an "in" parameter. + + virtual int bind_modify_key (const VALUE &value, + KEY &key); + // Add <key>/<value> pair to the map. <key> is an "inout" parameter + // and maybe modified/extended by the map to add additional + // information. To recover original key, call the <recover_key> + // method. + + virtual int bind_create_key (const VALUE &value, + KEY &key); + // Add <value> to the map, and the corresponding key produced by the + // Map is returned through <key> which is an "out" parameter. For + // maps that do not naturally produce keys, the map adapters will + // use the <KEY_GENERATOR> class to produce a key. However, the + // users are responsible for not jeopardizing this key production + // scheme by using user specified keys with keys produced by the key + // generator. + + virtual int bind_create_key (const VALUE &value); + // Add <value> to the map. The user does not care about the + // corresponding key produced by the Map. For maps that do not + // naturally produce keys, the map adapters will use the + // <KEY_GENERATOR> class to produce a key. However, the users are + // responsible for not jeopardizing this key production scheme by + // using user specified keys with keys produced by the key + // generator. + + virtual int recover_key (const KEY &modified_key, + KEY &original_key); + // Recovers the original key potentially modified by the map during + // <bind_modify_key>. + + virtual int rebind (const KEY &key, + const VALUE &value); + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old value into the + // "out" parameter <old_value>. The function fails if <key> is not + // in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameters <old_key> and <old_value>. The + // function fails if <key> is not in the map for maps that do not + // allow user specified keys. However, for maps that allow user + // specified keys, if the key is not in the map, a new <key>/<value> + // association is created. + + virtual int trybind (const KEY &key, + VALUE &value); + // Associate <key> with <value> if and only if <key> is not in the + // map. If <key> is already in the map, then the <value> parameter + // is overwritten with the existing value in the map. Returns 0 if a + // new <key>/<value> association is created. Returns 1 if an + // attempt is made to bind an existing entry. This function fails + // for maps that do not allow user specified keys. + + virtual int find (const KEY &key, + VALUE &value); + // Locate <value> associated with <key>. + + virtual int find (const KEY &key); + // Is <key> in the map? + + virtual int unbind (const KEY &key); + // Remove <key> from the map. + + virtual int unbind (const KEY &key, + VALUE &value); + // Remove <key> from the map, and return the <value> associated with + // <key>. + + virtual size_t current_size (void); + // Return the current size of the map. + + virtual size_t total_size (void); + // Return the total size of the map. + + virtual void dump (void) const; + // Dump the state of an object. + + implementation &impl (void); + // Accessor to implementation object. + + KEY_ADAPTER &key_adapter (void); + // Accessor to key adapter. + +protected: + + virtual int find (const KEY &key, + expanded_value *&internal_value); + // Find helper. + + virtual int unbind (const KEY &key, + expanded_value *&internal_value); + // Unbind helper. + + implementation implementation_; + // All implementation details are forwarded to this class. + + KEY_ADAPTER key_adapter_; + // Adapts between the user key and the Active_Map_Manager_Key. + + // = STL styled iterator factory functions. + + virtual iterator_implementation *begin_impl (void); + virtual iterator_implementation *end_impl (void); + // Return forward iterator. + + virtual reverse_iterator_implementation *rbegin_impl (void); + virtual reverse_iterator_implementation *rend_impl (void); + // Return reverse iterator. + +private: + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager_Adapter (const ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER> &)) +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> +class ACE_Hash_Map_Manager_Ex_Iterator_Adapter : public ACE_Iterator_Impl<T> +{ + // = TITLE + // Defines a iterator implementation for the Hash_Map_Manager_Adapter. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Hash_Map_Manager_Ex::iterator. +public: + + // = Traits. + typedef ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex>::iterator implementation; + + ACE_Hash_Map_Manager_Ex_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Hash_Map_Manager_Ex_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> +class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter : public ACE_Reverse_Iterator_Impl<T> +{ + // = TITLE + // Defines a reverse iterator implementation for the Hash_Map_Manager_Adapter. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Hash_Map_Manager_Ex::reverse_iterator. +public: + + // = Traits. + typedef ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex>::reverse_iterator implementation; + + ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Reverse_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> +class ACE_Hash_Map_Manager_Ex_Adapter : public ACE_Map<KEY, VALUE> +{ + // = TITLE + // Defines a map implementation. + // + // = DESCRIPTION + // Implementation to be provided by <ACE_Hash_Map_Manager_Ex>. +public: + + // = Traits. + typedef ACE_Hash_Map_Manager_Ex_Iterator_Adapter<value_type, KEY, VALUE, HASH_KEY, COMPARE_KEYS> iterator_impl; + typedef ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<value_type, KEY, VALUE, HASH_KEY, COMPARE_KEYS> reverse_iterator_impl; + typedef ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex> implementation; + + // = Initialization and termination methods. + ACE_Hash_Map_Manager_Ex_Adapter (ACE_Allocator *alloc = 0); + // Initialize with the <ACE_DEFAULT_MAP_SIZE>. + + ACE_Hash_Map_Manager_Ex_Adapter (size_t size, + ACE_Allocator *alloc = 0); + // Initialize with <size> entries. The <size> parameter is ignore + // by maps for which an initialize size does not make sense. + + virtual ~ACE_Hash_Map_Manager_Ex_Adapter (void); + // Close down and release dynamically allocated resources. + + virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, + ACE_Allocator *alloc = 0); + // Initialize a <Map> with size <length>. + + virtual int close (void); + // Close down a <Map> and release dynamically allocated resources. + + virtual int bind (const KEY &key, + const VALUE &value); + // Add <key>/<value> pair to the map. If <key> is already in the + // map then no changes are made and 1 is returned. Returns 0 on a + // successful addition. This function fails for maps that do not + // allow user specified keys. <key> is an "in" parameter. + + virtual int bind_modify_key (const VALUE &value, + KEY &key); + // Add <key>/<value> pair to the map. <key> is an "inout" parameter + // and maybe modified/extended by the map to add additional + // information. To recover original key, call the <recover_key> + // method. + + virtual int bind_create_key (const VALUE &value, + KEY &key); + // Add <value> to the map, and the corresponding key produced by the + // Map is returned through <key> which is an "out" parameter. For + // maps that do not naturally produce keys, the map adapters will + // use the <KEY_GENERATOR> class to produce a key. However, the + // users are responsible for not jeopardizing this key production + // scheme by using user specified keys with keys produced by the key + // generator. + + virtual int bind_create_key (const VALUE &value); + // Add <value> to the map. The user does not care about the + // corresponding key produced by the Map. For maps that do not + // naturally produce keys, the map adapters will use the + // <KEY_GENERATOR> class to produce a key. However, the users are + // responsible for not jeopardizing this key production scheme by + // using user specified keys with keys produced by the key + // generator. + + virtual int recover_key (const KEY &modified_key, + KEY &original_key); + // Recovers the original key potentially modified by the map during + // <bind_modify_key>. + + virtual int rebind (const KEY &key, + const VALUE &value); + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old value into the + // "out" parameter <old_value>. The function fails if <key> is not + // in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameters <old_key> and <old_value>. The + // function fails if <key> is not in the map for maps that do not + // allow user specified keys. However, for maps that allow user + // specified keys, if the key is not in the map, a new <key>/<value> + // association is created. + + virtual int trybind (const KEY &key, + VALUE &value); + // Associate <key> with <value> if and only if <key> is not in the + // map. If <key> is already in the map, then the <value> parameter + // is overwritten with the existing value in the map. Returns 0 if a + // new <key>/<value> association is created. Returns 1 if an + // attempt is made to bind an existing entry. This function fails + // for maps that do not allow user specified keys. + + virtual int find (const KEY &key, + VALUE &value); + // Locate <value> associated with <key>. + + virtual int find (const KEY &key); + // Is <key> in the map? + + virtual int unbind (const KEY &key); + // Remove <key> from the map. + + virtual int unbind (const KEY &key, + VALUE &value); + // Remove <key> from the map, and return the <value> associated with + // <key>. + + virtual size_t current_size (void); + // Return the current size of the map. + + virtual size_t total_size (void); + // Return the total size of the map. + + virtual void dump (void) const; + // Dump the state of an object. + + implementation &impl (void); + // Accessor to implementation object. + + KEY_GENERATOR &key_generator (void); + // Accessor to key generator. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. + + KEY_GENERATOR key_generator_; + // Functor class used for generating key. + + // = STL styled iterator factory functions. + + virtual iterator_implementation *begin_impl (void); + virtual iterator_implementation *end_impl (void); + // Return forward iterator. + + virtual reverse_iterator_implementation *rbegin_impl (void); + virtual reverse_iterator_implementation *rend_impl (void); + // Return reverse iterator. + +private: + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Hash_Map_Manager_Ex_Adapter (const ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR> &)) +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE> +class ACE_Map_Manager_Iterator_Adapter : public ACE_Iterator_Impl<T> +{ + // = TITLE + // Defines a iterator implementation for the Map_Manager_Adapter. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Map_Manager::iterator. +public: + + // = Traits. + typedef ACE_Map_Manager<KEY, VALUE, ACE_Null_Mutex>::iterator implementation; + + ACE_Map_Manager_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Map_Manager_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE> +class ACE_Map_Manager_Reverse_Iterator_Adapter : public ACE_Reverse_Iterator_Impl<T> +{ + // = TITLE + // Defines a reverse iterator implementation for the Map Manager. + // + // = DESCRIPTION + // Implementation to be provided by ACE_Map_Manager::reverse_iterator. +public: + + // = Traits. + typedef ACE_Map_Manager<KEY, VALUE, ACE_Null_Mutex>::reverse_iterator implementation; + + ACE_Map_Manager_Reverse_Iterator_Adapter (const implementation &impl); + // Constructor. + + virtual ~ACE_Map_Manager_Reverse_Iterator_Adapter (void); + // Destructor. + + virtual ACE_Reverse_Iterator_Impl<T> *clone (void) const; + // Clone. + + virtual int compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const; + // Comparison. + + virtual T dereference () const; + // Dereference. + + virtual void plus_plus (void); + // Advance. + + virtual void minus_minus (void); + // Reverse. + + implementation &impl (void); + // Accessor to implementation object. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class KEY_GENERATOR> +class ACE_Map_Manager_Adapter : public ACE_Map<KEY, VALUE> +{ + // = TITLE + // Defines a map implementation. + // + // = DESCRIPTION + // Implementation to be provided by <ACE_Map_Manager>. +public: + + // = Traits. + typedef ACE_Map_Manager_Iterator_Adapter<value_type, KEY, VALUE> iterator_impl; + typedef ACE_Map_Manager_Reverse_Iterator_Adapter<value_type, KEY, VALUE> reverse_iterator_impl; + typedef ACE_Map_Manager<KEY, VALUE, ACE_Null_Mutex> implementation; + + // = Initialization and termination methods. + ACE_Map_Manager_Adapter (ACE_Allocator *alloc = 0); + // Initialize with the <ACE_DEFAULT_MAP_SIZE>. + + ACE_Map_Manager_Adapter (size_t size, + ACE_Allocator *alloc = 0); + // Initialize with <size> entries. The <size> parameter is ignore + // by maps for which an initialize size does not make sense. + + virtual ~ACE_Map_Manager_Adapter (void); + // Close down and release dynamically allocated resources. + + virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, + ACE_Allocator *alloc = 0); + // Initialize a <Map> with size <length>. + + virtual int close (void); + // Close down a <Map> and release dynamically allocated resources. + + virtual int bind (const KEY &key, + const VALUE &value); + // Add <key>/<value> pair to the map. If <key> is already in the + // map then no changes are made and 1 is returned. Returns 0 on a + // successful addition. This function fails for maps that do not + // allow user specified keys. <key> is an "in" parameter. + + virtual int bind_modify_key (const VALUE &value, + KEY &key); + // Add <key>/<value> pair to the map. <key> is an "inout" parameter + // and maybe modified/extended by the map to add additional + // information. To recover original key, call the <recover_key> + // method. + + virtual int bind_create_key (const VALUE &value, + KEY &key); + // Add <value> to the map, and the corresponding key produced by the + // Map is returned through <key> which is an "out" parameter. For + // maps that do not naturally produce keys, the map adapters will + // use the <KEY_GENERATOR> class to produce a key. However, the + // users are responsible for not jeopardizing this key production + // scheme by using user specified keys with keys produced by the key + // generator. + + virtual int bind_create_key (const VALUE &value); + // Add <value> to the map. The user does not care about the + // corresponding key produced by the Map. For maps that do not + // naturally produce keys, the map adapters will use the + // <KEY_GENERATOR> class to produce a key. However, the users are + // responsible for not jeopardizing this key production scheme by + // using user specified keys with keys produced by the key + // generator. + + virtual int recover_key (const KEY &modified_key, + KEY &original_key); + // Recovers the original key potentially modified by the map during + // <bind_modify_key>. + + virtual int rebind (const KEY &key, + const VALUE &value); + // Reassociate <key> with <value>. The function fails if <key> is + // not in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old value into the + // "out" parameter <old_value>. The function fails if <key> is not + // in the map for maps that do not allow user specified keys. + // However, for maps that allow user specified keys, if the key is + // not in the map, a new <key>/<value> association is created. + + virtual int rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value); + // Reassociate <key> with <value>, storing the old key and value + // into the "out" parameters <old_key> and <old_value>. The + // function fails if <key> is not in the map for maps that do not + // allow user specified keys. However, for maps that allow user + // specified keys, if the key is not in the map, a new <key>/<value> + // association is created. + + virtual int trybind (const KEY &key, + VALUE &value); + // Associate <key> with <value> if and only if <key> is not in the + // map. If <key> is already in the map, then the <value> parameter + // is overwritten with the existing value in the map. Returns 0 if a + // new <key>/<value> association is created. Returns 1 if an + // attempt is made to bind an existing entry. This function fails + // for maps that do not allow user specified keys. + + virtual int find (const KEY &key, + VALUE &value); + // Locate <value> associated with <key>. + + virtual int find (const KEY &key); + // Is <key> in the map? + + virtual int unbind (const KEY &key); + // Remove <key> from the map. + + virtual int unbind (const KEY &key, + VALUE &value); + // Remove <key> from the map, and return the <value> associated with + // <key>. + + virtual size_t current_size (void); + // Return the current size of the map. + + virtual size_t total_size (void); + // Return the total size of the map. + + virtual void dump (void) const; + // Dump the state of an object. + + implementation &impl (void); + // Accessor to implementation object. + + KEY_GENERATOR &key_generator (void); + // Accessor to key generator. + +protected: + + implementation implementation_; + // All implementation details are forwarded to this class. + + KEY_GENERATOR key_generator_; + // Functor class used for generating key. + + // = STL styled iterator factory functions. + + virtual iterator_implementation *begin_impl (void); + virtual iterator_implementation *end_impl (void); + // Return forward iterator. + + virtual reverse_iterator_implementation *rbegin_impl (void); + virtual reverse_iterator_implementation *rend_impl (void); + // Return reverse iterator. + +private: + + // = Disallow these operations. + ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR> &)) + ACE_UNIMPLEMENTED_FUNC (ACE_Map_Manager_Adapter (const ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR> &)) +}; + +//////////////////////////////////////////////////////////////////////////////// + +#if defined (__ACE_INLINE__) +#include "ace/Map_T.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Map_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation "Map_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_MAP_T_H */ diff --git a/ace/Map_T.i b/ace/Map_T.i new file mode 100644 index 00000000000..f2e2ce51527 --- /dev/null +++ b/ace/Map_T.i @@ -0,0 +1,1625 @@ +// $Id$ + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> ACE_INLINE +ACE_Incremental_Key_Generator<T>::ACE_Incremental_Key_Generator (void) + : t_ (0) +{ +} + +template <class T> ACE_INLINE int +ACE_Incremental_Key_Generator<T>::operator() (T &t) +{ + t = ++this->t_; + return 0; +} + +template <class T> ACE_INLINE T & +ACE_Incremental_Key_Generator<T>::current_value (void) +{ + return this->t_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> ACE_INLINE +ACE_Iterator_Impl<T>::~ACE_Iterator_Impl (void) +{ +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> ACE_INLINE +ACE_Reverse_Iterator_Impl<T>::~ACE_Reverse_Iterator_Impl (void) +{ +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> ACE_INLINE +ACE_Iterator<T>::ACE_Iterator (ACE_Iterator<T>::implementation *impl) + : implementation_ (impl) +{ +} + +template <class T> ACE_INLINE +ACE_Iterator<T>::ACE_Iterator (const ACE_Iterator<T> &rhs) + : implementation_ (rhs.implementation_->clone ()) +{ +} + +template <class T> ACE_INLINE +ACE_Iterator<T>::~ACE_Iterator (void) +{ + delete this->implementation_; +} + +template <class T> ACE_INLINE ACE_Iterator<T> & +ACE_Iterator<T>::operator= (const ACE_Iterator<T> &rhs) +{ + this->~ACE_Iterator<T> (); + this->implementation_ = rhs.implementation_->clone (); +} + +template <class T> ACE_INLINE int +ACE_Iterator<T>::operator== (const ACE_Iterator<T> &rhs) const +{ + return this->implementation_->compare (*rhs.implementation_); +} + +template <class T> ACE_INLINE int +ACE_Iterator<T>::operator!= (const ACE_Iterator<T> &rhs) const +{ + return !this->operator== (rhs); +} + +template <class T> ACE_INLINE T +ACE_Iterator<T>::operator* (void) const +{ + return this->implementation_->dereference (); +} + +template <class T> ACE_INLINE ACE_Iterator<T> & +ACE_Iterator<T>::operator++ (void) +{ + this->implementation_->plus_plus (); + return *this; +} + +template <class T> ACE_INLINE ACE_Iterator<T> +ACE_Iterator<T>::operator++ (int) +{ + ACE_Iterator<T> tmp = *this; + this->implementation_->plus_plus (); + return tmp; +} + +template <class T> ACE_INLINE ACE_Iterator<T> & +ACE_Iterator<T>::operator-- (void) +{ + this->implementation_->minus_minus (); + return *this; +} + +template <class T> ACE_INLINE ACE_Iterator<T> +ACE_Iterator<T>::operator-- (int) +{ + ACE_Iterator<T> tmp = *this; + this->implementation_->minus_minus (); + return tmp; +} + +template <class T> ACE_INLINE ACE_Iterator<T>::implementation & +ACE_Iterator<T>::impl (void) +{ + return *this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T> ACE_INLINE +ACE_Reverse_Iterator<T>::ACE_Reverse_Iterator (ACE_Reverse_Iterator<T>::implementation *impl) + : implementation_ (impl) +{ +} + +template <class T> ACE_INLINE +ACE_Reverse_Iterator<T>::ACE_Reverse_Iterator (const ACE_Reverse_Iterator<T> &rhs) + : implementation_ (rhs.implementation_->clone ()) +{ +} + +template <class T> ACE_INLINE +ACE_Reverse_Iterator<T>::~ACE_Reverse_Iterator (void) +{ + delete this->implementation_; +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T> & +ACE_Reverse_Iterator<T>::operator= (const ACE_Reverse_Iterator<T> &rhs) +{ + this->~ACE_Reverse_Iterator<T> (); + this->implementation_ = rhs.implementation_->clone (); +} + +template <class T> ACE_INLINE int +ACE_Reverse_Iterator<T>::operator== (const ACE_Reverse_Iterator<T> &rhs) const +{ + return this->implementation_->compare (*rhs.implementation_); +} + +template <class T> ACE_INLINE int +ACE_Reverse_Iterator<T>::operator!= (const ACE_Reverse_Iterator<T> &rhs) const +{ + return !this->operator== (rhs); +} + +template <class T> ACE_INLINE T +ACE_Reverse_Iterator<T>::operator* (void) const +{ + return this->implementation_->dereference (); +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T> & +ACE_Reverse_Iterator<T>::operator++ (void) +{ + this->implementation_->plus_plus (); + return *this; +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T> +ACE_Reverse_Iterator<T>::operator++ (int) +{ + ACE_Reverse_Iterator<T> tmp = *this; + this->implementation_->plus_plus (); + return tmp; +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T> & +ACE_Reverse_Iterator<T>::operator-- (void) +{ + this->implementation_->minus_minus (); + return *this; +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T> +ACE_Reverse_Iterator<T>::operator-- (int) +{ + ACE_Reverse_Iterator<T> tmp = *this; + this->implementation_->minus_minus (); + return tmp; +} + +template <class T> ACE_INLINE ACE_Reverse_Iterator<T>::implementation & +ACE_Reverse_Iterator<T>::impl (void) +{ + return *this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE> ACE_INLINE +ACE_Map<KEY, VALUE>::ACE_Map (void) +{ +} + +template <class KEY, class VALUE> ACE_INLINE +ACE_Map<KEY, VALUE>::~ACE_Map (void) +{ +} + +template <class KEY, class VALUE> ACE_INLINE ACE_Map<KEY, VALUE>::iterator +ACE_Map<KEY, VALUE>::begin (void) +{ + return iterator (this->begin_impl ()); +} + +template <class KEY, class VALUE> ACE_INLINE ACE_Map<KEY, VALUE>::iterator +ACE_Map<KEY, VALUE>::end (void) +{ + return iterator (this->end_impl ()); +} + +template <class KEY, class VALUE> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator +ACE_Map<KEY, VALUE>::rbegin (void) +{ + return reverse_iterator (this->rbegin_impl ()); +} + +template <class KEY, class VALUE> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator +ACE_Map<KEY, VALUE>::rend (void) +{ + return reverse_iterator (this->rend_impl ()); +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::ACE_Map_Impl_Iterator_Adapter (const ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Iterator_Adapter (void) +{ +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE ACE_Iterator_Impl<T> * +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const +{ + return new ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> (*this); +} + + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE int +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Iterator_Impl<T> &rhs_base) const +{ + ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs + = ACE_dynamic_cast_3_ref (ACE_Map_Impl_Iterator_Adapter, T, IMPLEMENTATION, ENTRY, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE T +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const +{ + ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE void +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE void +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::implementation & +ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::ACE_Map_Impl_Reverse_Iterator_Adapter (const ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Reverse_Iterator_Adapter (void) +{ +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE ACE_Reverse_Iterator_Impl<T> * +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const +{ + return new ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> (*this); +} + + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE int +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs_base) const +{ + ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs + = ACE_dynamic_cast_3_ref (ACE_Map_Impl_Reverse_Iterator_Adapter, T, IMPLEMENTATION, ENTRY, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE T +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const +{ + ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE void +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE void +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class IMPLEMENTATION, class ENTRY> ACE_INLINE ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::implementation & +ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::ACE_Map_Impl (ACE_Allocator *alloc) + : implementation_ (alloc) +{ +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::ACE_Map_Impl (size_t size, + ACE_Allocator *alloc) + : implementation_ (size, + alloc) +{ +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::~ACE_Map_Impl (void) +{ +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::open (size_t length, + ACE_Allocator *alloc) +{ + return this->implementation_.open (length, + alloc); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::close (void) +{ + return this->implementation_.close (); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::bind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.bind (key, + value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::bind_modify_key (const VALUE &value, + KEY &key) +{ + return this->implementation_.bind_modify_key (value, + key); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::bind_create_key (const VALUE &value, + KEY &key) +{ + return this->implementation_.bind_create_key (value, + key); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::bind_create_key (const VALUE &value) +{ + return this->implementation_.bind_create_key (value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::recover_key (const KEY &modified_key, + KEY &original_key) +{ + return this->implementation_.recover_key (modified_key, + original_key); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::rebind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.rebind (key, + value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::rebind (const KEY &key, + const VALUE &value, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_key, + old_value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::trybind (const KEY &key, + VALUE &value) +{ + return this->implementation_.trybind (key, + value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::find (const KEY &key, + VALUE &value) +{ + return this->implementation_.find (key, + value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::find (const KEY &key) +{ + return this->implementation_.find (key); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::unbind (const KEY &key) +{ + return this->implementation_.unbind (key); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE int +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::unbind (const KEY &key, + VALUE &value) +{ + return this->implementation_.unbind (key, + value); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE size_t +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::current_size (void) +{ + return this->implementation_.current_size (); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE size_t +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::total_size (void) +{ + return this->implementation_.total_size (); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE void +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::dump (void) const +{ + this->implementation_.dump (); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::begin_impl (void) +{ + return new iterator_impl (this->implementation_.begin ()); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::end_impl (void) +{ + return new iterator_impl (this->implementation_.end ()); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::rbegin_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rbegin ()); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::rend_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rend ()); +} + +template <class KEY, class VALUE, class IMPLEMENTATION> ACE_INLINE ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::implementation & +ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class VALUE> ACE_INLINE +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::ACE_Active_Map_Manager_Iterator_Adapter (const ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class VALUE> ACE_INLINE +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Iterator_Adapter (void) +{ +} + +template <class T, class VALUE> ACE_INLINE ACE_Iterator_Impl<T> * +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::clone (void) const +{ + return new ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE> (*this); +} + + +template <class T, class VALUE> ACE_INLINE int +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs_base) const +{ + ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE> &rhs + = ACE_dynamic_cast_2_ref (ACE_Active_Map_Manager_Iterator_Adapter, T, VALUE, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class VALUE> ACE_INLINE T +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::dereference () const +{ + ACE_Active_Map_Manager<VALUE>::ENTRY &entry = *this->implementation_; + return T (entry.int_id_.first (), + entry.int_id_.second ()); +} + +template <class T, class VALUE> ACE_INLINE void +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class VALUE> ACE_INLINE void +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class VALUE> ACE_INLINE ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::implementation & +ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class VALUE> ACE_INLINE +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::ACE_Active_Map_Manager_Reverse_Iterator_Adapter (const ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class VALUE> ACE_INLINE +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Reverse_Iterator_Adapter (void) +{ +} + +template <class T, class VALUE> ACE_INLINE ACE_Reverse_Iterator_Impl<T> * +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::clone (void) const +{ + return new ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE> (*this); +} + + +template <class T, class VALUE> ACE_INLINE int +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs_base) const +{ + ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE> &rhs + = ACE_dynamic_cast_2_ref (ACE_Active_Map_Manager_Reverse_Iterator_Adapter, T, VALUE, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class VALUE> ACE_INLINE T +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::dereference () const +{ + ACE_Active_Map_Manager<VALUE>::ENTRY &entry = *this->implementation_; + return T (entry.int_id_.first (), + entry.int_id_.second ()); +} + +template <class T, class VALUE> ACE_INLINE void +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class VALUE> ACE_INLINE void +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class VALUE> ACE_INLINE ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::implementation & +ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::ACE_Active_Map_Manager_Adapter (ACE_Allocator *alloc) + : implementation_ (alloc) +{ +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::ACE_Active_Map_Manager_Adapter (size_t size, + ACE_Allocator *alloc) + : implementation_ (size, + alloc) +{ +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::~ACE_Active_Map_Manager_Adapter (void) +{ +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::open (size_t length, + ACE_Allocator *alloc) +{ + return this->implementation_.open (length, + alloc); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::close (void) +{ + return this->implementation_.close (); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind (const KEY &key, + const VALUE &value) +{ + ACE_NOTSUP_RETURN (-1); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_modify_key (const VALUE &value, + KEY &key) +{ + // Reserve a slot and create an active key. + expanded_value *internal_value = 0; + ACE_Active_Map_Manager_Key active_key; + int result = this->implementation_.bind (active_key, + internal_value); + if (result == 0) + { + // Encode the active key and the existing user key into key part + // of <expanded_value>. + result = this->key_adapter_.encode (key, + active_key, + internal_value->first ()); + if (result == 0) + { + // Copy user value into <expanded_value>. + internal_value->second (value); + // Copy new, modified key back to the user key. + key = internal_value->first (); + } + else + { + // In case of errors, unbind from map. + this->implementation_.unbind (active_key); + } + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value, + KEY &key) +{ + // Reserve a slot and create an active key. + expanded_value *internal_value = 0; + ACE_Active_Map_Manager_Key active_key; + int result = this->implementation_.bind (active_key, + internal_value); + if (result == 0) + { + // Encode the active key into key part of <expanded_value>. + result = this->key_adapter_.encode (internal_value->first (), + active_key, + internal_value->first ()); + if (result == 0) + { + // Copy user value into <expanded_value>. + internal_value->second (value); + // Copy new, modified key to the user key. + key = internal_value->first (); + } + else + { + // In case of errors, unbind from map. + this->implementation_.unbind (active_key); + } + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value) +{ + // Reserve a slot and create an active key. + expanded_value *internal_value = 0; + ACE_Active_Map_Manager_Key active_key; + int result = this->implementation_.bind (active_key, + internal_value); + if (result == 0) + { + // Encode the active key into key part of <expanded_value>. + result = this->key_adapter_.encode (internal_value->first (), + active_key, + internal_value->first ()); + if (result == 0) + { + // Copy user value into <expanded_value>. + internal_value->second (value); + } + else + { + // In case of errors, unbind from map. + this->implementation_.unbind (active_key); + } + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::recover_key (const KEY &modified_key, + KEY &original_key) +{ + // Ask the <key_adapter_> to help out with recovering the original + // user key, since it was the one that encode it in the first place. + return this->key_adapter_.decode (modified_key, + original_key); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key, + ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::expanded_value *&internal_value) +{ + // Ask the <key_adapter_> to recover the active key. + ACE_Active_Map_Manager_Key active_key; + int result = this->key_adapter_.decode (key, + active_key); + if (result == 0) + { + // Find recovered active key in map. + result = this->implementation_.find (active_key, + internal_value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key, + VALUE &value) +{ + expanded_value *internal_value = 0; + int result = this->find (key, + internal_value); + + if (result == 0) + { + // Copy value. + value = internal_value->second (); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key) +{ + expanded_value *internal_value = 0; + return this->find (key, + internal_value); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key, + const VALUE &value) +{ + expanded_value *internal_value = 0; + int result = this->find (key, + internal_value); + + if (result == 0) + { + // Reset value. + internal_value->second (value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key, + const VALUE &value, + VALUE &old_value) +{ + expanded_value *internal_value = 0; + int result = this->find (key, + internal_value); + + if (result == 0) + { + // Copy old value. + old_value = internal_value->second (); + + // Reset to new value. + internal_value->second (value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value) +{ + expanded_value *internal_value = 0; + int result = this->find (key, + internal_value); + + if (result == 0) + { + // Copy old key and value. + old_key = internal_value->first (); + old_value = internal_value->second (); + + // Reset to new value. + internal_value->second (value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::trybind (const KEY &key, + VALUE &value) +{ + ACE_NOTSUP_RETURN (-1); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key, + ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::expanded_value *&internal_value) +{ + // Ask the <key_adapter_> to recover the active key. + ACE_Active_Map_Manager_Key active_key; + int result = this->key_adapter_.decode (key, + active_key); + if (result == 0) + { + // Unbind recovered active key from map. + result = this->implementation_.unbind (active_key, + internal_value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key) +{ + expanded_value *internal_value = 0; + return this->unbind (key, + internal_value); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE int +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key, + VALUE &value) +{ + expanded_value *internal_value = 0; + int result = this->unbind (key, + internal_value); + + if (result == 0) + { + // Copy value. + value = internal_value->second (); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE size_t +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::current_size (void) +{ + return this->implementation_.current_size (); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE size_t +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::total_size (void) +{ + return this->implementation_.total_size (); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE void +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::dump (void) const +{ + this->implementation_.dump (); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::begin_impl (void) +{ + return new iterator_impl (this->implementation_.begin ()); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::end_impl (void) +{ + return new iterator_impl (this->implementation_.end ()); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rbegin_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rbegin ()); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rend_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rend ()); +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::implementation & +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::impl (void) +{ + return this->implementation_; +} + +template <class KEY, class VALUE, class KEY_ADAPTER> ACE_INLINE KEY_ADAPTER & +ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::key_adapter (void) +{ + return this->key_adapter_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::ACE_Hash_Map_Manager_Ex_Iterator_Adapter (const ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Iterator_Adapter (void) +{ +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE ACE_Iterator_Impl<T> * +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const +{ + return new ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> (*this); +} + + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Iterator_Impl<T> &rhs_base) const +{ + ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs + = ACE_dynamic_cast_5_ref (ACE_Hash_Map_Manager_Ex_Iterator_Adapter, T, KEY, VALUE, HASH_KEY, COMPARE_KEYS, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE T +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const +{ + ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex>::ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE void +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE void +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::implementation & +ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (void) +{ +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE ACE_Reverse_Iterator_Impl<T> * +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const +{ + return new ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> (*this); +} + + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs_base) const +{ + ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs + = ACE_dynamic_cast_5_ref (ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter, T, KEY, VALUE, HASH_KEY, COMPARE_KEYS, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE T +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const +{ + ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex>::ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE void +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE void +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_INLINE ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::implementation & +ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::ACE_Hash_Map_Manager_Ex_Adapter (ACE_Allocator *alloc) + : implementation_ (alloc) +{ +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::ACE_Hash_Map_Manager_Ex_Adapter (size_t size, + ACE_Allocator *alloc) + : implementation_ (size, + alloc) +{ +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::~ACE_Hash_Map_Manager_Ex_Adapter (void) +{ +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::open (size_t length, + ACE_Allocator *alloc) +{ + return this->implementation_.open (length, + alloc); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::close (void) +{ + return this->implementation_.close (); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.bind (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_modify_key (const VALUE &value, + KEY &key) +{ + return this->implementation_.bind (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value, + KEY &key) +{ + // Invoke the user specified key generation functor. + int result = this->key_generator_ (key); + + if (result == 0) + { + // Try to add. + result = this->implementation_.bind (key, + value); + } + + return result; +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value) +{ + KEY key; + return this->bind_create_key (value, + key); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::recover_key (const KEY &modified_key, + KEY &original_key) +{ + original_key = modified_key; + return 0; +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.rebind (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_key, + old_value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::trybind (const KEY &key, + VALUE &value) +{ + return this->implementation_.trybind (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key, + VALUE &value) +{ + return this->implementation_.find (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key) +{ + return this->implementation_.find (key); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key) +{ + return this->implementation_.unbind (key); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE int +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key, + VALUE &value) +{ + return this->implementation_.unbind (key, + value); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE size_t +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::current_size (void) +{ + return this->implementation_.current_size (); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE size_t +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::total_size (void) +{ + return this->implementation_.total_size (); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE void +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::dump (void) const +{ + this->implementation_.dump (); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::begin_impl (void) +{ + return new iterator_impl (this->implementation_.begin ()); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::end_impl (void) +{ + return new iterator_impl (this->implementation_.end ()); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rbegin_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rbegin ()); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rend_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rend ()); +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::implementation & +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::impl (void) +{ + return this->implementation_; +} + +template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_INLINE KEY_GENERATOR & +ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::key_generator (void) +{ + return this->key_generator_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE> ACE_INLINE +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::ACE_Map_Manager_Iterator_Adapter (const ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class KEY, class VALUE> ACE_INLINE +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Iterator_Adapter (void) +{ +} + +template <class T, class KEY, class VALUE> ACE_INLINE ACE_Iterator_Impl<T> * +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::clone (void) const +{ + return new ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE> (*this); +} + + +template <class T, class KEY, class VALUE> ACE_INLINE int +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs_base) const +{ + ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE> &rhs + = ACE_dynamic_cast_3_ref (ACE_Map_Manager_Iterator_Adapter, T, KEY, VALUE, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE T +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::dereference () const +{ + ACE_Map_Manager<KEY, VALUE, ACE_Null_Mutex>::ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class KEY, class VALUE> ACE_INLINE void +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE void +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::implementation & +ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T, class KEY, class VALUE> ACE_INLINE +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::ACE_Map_Manager_Reverse_Iterator_Adapter (const ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::implementation &impl) + : implementation_ (impl) +{ +} + +template <class T, class KEY, class VALUE> ACE_INLINE +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Reverse_Iterator_Adapter (void) +{ +} + +template <class T, class KEY, class VALUE> ACE_INLINE ACE_Reverse_Iterator_Impl<T> * +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::clone (void) const +{ + return new ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE> (*this); +} + + +template <class T, class KEY, class VALUE> ACE_INLINE int +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs_base) const +{ + ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE> &rhs + = ACE_dynamic_cast_3_ref (ACE_Map_Manager_Reverse_Iterator_Adapter, T, KEY, VALUE, rhs_base); + + return this->implementation_ == rhs.implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE T +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::dereference () const +{ + ACE_Map_Manager<KEY, VALUE, ACE_Null_Mutex>::ENTRY &entry = *this->implementation_; + return T (entry.ext_id_, + entry.int_id_); +} + +template <class T, class KEY, class VALUE> ACE_INLINE void +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void) +{ + ++this->implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE void +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void) +{ + --this->implementation_; +} + +template <class T, class KEY, class VALUE> ACE_INLINE ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::implementation & +ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::impl (void) +{ + return this->implementation_; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::ACE_Map_Manager_Adapter (ACE_Allocator *alloc) + : implementation_ (alloc) +{ +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::ACE_Map_Manager_Adapter (size_t size, + ACE_Allocator *alloc) + : implementation_ (size, + alloc) +{ +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::~ACE_Map_Manager_Adapter (void) +{ +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::open (size_t length, + ACE_Allocator *alloc) +{ + return this->implementation_.open (length, + alloc); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::close (void) +{ + return this->implementation_.close (); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.bind (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_modify_key (const VALUE &value, + KEY &key) +{ + return this->implementation_.bind (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value, + KEY &key) +{ + // Invoke the user specified key generation functor. + int result = this->key_generator_ (key); + + if (result == 0) + { + // Try to add. + result = this->implementation_.bind (key, + value); + } + + return result; +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value) +{ + KEY key; + return this->bind_create_key (value, + key); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::recover_key (const KEY &modified_key, + KEY &original_key) +{ + original_key = modified_key; + return 0; +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value) +{ + return this->implementation_.rebind (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key, + const VALUE &value, + KEY &old_key, + VALUE &old_value) +{ + return this->implementation_.rebind (key, + value, + old_key, + old_value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::trybind (const KEY &key, + VALUE &value) +{ + return this->implementation_.trybind (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key, + VALUE &value) +{ + return this->implementation_.find (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key) +{ + return this->implementation_.find (key); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key) +{ + return this->implementation_.unbind (key); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE int +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key, + VALUE &value) +{ + return this->implementation_.unbind (key, + value); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE size_t +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::current_size (void) +{ + return this->implementation_.current_size (); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE size_t +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::total_size (void) +{ + return this->implementation_.total_size (); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE void +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::dump (void) const +{ + this->implementation_.dump (); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::begin_impl (void) +{ + return new iterator_impl (this->implementation_.begin ()); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::iterator_implementation * +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::end_impl (void) +{ + return new iterator_impl (this->implementation_.end ()); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rbegin_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rbegin ()); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE ACE_Map<KEY, VALUE>::reverse_iterator_implementation * +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rend_impl (void) +{ + return new reverse_iterator_impl (this->implementation_.rend ()); +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::implementation & +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::impl (void) +{ + return this->implementation_; +} + +template <class KEY, class VALUE, class KEY_GENERATOR> ACE_INLINE KEY_GENERATOR & +ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::key_generator (void) +{ + return this->key_generator_; +} + +//////////////////////////////////////////////////////////////////////////////// @@ -46,21 +46,51 @@ # endif /* defined (ACE_LACKS_INLINE_FUNCTIONS) && !defined (ACE_NO_INLINE) */ # if defined (ACE_HAS_ANSI_CASTS) -# define ACE_static_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) -# define ACE_const_cast(TYPE, EXPR) const_cast<TYPE> (EXPR) -# define ACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast<TYPE> (EXPR) +# define ACE_sap_any_cast(TYPE) reinterpret_cast<TYPE> (const_cast<ACE_Addr &> (ACE_Addr::sap_any)) +# define ACE_static_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define ACE_const_cast(TYPE, EXPR) const_cast<TYPE> (EXPR) +# define ACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast<TYPE> (EXPR) # if defined (ACE_LACKS_RTTI) -# define ACE_dynamic_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define ACE_dynamic_cast(TYPE, EXPR) static_cast< TYPE > (EXPR) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) static_cast< TYPE<T1> *> (EXPR) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) static_cast< TYPE<T1, T2> *> (EXPR) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) static_cast< TYPE<T1, T2, T3> *> (EXPR) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) static_cast< TYPE<T1, T2, T3, T4> *> (EXPR) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast< TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) static_cast< TYPE<T1> &> (EXPR) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) static_cast< TYPE<T1, T2> &> (EXPR) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) static_cast< TYPE<T1, T2, T3> &> (EXPR) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) static_cast< TYPE<T1, T2, T3, T4> &> (EXPR) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast< TYPE<T1, T2, T3, T4, T5> &> (EXPR) # else /* ! ACE_LACKS_RTTI */ -# define ACE_dynamic_cast(TYPE, EXPR) dynamic_cast<TYPE> (EXPR) +# define ACE_dynamic_cast(TYPE, EXPR) dynamic_cast< TYPE > (EXPR) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) dynamic_cast< TYPE<T1> *> (EXPR) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) dynamic_cast< TYPE<T1, T2> *> (EXPR) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) dynamic_cast< TYPE<T1, T2, T3> *> (EXPR) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4> *> (EXPR) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) dynamic_cast< TYPE<T1> &> (EXPR) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) dynamic_cast< TYPE<T1, T2> &> (EXPR) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) dynamic_cast< TYPE<T1, T2, T3> &> (EXPR) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4> &> (EXPR) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast< TYPE<T1, T2, T3, T4, T5> &> (EXPR) # endif /* ! ACE_LACKS_RTTI */ -# define ACE_sap_any_cast(TYPE) reinterpret_cast<TYPE> (const_cast<ACE_Addr &> (ACE_Addr::sap_any)) # else -# define ACE_static_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_const_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_reinterpret_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_dynamic_cast(TYPE, EXPR) ((TYPE) (EXPR)) -# define ACE_sap_any_cast(TYPE) ((TYPE) (ACE_Addr::sap_any)) +# define ACE_sap_any_cast(TYPE) ((TYPE) (ACE_Addr::sap_any)) +# define ACE_static_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_const_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_reinterpret_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_dynamic_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define ACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define ACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define ACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define ACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define ACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define ACE_dynamic_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define ACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define ACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define ACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define ACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) # endif /* ACE_HAS_ANSI_CASTS */ # if !defined (ACE_CAST_CONST) diff --git a/ace/Pair.cpp b/ace/Pair.cpp new file mode 100644 index 00000000000..340a58a581b --- /dev/null +++ b/ace/Pair.cpp @@ -0,0 +1,25 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Pair.cpp +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#define ACE_BUILD_DLL + +#include "ace/Pair.h" + +ACE_RCSID(ace, Pair, "$Id$") + +#if !defined (__ACE_INLINE__) +#include "ace/Pair.i" +#endif /* __ACE_INLINE__ */ + diff --git a/ace/Pair.h b/ace/Pair.h new file mode 100644 index 00000000000..f21097240f5 --- /dev/null +++ b/ace/Pair.h @@ -0,0 +1,33 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Pair.h +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#ifndef ACE_PAIR_H +#define ACE_PAIR_H + +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (__ACE_INLINE__) +#include "ace/Pair.i" +#endif /* __ACE_INLINE__ */ + +// Include the templates here. +#include "ace/Pair_T.h" + +#endif /* ACE_PAIR_H */ diff --git a/ace/Pair.i b/ace/Pair.i new file mode 100644 index 00000000000..74e88caa0c5 --- /dev/null +++ b/ace/Pair.i @@ -0,0 +1,2 @@ +// $Id$ + diff --git a/ace/Pair_T.cpp b/ace/Pair_T.cpp new file mode 100644 index 00000000000..27e7f6d34df --- /dev/null +++ b/ace/Pair_T.cpp @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef ACE_PAIR_T_C +#define ACE_PAIR_T_C + +#include "ace/Pair_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (__ACE_INLINE__) +#include "ace/Pair_T.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ace, Pair_T, "$Id$") + +#endif /* ACE_PAIR_T_C */ diff --git a/ace/Pair_T.h b/ace/Pair_T.h new file mode 100644 index 00000000000..1e9ffd80fe3 --- /dev/null +++ b/ace/Pair_T.h @@ -0,0 +1,112 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Pair_T.h +// +// = AUTHOR +// Irfan Pyarali +// +// ============================================================================ + +#ifndef ACE_PAIR_T_H +#define ACE_PAIR_T_H + +#include "ace/Pair.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +//////////////////////////////////////////////////////////////////////////////// + +template <class T1, class T2> +class ACE_Pair +{ + // = TITLE + // Defines a pair. + // + // = DESCRIPTION + // Similar to the STL pair. +public: + + // = Traits. + typedef T1 first_type; + typedef T2 second_type; + + // = Initialization and termination methods. + ACE_Pair (const T1 &t1, + const T2 &t2); + // Constructor. + + ACE_Pair (void); + // Default constructor. + + T1 &first (void); + void first (const T1 &t1); + // Get/Set first. + + T2 &second (void); + void second (const T2 &t2); + // Access second. + +protected: + + T1 first_; + T2 second_; +}; + +//////////////////////////////////////////////////////////////////////////////// + +template <class T1, class T2> +class ACE_Reference_Pair +{ + // = TITLE + // Defines a pair that only hold references. + // + // = DESCRIPTION + // Similar to the STL pair (but restricted to holding references + // and not copies). +public: + + // = Traits. + typedef T1 first_type; + typedef T2 second_type; + + // = Initialization and termination methods. + ACE_Reference_Pair (T1 &t1, + T2 &t2); + // Constructor. + + T1 &first (void); + // Access first. + + T2 &second (void); + // Access second. + +protected: + + T1 &first_; + T2 &second_; +}; + +//////////////////////////////////////////////////////////////////////////////// + +#if defined (__ACE_INLINE__) +#include "ace/Pair_T.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Pair_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation "Pair_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_PAIR_T_H */ diff --git a/ace/Pair_T.i b/ace/Pair_T.i new file mode 100644 index 00000000000..4769f20e4b5 --- /dev/null +++ b/ace/Pair_T.i @@ -0,0 +1,66 @@ +// $Id$ + +//////////////////////////////////////////////////////////////////////////////// + +template <class T1, class T2> ACE_INLINE +ACE_Pair<T1, T2>::ACE_Pair (const T1 &t1, + const T2 &t2) + : first_ (t1), + second_ (t2) +{ +} + +template <class T1, class T2> ACE_INLINE +ACE_Pair<T1, T2>::ACE_Pair (void) + : first_ (), + second_ () +{ +} + +template <class T1, class T2> ACE_INLINE T1 & +ACE_Pair<T1, T2>::first (void) +{ + return this->first_; +} + +template <class T1, class T2> ACE_INLINE void +ACE_Pair<T1, T2>::first (const T1 &t1) +{ + this->first_ = t1; +} + +template <class T1, class T2> ACE_INLINE T2 & +ACE_Pair<T1, T2>::second (void) +{ + return this->second_; +} + +template <class T1, class T2> ACE_INLINE void +ACE_Pair<T1, T2>::second (const T2 &t2) +{ + this->second_ = t2; +} + +//////////////////////////////////////////////////////////////////////////////// + +template <class T1, class T2> ACE_INLINE +ACE_Reference_Pair<T1, T2>::ACE_Reference_Pair (T1 &t1, + T2 &t2) + : first_ (t1), + second_ (t2) +{ +} + +template <class T1, class T2> ACE_INLINE T1 & +ACE_Reference_Pair<T1, T2>::first (void) +{ + return this->first_; +} + +template <class T1, class T2> ACE_INLINE T2 & +ACE_Reference_Pair<T1, T2>::second (void) +{ + return this->second_; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/ace/ace_dll.dsp b/ace/ace_dll.dsp index 2ff7670872a..80b1e5d44cf 100644 --- a/ace/ace_dll.dsp +++ b/ace/ace_dll.dsp @@ -172,9 +172,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MTd /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MTd /c
# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MDd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MDd /c
# SUBTRACT CPP /YX /Yc /Yu
MTL=midl.exe
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
@@ -206,9 +206,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
+# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
# SUBTRACT CPP /YX
MTL=midl.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
@@ -240,9 +240,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
# SUBTRACT CPP /YX
MTL=midl.exe
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
@@ -274,9 +274,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
# SUBTRACT CPP /YX
MTL=midl.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
@@ -7557,6 +7557,29 @@ DEP_CPP_MALLO=\ # End Source File
# Begin Source File
+SOURCE=.\Map.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.cpp
!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
@@ -10730,6 +10753,29 @@ DEP_CPP_OS_CP=\ # End Source File
# Begin Source File
+SOURCE=.\Pair.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.cpp
!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
@@ -25772,10 +25818,18 @@ SOURCE=.\Managed_Object.h # End Source File
# Begin Source File
+SOURCE=.\Map.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Map_Manager.h
# End Source File
# Begin Source File
+SOURCE=.\Map_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.h
# End Source File
# Begin Source File
@@ -25844,6 +25898,14 @@ SOURCE=.\OS.h # End Source File
# Begin Source File
+SOURCE=.\Pair.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Pair_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.h
# End Source File
# Begin Source File
@@ -26488,10 +26550,18 @@ SOURCE=.\Managed_Object.i # End Source File
# Begin Source File
+SOURCE=.\Map.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Map_Manager.i
# End Source File
# Begin Source File
+SOURCE=.\Map_T.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.i
# End Source File
# Begin Source File
@@ -26540,6 +26610,14 @@ SOURCE=.\OS.i # End Source File
# Begin Source File
+SOURCE=.\Pair.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\Pair_T.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.i
# End Source File
# Begin Source File
@@ -27079,6 +27157,29 @@ SOURCE=.\Map_Manager.cpp # End Source File
# Begin Source File
+SOURCE=.\Map_T.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Message_Queue_T.cpp
!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
@@ -27128,6 +27229,29 @@ SOURCE=.\Module.cpp # End Source File
# Begin Source File
+SOURCE=.\Pair_T.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Select_Reactor_T.cpp
!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
diff --git a/ace/ace_lib.dsp b/ace/ace_lib.dsp index e3d8617abda..856303ca911 100644 --- a/ace/ace_lib.dsp +++ b/ace/ace_lib.dsp @@ -14,30 +14,22 @@ CFG=ACE static library - Win32 Alpha Unicode Debug !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "ace_lib.mak"\
- CFG="ACE static library - Win32 Alpha Unicode Debug"
+!MESSAGE NMAKE /f "ace_lib.mak" CFG="ACE static library - Win32 Alpha Unicode Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "ACE static library - Win32 Debug" (based on\
- "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Release" (based on\
- "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Unicode Debug" (based on\
- "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Unicode Release" (based on\
- "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Debug" (based on\
- "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Release" (based on\
- "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Unicode Debug" (based on\
- "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Unicode Release" (based on\
- "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Unicode Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Unicode Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Debug" (based on "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Release" (based on "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Unicode Debug" (based on "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Unicode Release" (based on "Win32 (ALPHA) Static Library")
!MESSAGE
# Begin Project
+# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
@@ -53,11 +45,13 @@ CFG=ACE static library - Win32 Alpha Unicode Debug # PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Debug"
# PROP Target_Dir ""
-RSC=rc.exe
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /Gy /I "..\STL" /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /FD /c
# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -77,11 +71,13 @@ LIB32=link.exe -lib # PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Release"
# PROP Target_Dir ""
-RSC=rc.exe
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MT /W3 /GX /O1 /I "..\STL" /I "..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -101,11 +97,13 @@ LIB32=link.exe -lib # PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Unicode_Debug"
# PROP Target_Dir ""
-RSC=rc.exe
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /Gy /I "..\STL" /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "_DEBUG" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -125,11 +123,13 @@ LIB32=link.exe -lib # PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Unicode_Release"
# PROP Target_Dir ""
-RSC=rc.exe
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MT /W3 /GX /O1 /I "..\STL" /I "..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -150,9 +150,9 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Lib\Debug"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /MTd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /MTd /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -174,9 +174,9 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Lib\Release"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -198,9 +198,9 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LIB\Unicode_Debug"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /MTd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /MTd /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -222,9 +222,9 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "LIB\Unicode_Release"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\ /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -4518,6 +4518,29 @@ DEP_CPP_MALLO=\ # End Source File
# Begin Source File
+SOURCE=.\Map.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
@@ -6137,6 +6160,29 @@ DEP_CPP_OS_CP=\ # End Source File
# Begin Source File
+SOURCE=.\Pair.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
@@ -14709,10 +14755,18 @@ SOURCE=.\Malloc_T.h # End Source File
# Begin Source File
+SOURCE=.\Map.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Map_Manager.h
# End Source File
# Begin Source File
+SOURCE=.\Map_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.h
# End Source File
# Begin Source File
@@ -14773,6 +14827,14 @@ SOURCE=.\OS.h # End Source File
# Begin Source File
+SOURCE=.\Pair.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Pair_T.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.h
# End Source File
# Begin Source File
@@ -15365,10 +15427,18 @@ SOURCE=.\Malloc_T.i # End Source File
# Begin Source File
+SOURCE=.\Map.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Map_Manager.i
# End Source File
# Begin Source File
+SOURCE=.\Map_T.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Mem_Map.i
# End Source File
# Begin Source File
@@ -15405,6 +15475,14 @@ SOURCE=.\OS.i # End Source File
# Begin Source File
+SOURCE=.\Pair.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\Pair_T.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Parse_Node.i
# End Source File
# Begin Source File
@@ -15879,6 +15957,29 @@ SOURCE=.\Map_Manager.cpp # End Source File
# Begin Source File
+SOURCE=.\Map_T.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Message_Queue_T.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
@@ -15928,6 +16029,29 @@ SOURCE=.\Module.cpp # End Source File
# Begin Source File
+SOURCE=.\Pair_T.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Select_Reactor_T.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 0aa37d9c1a4..549ed1a0206 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -7,6 +7,11 @@ #ifndef ACE_WIN32_COMMON_H #define ACE_WIN32_COMMON_H +// Define WIN32 if not already defined. +#ifndef WIN32 +#define WIN32 +#endif /* WIN32 */ + // ---------------- platform features or lack of them ------------- #if !defined (ACE_HAS_WINCE) |