#include <Map_T.h>
Inheritance diagram for ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >:
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 > &) |
Implementation to be provided by .
Definition at line 828 of file Map_T.h.
|
|
|
|
|
|
|
|
Initialize with the .
Definition at line 290 of file Map_T.inl.
00291 : implementation_ (alloc) 00292 { 00293 } |
|
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 } |
|
Close down and release dynamically allocated resources.
Definition at line 406 of file Map_T.cpp.
00407 { 00408 } |
|
|
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
Accessor to implementation object.
Definition at line 304 of file Map_T.inl.
00305 { 00306 return this->implementation_; 00307 } |
|
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 } |
|
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 } |
|
|
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
All implementation details are forwarded to this class.
|
|
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(). |