#include <Malloc_T.h>
Inheritance diagram for ACE_Malloc_LIFO_Iterator_T:


Public Types | |
| typedef ACE_TYPENAME ACE_CB::ACE_Name_Node | NAME_NODE |
| typedef ACE_TYPENAME ACE_CB::ACE_Malloc_Header | MALLOC_HEADER |
Public Methods | |
| 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. More... | |
| ~ACE_Malloc_LIFO_Iterator_T (void) | |
| Destructor. More... | |
| int | done (void) const |
| Returns 1 when all items have been seen, else 0. More... | |
| int | 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. More... | |
| int | next (void *&next_entry, const char *&name) |
| int | advance (void) |
| Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Private Attributes | |
| ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB > & | malloc_ |
| Malloc we are iterating over. More... | |
| NAME_NODE * | curr_ |
| Keeps track of how far we've advanced... More... | |
| ACE_Read_Guard< ACE_LOCK > | guard_ |
| Lock Malloc for the lifetime of the iterator. More... | |
| const char * | name_ |
| Name that we are searching for. More... | |
Does not support deletions while iteration is occurring.
Definition at line 653 of file Malloc_T.h.
|
|||||
|
Definition at line 657 of file Malloc_T.h. |
|
|||||
|
Definition at line 656 of file Malloc_T.h. Referenced by ACE_Malloc_LIFO_Iterator_T. |
|
||||||||||||||||
|
If name = 0 it will iterate through everything else only through those entries whose name match.
Definition at line 843 of file Malloc_T.cpp. References ACE_TRACE, advance, ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::cb_ptr_, curr_, malloc_, and NAME_NODE.
00845 : malloc_ (malloc), 00846 curr_ (0), 00847 guard_ (*malloc_.lock_), 00848 name_ (name != 0 ? ACE_OS::strdup (name) : 0) 00849 { 00850 ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_LIFO_Iterator_T"); 00851 // Cheap trick to make code simple. 00852 // @@ Doug, this looks like trouble... 00853 NAME_NODE temp; 00854 this->curr_ = &temp; 00855 this->curr_->next_ = malloc_.cb_ptr_->name_head_; 00856 00857 this->advance (); 00858 } |
|
||||||||||
|
Destructor.
Definition at line 861 of file Malloc_T.cpp. References ACE_OS_Memory::free.
00862 {
00863 ACE_OS::free ((void *) this->name_);
00864 }
|
|
||||||||||
|
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 905 of file Malloc_T.cpp. References ACE_TRACE, curr_, name_, and ACE_OS_String::strcmp. Referenced by ACE_Malloc_LIFO_Iterator_T.
00906 {
00907 ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::advance");
00908
00909 this->curr_ = this->curr_->next_;
00910
00911 if (this->name_ == 0)
00912 return this->curr_ != 0;
00913
00914 while (this->curr_ != 0
00915 && ACE_OS::strcmp (this->name_,
00916 this->curr_->name ()) != 0)
00917 this->curr_ = this->curr_->next_;
00918
00919 return this->curr_ != 0;
00920 }
|
|
||||||||||
|
Returns 1 when all items have been seen, else 0.
Definition at line 897 of file Malloc_T.cpp. References ACE_TRACE, and curr_.
|
|
||||||||||
|
Dump the state of an object.
Definition at line 830 of file Malloc_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, curr_, guard_, and LM_DEBUG.
00831 {
00832 ACE_TRACE ("ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump");
00833
00834 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00835 this->curr_->dump ();
00836 this->guard_.dump ();
00837 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("name_ = %s"), this->name_));
00838 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
00839 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00840 }
|
|
||||||||||||||||
|
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 867 of file Malloc_T.cpp. References ACE_TRACE, and curr_.
|
|
||||||||||
|
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 883 of file Malloc_T.cpp. References ACE_TRACE, and curr_.
|
|
|||||
|
Declare the dynamic allocation hooks.
Definition at line 693 of file Malloc_T.h. |
|
|||||
|
Keeps track of how far we've advanced...
Definition at line 700 of file Malloc_T.h. Referenced by ACE_Malloc_LIFO_Iterator_T, advance, done, dump, and next. |
|
|||||
|
Lock Malloc for the lifetime of the iterator.
Definition at line 703 of file Malloc_T.h. Referenced by dump. |
|
|||||
|
Malloc we are iterating over.
Definition at line 697 of file Malloc_T.h. Referenced by ACE_Malloc_LIFO_Iterator_T. |
|
|||||
|
Name that we are searching for.
Definition at line 706 of file Malloc_T.h. Referenced by advance. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002