#include <Based_Pointer_Repository.h>
Collaboration diagram for ACE_Based_Pointer_Repository:
Public Member Functions | |
ACE_Based_Pointer_Repository (void) | |
~ACE_Based_Pointer_Repository (void) | |
int | find (void *addr, void *&base_addr) |
int | bind (void *addr, size_t size) |
int | unbind (void *addr) |
Private Attributes | |
ACE_Based_Pointer_Repository_Rep * | rep_ |
Definition at line 41 of file Based_Pointer_Repository.h.
|
Definition at line 37 of file Based_Pointer_Repository.cpp. References ACE_NEW, and ACE_TRACE.
00038 { 00039 ACE_TRACE ("ACE_Based_Pointer_Repository::ACE_Based_Pointer_Repository"); 00040 ACE_NEW (this->rep_, 00041 ACE_Based_Pointer_Repository_Rep); 00042 } |
|
Definition at line 44 of file Based_Pointer_Repository.cpp. References ACE_TRACE, and rep_.
|
|
Bind a new entry to the repository or update the size of an existing entry. Returns 0 on success and -1 on failure. Definition at line 80 of file Based_Pointer_Repository.cpp. References ACE_GUARD_RETURN, ACE_SYNCH_MUTEX, ACE_TRACE, ACE_Based_Pointer_Repository_Rep::addr_map_, and rep_.
00081 { 00082 ACE_TRACE ("ACE_Based_Pointer_Repository::bind"); 00083 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); 00084 00085 return this->rep_->addr_map_.rebind (addr, size); 00086 } |
|
Return the appropriate base_addr region that contains addr. Returns 1 on success and 0 if the addr isn't contained in any base_addr region. Definition at line 53 of file Based_Pointer_Repository.cpp. References ACE_GUARD_RETURN, ACE_SYNCH_MUTEX, ACE_TRACE, ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::advance(), ACE_Map_Entry< void *, size_t >::ext_id_, ACE_Map_Entry< void *, size_t >::int_id_, ACE_Based_Pointer_Repository_Rep::MAP_ENTRY, ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR, and ACE_Map_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::next().
00054 { 00055 ACE_TRACE ("ACE_Based_Pointer_Repository::find"); 00056 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); 00057 ACE_Based_Pointer_Repository_Rep::MAP_ENTRY *ce = 0; 00058 00059 for (ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR iter (this->rep_->addr_map_); 00060 iter.next (ce) != 0; 00061 iter.advance ()) 00062 // Check to see if <addr> is within any of the regions. 00063 if (addr >= ce->ext_id_ 00064 && addr < ((char *)ce->ext_id_ + ce->int_id_)) 00065 { 00066 // Assign the base address. 00067 base_addr = ce->ext_id_; 00068 return 1; 00069 } 00070 00071 // Assume base address 0 (e.g., if new'ed). 00072 base_addr = 0; 00073 return 0; 00074 } |
|
Unbind from the repository the that addr is contained within. Definition at line 91 of file Based_Pointer_Repository.cpp. References ACE_GUARD_RETURN, ACE_SYNCH_MUTEX, ACE_TRACE, ACE_Based_Pointer_Repository_Rep::addr_map_, ACE_Map_Iterator< EXT_ID, INT_ID, ACE_LOCK >::advance(), ACE_Map_Entry< void *, size_t >::ext_id_, ACE_Map_Entry< void *, size_t >::int_id_, ACE_Based_Pointer_Repository_Rep::MAP_ENTRY, ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR, ACE_Map_Iterator_Base< EXT_ID, INT_ID, ACE_LOCK >::next(), and rep_.
00092 { 00093 ACE_TRACE ("ACE_Based_Pointer_Repository::unbind"); 00094 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1); 00095 ACE_Based_Pointer_Repository_Rep::MAP_ENTRY *ce = 0; 00096 00097 // Search for service handlers that requested notification. 00098 00099 for (ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR iter (this->rep_->addr_map_); 00100 iter.next (ce) != 0; 00101 iter.advance ()) 00102 { 00103 // Check to see if <addr> is within any of the regions and if 00104 // so, unbind the key from the map. 00105 if (addr >= ce->ext_id_ 00106 && addr < ((char *)ce->ext_id_ + ce->int_id_)) 00107 // Unbind base address. 00108 return this->rep_->addr_map_.unbind (ce->ext_id_); 00109 } 00110 00111 return 0; 00112 } |
|
Use the "Cheshire-Cat" technique to hide the implementation in order to avoid circular #include dependencies. Definition at line 72 of file Based_Pointer_Repository.h. Referenced by bind(), unbind(), and ~ACE_Based_Pointer_Repository(). |