Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Fixed_Set Class Template Reference

Implement a simple unordered set of <T> with maximum <ACE_SIZE>. More...

#include <Containers_T.h>

Inheritance diagram for ACE_Fixed_Set:

Inheritance graph
[legend]
Collaboration diagram for ACE_Fixed_Set:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Fixed_Set_Iterator<
T, ACE_SIZE > 
ITERATOR
typedef ACE_Fixed_Set_Iterator<
T, ACE_SIZE > 
CONST_ITERATOR

Public Methods

 ACE_Fixed_Set (void)
 Creates an empy set. More...

 ACE_Fixed_Set (const ACE_Fixed_Set< T, ACE_SIZE > &)
 Initializes a set to be a copy of the set parameter. More...

void operator= (const ACE_Fixed_Set< T, ACE_SIZE > &)
 Deep copy of one set to another. More...

 ~ACE_Fixed_Set (void)
 Destroys a set. More...

int is_empty (void) const
 Performs constant time check to determine if a set is empty. More...

int is_full (void) const
 Performs a constant time check to see if the set is full. More...

int insert (const T &new_item)
 Insert new_item into the set (doesn't allow duplicates). More...

int remove (const T &item)
 Remove first occurrence of <item> from the set. More...

int find (const T &item) const
 Performs a linear find operation for the specified item. More...

size_t size (void) const
 Returns the current size of the set. 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

struct {
   T   item_
   int   is_free_
search_structure_ [ACE_SIZE]
 Holds the contents of the set. More...

size_t cur_size_
 Current size of the set. More...

size_t max_size_
 Maximum size of the set. More...


Friends

class ACE_Fixed_Set_Iterator< T, ACE_SIZE >
class ACE_Fixed_Set_Const_Iterator< T, ACE_SIZE >

Detailed Description

template<class T, size_t ACE_SIZE>
class ACE_Fixed_Set< T, ACE_SIZE >

Implement a simple unordered set of <T> with maximum <ACE_SIZE>.

This implementation of an unordered set uses a fixed array. It does not allow duplicate members. The set provides linear insertion/deletion operations.

Requirements and Performance Characteristics


Member Typedef Documentation

template<class T, size_t ACE_SIZE>
typedef ACE_Fixed_Set_Iterator<T, ACE_SIZE> ACE_Fixed_Set::CONST_ITERATOR
 

template<class T, size_t ACE_SIZE>
typedef ACE_Fixed_Set_Iterator<T, ACE_SIZE> ACE_Fixed_Set::ITERATOR
 


Constructor & Destructor Documentation

template<class T, size_t ACE_SIZE>
ACE_Fixed_Set< T, ACE_SIZE >::ACE_Fixed_Set void   
 

Creates an empy set.

template<class T, size_t ACE_SIZE>
ACE_Fixed_Set< T, ACE_SIZE >::ACE_Fixed_Set const ACE_Fixed_Set< T, ACE_SIZE > &    fs
 

Initializes a set to be a copy of the set parameter.

template<class T, size_t ACE_SIZE>
ACE_Fixed_Set< T, ACE_SIZE >::~ACE_Fixed_Set void   
 

Destroys a set.


Member Function Documentation

template<class T, size_t ACE_SIZE>
void ACE_Fixed_Set< T, ACE_SIZE >::dump void    const
 

Dump the state of an object.

template<class T, size_t ACE_SIZE>
int ACE_Fixed_Set< T, ACE_SIZE >::find const T &    item const
 

Performs a linear find operation for the specified item.

template<class T, size_t ACE_SIZE>
int ACE_Fixed_Set< T, ACE_SIZE >::insert const T &    item
 

Insert new_item into the set (doesn't allow duplicates).

Returns -1 if failures occur, 1 if item is already present, else 0.

template<class T, size_t ACE_SIZE>
ACE_INLINE int ACE_Fixed_Set< T, ACE_SIZE >::is_empty void    const
 

Performs constant time check to determine if a set is empty.

template<class T, size_t ACE_SIZE>
ACE_INLINE int ACE_Fixed_Set< T, ACE_SIZE >::is_full void    const
 

Performs a constant time check to see if the set is full.

template<class T, size_t ACE_SIZE>
void ACE_Fixed_Set< T, ACE_SIZE >::operator= const ACE_Fixed_Set< T, ACE_SIZE > &    fs
 

Deep copy of one set to another.

template<class T, size_t ACE_SIZE>
int ACE_Fixed_Set< T, ACE_SIZE >::remove const T &    item
 

Remove first occurrence of <item> from the set.

Returns 0 if it removes the item, -1 if it can't find the item, and -1 if a failure occurs. Removal doesn't reclaim memory for the item.

template<class T, size_t ACE_SIZE>
size_t ACE_Fixed_Set< T, ACE_SIZE >::size void    const
 

Returns the current size of the set.


Friends And Related Function Documentation

template<class T, size_t ACE_SIZE>
friend class ACE_Fixed_Set_Const_Iterator< T, ACE_SIZE > [friend]
 

template<class T, size_t ACE_SIZE>
friend class ACE_Fixed_Set_Iterator< T, ACE_SIZE > [friend]
 


Member Data Documentation

template<class T, size_t ACE_SIZE>
ACE_Fixed_Set::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

template<class T, size_t ACE_SIZE>
size_t ACE_Fixed_Set::cur_size_ [private]
 

Current size of the set.

template<class T, size_t ACE_SIZE>
int ACE_Fixed_Set::is_free_ [private]
 

Keeps track of whether this item is in use or not.

template<class T, size_t ACE_SIZE>
T ACE_Fixed_Set::item_ [private]
 

Item in the set.

template<class T, size_t ACE_SIZE>
size_t ACE_Fixed_Set::max_size_ [private]
 

Maximum size of the set.

struct { ... } ACE_Fixed_Set::search_structure_[ACE_SIZE] [private]
 

Holds the contents of the set.


The documentation for this class was generated from the following files:
Generated on Fri Nov 22 05:57:54 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001