LIFO iterator for names stored in Malloc'd memory. More...
#include <Malloc_T.h>

Public Types | |
| typedef ACE_CB::ACE_Name_Node | NAME_NODE |
| typedef ACE_CB::ACE_Malloc_Header | MALLOC_HEADER |
Public Member Functions | |
| ACE_Malloc_LIFO_Iterator_T (ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB > &malloc, const char *name=0) | |
| ~ACE_Malloc_LIFO_Iterator_T (void) | |
| Destructor. | |
| int | done (void) const |
| Returns 1 when all items have been seen, else 0. | |
| int | next (void *&next_entry) |
| int | next (void *&next_entry, const char *&name) |
| int | advance (void) |
| void | dump (void) const |
| Dump the state of an object. | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
Private Attributes | |
| ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB > & | malloc_ |
| Malloc we are iterating over. | |
| NAME_NODE * | curr_ |
| Keeps track of how far we've advanced... | |
| ACE_Read_Guard< ACE_LOCK > | guard_ |
| Lock Malloc for the lifetime of the iterator. | |
| const char * | name_ |
| Name that we are searching for. | |
LIFO iterator for names stored in Malloc'd memory.
This class can be configured flexibly with different types of ACE_LOCK strategies that support the ACE_Thread_Mutex and ACE_Process_Mutex constructor API.
Does not support deletions while iteration is occurring.
Definition at line 721 of file Malloc_T.h.
| typedef ACE_CB::ACE_Malloc_Header ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::MALLOC_HEADER |
Definition at line 725 of file Malloc_T.h.
| typedef ACE_CB::ACE_Name_Node ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::NAME_NODE |
Definition at line 724 of file Malloc_T.h.
| ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::ACE_Malloc_LIFO_Iterator_T | ( | ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB > & | malloc, | |
| const char * | name = 0 | |||
| ) |
If name = 0 it will iterate through everything else only through those entries whose name match.
Definition at line 1064 of file Malloc_T.cpp.
: malloc_ (malloc), curr_ (0), guard_ (*malloc_.lock_), name_ (name != 0 ? ACE_OS::strdup (name) : 0) { ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_LIFO_Iterator_T"); // Cheap trick to make code simple. // @@ Doug, this looks like trouble... NAME_NODE temp; this->curr_ = &temp; this->curr_->next_ = malloc_.cb_ptr_->name_head_; this->advance (); }
| ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::~ACE_Malloc_LIFO_Iterator_T | ( | void | ) |
| int ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::advance | ( | void | ) |
Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1.
Definition at line 1126 of file Malloc_T.cpp.
{
ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::advance");
this->curr_ = this->curr_->next_;
if (this->name_ == 0)
return this->curr_ != 0;
while (this->curr_ != 0
&& ACE_OS::strcmp (this->name_,
this->curr_->name ()) != 0)
this->curr_ = this->curr_->next_;
return this->curr_ != 0;
}
| int ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::done | ( | void | ) | const |
Returns 1 when all items have been seen, else 0.
Definition at line 1118 of file Malloc_T.cpp.
| void ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::dump | ( | void | ) | const |
Dump the state of an object.
Definition at line 1050 of file Malloc_T.cpp.
{
#if defined (ACE_HAS_DUMP)
ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
this->curr_->dump ();
this->guard_.dump ();
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %C\n"), this->name_));
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
| int ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::next | ( | void *& | next_entry, | |
| const char *& | name | |||
| ) |
Pass back the next entry (and the name associated with it) in the set that hasn't yet been visited. Returns 0 when all items have been seen, else 1.
Definition at line 1088 of file Malloc_T.cpp.
| int ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::next | ( | void *& | next_entry | ) |
Pass back the next entry in the set that hasn't yet been visited. Returns 0 when all items have been seen, else 1.
Definition at line 1104 of file Malloc_T.cpp.
| ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
Definition at line 761 of file Malloc_T.h.
NAME_NODE* ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::curr_ [private] |
Keeps track of how far we've advanced...
Definition at line 768 of file Malloc_T.h.
ACE_Read_Guard<ACE_LOCK> ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::guard_ [private] |
Lock Malloc for the lifetime of the iterator.
Definition at line 771 of file Malloc_T.h.
ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>& ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::malloc_ [private] |
Malloc we are iterating over.
Definition at line 765 of file Malloc_T.h.
const char* ACE_Malloc_LIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::name_ [private] |
Name that we are searching for.
Definition at line 774 of file Malloc_T.h.
1.7.0