Reference

ACE_Malloc_LIFO_Iterator(3)

LIFO iterator for names stored in Malloc'd memory.

NAME

ACE_Malloc_LIFO_Iterator - LIFO iterator for names stored in Malloc'd memory.

SYNOPSIS

#include <ace/Malloc_T.h>
template<ACE_MEM_POOL_1, class ACE_LOCK>
class ACE_Malloc_LIFO_Iterator
{
  public:
    ACE_Malloc_LIFO_Iterator (
        ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK> &malloc,
        const char *name = 0
        );
    ~ACE_Malloc_LIFO_Iterator (void);
    int done (void) const;
    int next (void *&next_entry);
    int next (void *&next_entry, const char *&name);
    int advance (void);
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  private:
    ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK> &malloc_;
    ACE_Name_Node *curr_;
    ACE_Read_Guard<ACE_LOCK> guard_;
    const char *name_;
};

DESCRIPTION

Does not support deletions while iteration is occurring.

Initialization method.

ACE_Malloc_LIFO_Iterator (
    ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK> &malloc,
    const char *name = 0
    );

if name = 0 it will iterate through everything else only through those entries whose name match.

~ACE_Malloc_LIFO_Iterator (void);

Iteration methods.

int done (void) const;

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

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.

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

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.

void dump (void) const;

Dump the state of an object.

ACE_ALLOC_HOOK_DECLARE;

Declare the dynamic allocation hooks.

AUTHOR

Doug Schmidt and Irfan Pyarali

LIBRARY

ace