ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER > Class Template Reference

Defines a map implementation. More...

#include <Map_T.h>

Inheritance diagram for ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Pair< KEY, VALUE > expanded_value
typedef ACE_Active_Map_Manager_Iterator_Adapter<
ACE_Reference_Pair< const
KEY, VALUE >, expanded_value
iterator_impl
typedef ACE_Active_Map_Manager_Reverse_Iterator_Adapter<
ACE_Reference_Pair< const
KEY, VALUE >, expanded_value
reverse_iterator_impl
typedef ACE_Active_Map_Manager<
expanded_value
implementation

Public Member Functions

 ACE_Active_Map_Manager_Adapter (ACE_Allocator *alloc=0)
 Initialize with the .

 ACE_Active_Map_Manager_Adapter (size_t size, ACE_Allocator *alloc=0)
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 with size .

virtual int close (void)
 Close down a and release dynamically allocated resources.

virtual int bind (const KEY &key, const VALUE &value)
virtual int bind_modify_key (const VALUE &value, KEY &key)
virtual int create_key (KEY &key)
virtual int bind_create_key (const VALUE &value, KEY &key)
virtual int bind_create_key (const VALUE &value)
virtual int recover_key (const KEY &modified_key, KEY &original_key)
virtual int rebind (const KEY &key, const VALUE &value)
virtual int rebind (const KEY &key, const VALUE &value, VALUE &old_value)
virtual int rebind (const KEY &key, const VALUE &value, KEY &old_key, VALUE &old_value)
virtual int trybind (const KEY &key, VALUE &value)
virtual int find (const KEY &key, VALUE &value)
 Locate associated with .

virtual int find (const KEY &key)
 Is in the map?

virtual int unbind (const KEY &key)
 Remove from the map.

virtual int unbind (const KEY &key, VALUE &value)
virtual size_t current_size (void) const
 Return the current size of the map.

virtual size_t total_size (void) const
 Return the total size of the map.

virtual void dump (void) const
 Dump the state of an object.

ACE_Active_Map_Manager< ACE_Pair<
KEY, VALUE > > & 
impl (void)
 Accessor to implementation object.

KEY_ADAPTER & key_adapter (void)
 Accessor to key adapter.


Protected Member Functions

virtual int find (const KEY &key, expanded_value *&internal_value)
 Find helper.

virtual int unbind (const KEY &key, expanded_value *&internal_value)
 Unbind helper.

virtual ACE_Iterator_Impl<
ACE_Reference_Pair< const
KEY, VALUE > > * 
begin_impl (void)
 Return forward iterator.

virtual ACE_Iterator_Impl<
ACE_Reference_Pair< const
KEY, VALUE > > * 
end_impl (void)
virtual ACE_Reverse_Iterator_Impl<
ACE_Reference_Pair< const
KEY, VALUE > > * 
rbegin_impl (void)
 Return reverse iterator.

virtual ACE_Reverse_Iterator_Impl<
ACE_Reference_Pair< const
KEY, VALUE > > * 
rend_impl (void)

Protected Attributes

ACE_Active_Map_Manager< ACE_Pair<
KEY, VALUE > > 
implementation_
 All implementation details are forwarded to this class.

KEY_ADAPTER key_adapter_
 Adapts between the user key and the Active_Map_Manager_Key.


Private Member Functions

void operator= (const ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER > &)
 ACE_Active_Map_Manager_Adapter (const ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER > &)

Detailed Description

template<class KEY, class VALUE, class KEY_ADAPTER>
class ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >

Defines a map implementation.

Implementation to be provided by .

Definition at line 828 of file Map_T.h.


Member Typedef Documentation

template<class KEY, class VALUE, class KEY_ADAPTER>
typedef ACE_Pair<KEY, VALUE> ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value
 

Definition at line 834 of file Map_T.h.

