NAME
ACE_Unbounded_Set -
Implement a simple unordered set of T of unbounded size.
SYNOPSIS
#include <ace/Set.h>
template<class T>
class ACE_Unbounded_Set
{
public:
friend class ACE_Unbounded_Set_Iterator<T>;
ACE_Unbounded_Set (void);
~ACE_Unbounded_Set (void);
int insert (const T &new_item);
int remove (const T &item);
int find (const T &item) const;
size_t size (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
ACE_Set_Node<T> *head_;
size_t cur_size_;
};
DESCRIPTION
This implementation of an unordered set uses a linked list.
This implementation does not allow duplicates...
Initialization and termination methods.
ACE_Unbounded_Set (void);
~ACE_Unbounded_Set (void);
Classic unordered set operations.
int insert (const T &new_item);
Insert new_item into the set (doesn't allow duplicates).
Returns -1 if failures occur, 1 if item is already present, else
0.
int remove (const T &item);
Remove first occurrence of item from the set. Returns 1 if
it removes the item, 0 if it can't find the item, and -1 if a
failure occurs.
int find (const T &item) const;
Return first occurrence of item from the set.
Returns 0 if can't find, else 1.
size_t size (void) const;
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace