#include <Malloc_T.h>
Inheritance diagram for ACE_Malloc_FIFO_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_FIFO_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_FIFO_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... | |
| int | start (void) |
| Go to the starting element that was inserted first. Returns 0 when there is no item in the set, 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 717 of file Malloc_T.h.
|
|||||
|
Definition at line 721 of file Malloc_T.h. |
|
|||||
|
Definition at line 720 of file Malloc_T.h. Referenced by ACE_Malloc_FIFO_Iterator_T, and start. |
|
||||||||||||||||
|
If name = 0 it will iterate through everything else only through those entries whose name match.
Definition at line 936 of file Malloc_T.cpp. References ACE_TRACE, ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::cb_ptr_, curr_, malloc_, NAME_NODE, and start.
00938 : malloc_ (malloc), 00939 curr_ (0), 00940 guard_ (*malloc_.lock_), 00941 name_ (name != 0 ? ACE_OS::strdup (name) : 0) 00942 { 00943 ACE_TRACE ("ACE_Malloc_FIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_FIFO_Iterator"); 00944 // Cheap trick to make code simple. 00945 // @@ Doug, this looks like trouble... 00946 NAME_NODE temp; 00947 this->curr_ = &temp; 00948 this->curr_->next_ = malloc_.cb_ptr_->name_head_; 00949 this->curr_->prev_ = 0; 00950 00951 // Go to the first element that was inserted. 00952 this->start (); 00953 } |
|
||||||||||
|
Destructor.
Definition at line 956 of file Malloc_T.cpp. References ACE_OS_Memory::free.
00957 {
00958 ACE_OS::free ((void *) this->name_);
00959 }
|
|
||||||||||
|
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 1000 of file Malloc_T.cpp. References ACE_TRACE, curr_, name_, and ACE_OS_String::strcmp.
01001 {
01002 ACE_TRACE ("ACE_Malloc_FIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::advance");
01003
01004 this->curr_ = this->curr_->prev_;
01005
01006 if (this->name_ == 0)
01007 return this->curr_ != 0;
01008
01009 while (this->curr_ != 0
01010 && ACE_OS::strcmp (this->name_,
01011 this->curr_->name ()) != 0)
01012 this->curr_ = this->curr_->prev_;
01013
01014 return this->curr_ != 0;
01015 }
|
|
||||||||||
|
Returns 1 when all items have been seen, else 0.
Definition at line 992 of file Malloc_T.cpp. References ACE_TRACE, and curr_.
|
|
||||||||||
|
Dump the state of an object.
Definition at line 923 of file Malloc_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, curr_, guard_, and LM_DEBUG.
00924 {
00925 ACE_TRACE ("ACE_Malloc_FIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump");
00926
00927 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00928 this->curr_->dump ();
00929 this->guard_.dump ();
00930 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("name_ = %s"), this->name_));
00931 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\n")));
00932 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00933 }
|
|
||||||||||||||||
|
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 962 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 978 of file Malloc_T.cpp. References ACE_TRACE, and curr_.
|
|
||||||||||
|
Go to the starting element that was inserted first. Returns 0 when there is no item in the set, else 1.
Definition at line 1018 of file Malloc_T.cpp. References curr_, and NAME_NODE. Referenced by ACE_Malloc_FIFO_Iterator_T.
01019 {
01020 this->curr_ = this->curr_->next_;
01021 NAME_NODE *prev = 0;
01022
01023 // Locate the element that was inserted first.
01024 // @@ We could optimize this by making the list a circular list or
01025 // storing an extra pointer.
01026 while (this->curr_ != 0)
01027 {
01028 prev = this->curr_;
01029 this->curr_ = this->curr_->next_;
01030 }
01031
01032 this->curr_ = prev;
01033 return this->curr_ != 0;
01034 }
|
|
|||||
|
Declare the dynamic allocation hooks.
Definition at line 761 of file Malloc_T.h. |
|
|||||
|
Keeps track of how far we've advanced...
Definition at line 768 of file Malloc_T.h. Referenced by ACE_Malloc_FIFO_Iterator_T, advance, done, dump, next, and start. |
|
|||||
|
Lock Malloc for the lifetime of the iterator.
Definition at line 771 of file Malloc_T.h. Referenced by dump. |
|
|||||
|
Malloc we are iterating over.
Definition at line 765 of file Malloc_T.h. Referenced by ACE_Malloc_FIFO_Iterator_T. |
|
|||||
|
Name that we are searching for.
Definition at line 774 of file Malloc_T.h. Referenced by advance. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002