Referenced by ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_create_key(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_modify_key(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rebind(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().

template<class KEY, class VALUE, class KEY_ADAPTER>
typedef ACE_Active_Map_Manager<expanded_value> ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::implementation
 

Definition at line 840 of file Map_T.h.

template<class KEY, class VALUE, class KEY_ADAPTER>
typedef ACE_Active_Map_Manager_Iterator_Adapter<ACE_Reference_Pair<const KEY, VALUE>, expanded_value> ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::iterator_impl
 

Definition at line 836 of file Map_T.h.

template<class KEY, class VALUE, class KEY_ADAPTER>
typedef ACE_Active_Map_Manager_Reverse_Iterator_Adapter<ACE_Reference_Pair<const KEY, VALUE>, expanded_value> ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::reverse_iterator_impl
 

Definition at line 838 of file Map_T.h.


Constructor & Destructor Documentation

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 = 0  ) 
 

Initialize with the .

Definition at line 290 of file Map_T.inl.

00291   : implementation_ (alloc)
00292 {
00293 }

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 = 0
 

Initialize with entries. The parameter is ignored by maps for which an initialize size does not make sense.

Definition at line 296 of file Map_T.inl.

00298   : implementation_ (size,
00299                      alloc)
00300 {
00301 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::~ACE_Active_Map_Manager_Adapter void   )  [virtual]
 

Close down and release dynamically allocated resources.

Definition at line 406 of file Map_T.cpp.

00407 {
00408 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::ACE_Active_Map_Manager_Adapter const ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER > &   )  [private]
 


Member Function Documentation

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::begin_impl void   )  [protected, virtual]
 

Return forward iterator.

Implements ACE_Map< KEY, VALUE >.

Definition at line 716 of file Map_T.cpp.

References ACE_NEW_RETURN.

00717 {
00718   ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
00719   ACE_NEW_RETURN (temp,
00720                   iterator_impl (this->implementation_.begin ()),
00721                   0);
00722   return temp;
00723 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind const KEY &  key,
const VALUE &  value
[virtual]
 

Add / pair to the map. If 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. is an "in" parameter.

Implements ACE_Map< KEY, VALUE >.

Definition at line 425 of file Map_T.cpp.

References ACE_NOTSUP_RETURN.

00427 {
00428   ACE_NOTSUP_RETURN (-1);
00429 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_create_key const VALUE &  value  )  [virtual]
 

Add 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 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.

Implements ACE_Map< KEY, VALUE >.

Definition at line 503 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::bind(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Pair< KEY, VALUE >::first(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_, ACE_Pair< KEY, VALUE >::second(), and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::unbind().

00504 {
00505   // Reserve a slot and create an active key.
00506   expanded_value *internal_value = 0;
00507   ACE_Active_Map_Manager_Key active_key;
00508   int result = this->implementation_.bind (active_key,
00509                                            internal_value);
00510   if (result == 0)
00511     {
00512       // Encode the active key into key part of <expanded_value>.
00513       result = this->key_adapter_.encode (internal_value->first (),
00514                                           active_key,
00515                                           internal_value->first ());
00516       if (result == 0)
00517         {
00518           // Copy user value into <expanded_value>.
00519           internal_value->second (value);
00520         }
00521       else
00522         {
00523           // In case of errors, unbind from map.
00524           this->implementation_.unbind (active_key);
00525         }
00526     }
00527 
00528   return result;
00529 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_create_key const VALUE &  value,
KEY &  key
[virtual]
 

Add to the map, and the corresponding key produced by the Map is returned through which is an "out" parameter. For maps that do not naturally produce keys, the map adapters will use the 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.

Implements ACE_Map< KEY, VALUE >.

Definition at line 471 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::bind(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Pair< KEY, VALUE >::first(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_, ACE_Pair< KEY, VALUE >::second(), and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::unbind().

00473 {
00474   // Reserve a slot and create an active key.
00475   expanded_value *internal_value = 0;
00476   ACE_Active_Map_Manager_Key active_key;
00477   int result = this->implementation_.bind (active_key,
00478                                            internal_value);
00479   if (result == 0)
00480     {
00481       // Encode the active key into key part of <expanded_value>.
00482       result = this->key_adapter_.encode (internal_value->first (),
00483                                           active_key,
00484                                           internal_value->first ());
00485       if (result == 0)
00486         {
00487           // Copy user value into <expanded_value>.
00488           internal_value->second (value);
00489           // Copy new, modified key to the user key.
00490           key = internal_value->first ();
00491         }
00492       else
00493         {
00494           // In case of errors, unbind from map.
00495           this->implementation_.unbind (active_key);
00496         }
00497     }
00498 
00499   return result;
00500 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_modify_key const VALUE &  value,
KEY &  key
[virtual]
 

Add / pair to the map. is an "inout" parameter and maybe modified/extended by the map to add additional information. To recover original key, call the method.

Implements ACE_Map< KEY, VALUE >.

Definition at line 432 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::bind(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Pair< KEY, VALUE >::first(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_, ACE_Pair< KEY, VALUE >::second(), and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::unbind().

00434 {
00435   // Reserve a slot and create an active key.
00436   expanded_value *internal_value = 0;
00437   ACE_Active_Map_Manager_Key active_key;
00438   int result = this->implementation_.bind (active_key,
00439                                            internal_value);
00440   if (result == 0)
00441     {
00442       // Encode the active key and the existing user key into key part
00443       // of <expanded_value>.
00444       result = this->key_adapter_.encode (key,
00445                                           active_key,
00446                                           internal_value->first ());
00447       if (result == 0)
00448         {
00449           // Copy user value into <expanded_value>.
00450           internal_value->second (value);
00451           // Copy new, modified key back to the user key.
00452           key = internal_value->first ();
00453         }
00454       else
00455         {
00456           // In case of errors, unbind from map.
00457           this->implementation_.unbind (active_key);
00458         }
00459     }
00460 
00461   return result;
00462 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::close void   )  [virtual]
 

Close down a and release dynamically allocated resources.

Implements ACE_Map< KEY, VALUE >.

Definition at line 419 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::close().

00420 {
00421   return this->implementation_.close ();
00422 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::create_key KEY &  key  )  [virtual]
 

Produce a key and return it through which is an "out" parameter. For maps that do not naturally produce keys, the map adapters will use the 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.

Implements ACE_Map< KEY, VALUE >.

Definition at line 465 of file Map_T.cpp.

References ACE_NOTSUP_RETURN.

00466 {
00467   ACE_NOTSUP_RETURN (-1);
00468 }

template<class KEY, class VALUE, class KEY_ADAPTER>
size_t ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::current_size void   )  const [virtual]
 

Return the current size of the map.

Implements ACE_Map< KEY, VALUE >.

Definition at line 696 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::current_size().

00697 {
00698   return this->implementation_.current_size ();
00699 }

template<class KEY, class VALUE, class KEY_ADAPTER>
void ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::dump void   )  const [virtual]
 

Dump the state of an object.

Implements ACE_Map< KEY, VALUE >.

Definition at line 708 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::dump().

00709 {
00710 #if defined (ACE_HAS_DUMP)
00711   this->implementation_.dump ();
00712 #endif /* ACE_HAS_DUMP */
00713 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::end_impl void   )  [protected, virtual]
 

Implements ACE_Map< KEY, VALUE >.

Definition at line 726 of file Map_T.cpp.

References ACE_NEW_RETURN.

00727 {
00728   ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
00729   ACE_NEW_RETURN (temp,
00730                   iterator_impl (this->implementation_.end ()),
00731                   0);
00732   return temp;
00733 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find const KEY &  key,
expanded_value *&  internal_value
[protected, virtual]
 

Find helper.

Definition at line 542 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::find(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_.

00544 {
00545   // Ask the <key_adapter_> to recover the active key.
00546   ACE_Active_Map_Manager_Key active_key;
00547   int result = this->key_adapter_.decode (key,
00548                                           active_key);
00549   if (result == 0)
00550     {
00551       // Find recovered active key in map.
00552       result = this->implementation_.find (active_key,
00553                                            internal_value);
00554     }
00555 
00556   return result;
00557 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find const KEY &  key  )  [virtual]
 

Is in the map?

Implements ACE_Map< KEY, VALUE >.

Definition at line 577 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find().

00578 {
00579   expanded_value *internal_value = 0;
00580   return this->find (key,
00581                      internal_value);
00582 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find const KEY &  key,
VALUE &  value
[virtual]
 

Locate associated with .

Implements ACE_Map< KEY, VALUE >.

Definition at line 560 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, and ACE_Pair< KEY, VALUE >::second().

Referenced by ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rebind().

00562 {
00563   expanded_value *internal_value = 0;
00564   int result = this->find (key,
00565                            internal_value);
00566 
00567   if (result == 0)
00568     {
00569       // Copy value.
00570       value = internal_value->second ();
00571     }
00572 
00573   return result;
00574 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_INLINE ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > > & ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::impl void   ) 
 

Accessor to implementation object.

Definition at line 304 of file Map_T.inl.

00305 {
00306   return this->implementation_;
00307 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_INLINE KEY_ADAPTER & ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter void   ) 
 

Accessor to key adapter.

Definition at line 310 of file Map_T.inl.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_.

00311 {
00312   return this->key_adapter_;
00313 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::open size_t  length = ACE_DEFAULT_MAP_SIZE,
ACE_Allocator alloc = 0
[virtual]
 

Initialize a with size .

Implements ACE_Map< KEY, VALUE >.

Definition at line 411 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::open().

00413 {
00414   return this->implementation_.open (length,
00415                                      alloc);
00416 }

template<class KEY, class VALUE, class KEY_ADAPTER>
void ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::operator= const ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER > &   )  [private]
 

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Reverse_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rbegin_impl void   )  [protected, virtual]
 

Return reverse iterator.

Implements ACE_Map< KEY, VALUE >.

Definition at line 736 of file Map_T.cpp.

References ACE_NEW_RETURN.

00737 {
00738   ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
00739   ACE_NEW_RETURN (temp,
00740                   reverse_iterator_impl (this->implementation_.rbegin ()),
00741                   0);
00742   return temp;
00743 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rebind const KEY &  key,
const VALUE &  value,
KEY &  old_key,
VALUE &  old_value
[virtual]
 

Reassociate with , storing the old key and value into the "out" parameters and . The function fails if 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 / association is created.

Implements ACE_Map< KEY, VALUE >.

Definition at line 623 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), ACE_Pair< KEY, VALUE >::first(), and ACE_Pair< KEY, VALUE >::second().

00627 {
00628   expanded_value *internal_value = 0;
00629   int result = this->find (key,
00630                            internal_value);
00631 
00632   if (result == 0)
00633     {
00634       // Copy old key and value.
00635       old_key = internal_value->first ();
00636       old_value = internal_value->second ();
00637 
00638       // Reset to new value.
00639       internal_value->second (value);
00640     }
00641 
00642   return result;
00643 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rebind const KEY &  key,
const VALUE &  value,
VALUE &  old_value
[virtual]
 

Reassociate with , storing the old value into the "out" parameter . The function fails if 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 / association is created.

Implements ACE_Map< KEY, VALUE >.

Definition at line 602 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), and ACE_Pair< KEY, VALUE >::second().

00605 {
00606   expanded_value *internal_value = 0;
00607   int result = this->find (key,
00608                            internal_value);
00609 
00610   if (result == 0)
00611     {
00612       // Copy old value.
00613       old_value = internal_value->second ();
00614 
00615       // Reset to new value.
00616       internal_value->second (value);
00617     }
00618 
00619   return result;
00620 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rebind const KEY &  key,
const VALUE &  value
[virtual]
 

Reassociate with . The function fails if 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 / association is created.

Implements ACE_Map< KEY, VALUE >.

Definition at line 585 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), and ACE_Pair< KEY, VALUE >::second().

00587 {
00588   expanded_value *internal_value = 0;
00589   int result = this->find (key,
00590                            internal_value);
00591 
00592   if (result == 0)
00593     {
00594       // Reset value.
00595       internal_value->second (value);
00596     }
00597 
00598   return result;
00599 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::recover_key const KEY &  modified_key,
KEY &  original_key
[virtual]
 

Recovers the original key potentially modified by the map during .

Implements ACE_Map< KEY, VALUE >.

Definition at line 532 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_.

00534 {
00535   // Ask the <key_adapter_> to help out with recovering the original
00536   // user key, since it was the one that encode it in the first place.
00537   return this->key_adapter_.decode (modified_key,
00538                                     original_key);
00539 }

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Reverse_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::rend_impl void   )  [protected, virtual]
 

Implements ACE_Map< KEY, VALUE >.

Definition at line 746 of file Map_T.cpp.

References ACE_NEW_RETURN.

00747 {
00748   ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
00749   ACE_NEW_RETURN (temp,
00750                   reverse_iterator_impl (this->implementation_.rend ()),
00751                   0);
00752   return temp;
00753 }

template<class KEY, class VALUE, class KEY_ADAPTER>
size_t ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::total_size void   )  const [virtual]
 

Return the total size of the map.

Implements ACE_Map< KEY, VALUE >.

Definition at line 702 of file Map_T.cpp.

References ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::total_size().

00703 {
00704   return this->implementation_.total_size ();
00705 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::trybind const KEY &  key,
VALUE &  value
[virtual]
 

Associate with if and only if is not in the map. If is already in the map, then the parameter is overwritten with the existing value in the map. Returns 0 if a new / 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.

Implements ACE_Map< KEY, VALUE >.

Definition at line 646 of file Map_T.cpp.

References ACE_NOTSUP_RETURN.

00648 {
00649   ACE_NOTSUP_RETURN (-1);
00650 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind const KEY &  key,
expanded_value *&  internal_value
[protected, virtual]
 

Unbind helper.

Definition at line 653 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_, and ACE_Active_Map_Manager< ACE_Pair< KEY, VALUE > >::unbind().

00655 {
00656   // Ask the <key_adapter_> to recover the active key.
00657   ACE_Active_Map_Manager_Key active_key;
00658   int result = this->key_adapter_.decode (key,
00659                                           active_key);
00660   if (result == 0)
00661     {
00662       // Unbind recovered active key from map.
00663       result = this->implementation_.unbind (active_key,
00664                                              internal_value);
00665     }
00666 
00667   return result;
00668 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind const KEY &  key,
VALUE &  value
[virtual]
 

Remove from the map, and return the associated with .

Implements ACE_Map< KEY, VALUE >.

Definition at line 679 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value, ACE_Pair< KEY, VALUE >::second(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().

00681 {
00682   expanded_value *internal_value = 0;
00683   int result = this->unbind (key,
00684                              internal_value);
00685 
00686   if (result == 0)
00687     {
00688       // Copy value.
00689       value = internal_value->second ();
00690     }
00691 
00692   return result;
00693 }

template<class KEY, class VALUE, class KEY_ADAPTER>
int ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind const KEY &  key  )  [virtual]
 

Remove from the map.

Implements ACE_Map< KEY, VALUE >.

Definition at line 671 of file Map_T.cpp.

References ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::expanded_value.

Referenced by ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().

00672 {
00673   expanded_value *internal_value = 0;
00674   return this->unbind (key,
00675                        internal_value);
00676 }


Member Data Documentation

template<class KEY, class VALUE, class KEY_ADAPTER>
ACE_Active_Map_Manager<ACE_Pair<KEY, VALUE> > ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::implementation_ [protected]
 

All implementation details are forwarded to this class.

Definition at line 1002 of file Map_T.h.

template<class KEY, class VALUE, class KEY_ADAPTER>
KEY_ADAPTER ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter_ [protected]
 

Adapts between the user key and the Active_Map_Manager_Key.

Definition at line 1005 of file Map_T.h.

Referenced by ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_create_key(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_modify_key(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::key_adapter(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::recover_key(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:19:05 2006 for ACE by doxygen 1.3.6