ACE 8.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB > Class Template Reference

FIFO iterator for names stored in Malloc'd memory. More...

#include <Malloc_T.h>

Collaboration diagram for ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >:
Collaboration graph
[legend]

Public Types

typedef ACE_CB::ACE_Name_Node NAME_NODE
 
typedef ACE_CB::ACE_Malloc_Header MALLOC_HEADER
 

Public Member Functions

 ACE_Malloc_FIFO_Iterator_T (ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB > &malloc, const char *name=0)
 
 ~ACE_Malloc_FIFO_Iterator_T ()
 Destructor.
 
int done () 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 ()
 
int start ()
 
void dump () 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_NODEcurr_
 Keeps track of how far we've advanced...
 
ACE_Read_Guard< ACE_LOCK > guard_
 Lock Malloc for the lifetime of the iterator.
 
const charname_
 Name that we are searching for.
 

Detailed Description

template<ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB>
class ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >

FIFO 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.

Member Typedef Documentation

◆ MALLOC_HEADER

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
typedef ACE_CB::ACE_Malloc_Header ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::MALLOC_HEADER

◆ NAME_NODE

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
typedef ACE_CB::ACE_Name_Node ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::NAME_NODE

Constructor & Destructor Documentation

◆ ACE_Malloc_FIFO_Iterator_T()

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::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.

◆ ~ACE_Malloc_FIFO_Iterator_T()

Destructor.

Member Function Documentation

◆ advance()

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
int ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::advance ( )

Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1.

◆ done()

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
int ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::done ( ) const

Returns 1 when all items have been seen, else 0.

◆ dump()

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
void ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::dump ( ) const

Dump the state of an object.

◆ next() [1/2]

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
int ACE_Malloc_FIFO_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.

◆ next() [2/2]

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
int ACE_Malloc_FIFO_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.

◆ start()

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
int ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::start ( )

Go to the starting element that was inserted first. Returns 0 when there is no item in the set, else 1.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ curr_

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
NAME_NODE* ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::curr_
private

Keeps track of how far we've advanced...

◆ guard_

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
ACE_Read_Guard<ACE_LOCK> ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::guard_
private

Lock Malloc for the lifetime of the iterator.

◆ malloc_

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>& ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::malloc_
private

Malloc we are iterating over.

◆ name_

template<ACE_MEM_POOL_1 , class ACE_LOCK , class ACE_CB >
const char* ACE_Malloc_FIFO_Iterator_T< ACE_MEM_POOL_1, ACE_LOCK, ACE_CB >::name_
private

Name that we are searching for.


The documentation for this class was generated from the following files: