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

#include <Containers_T.h>

List of all members.

Public Types

typedef ACE_Fixed_Set_Iterator<
T, ACE_SIZE> 
ITERATOR

Public Methods

 ACE_Fixed_Set (void)
 Constructor.

 ACE_Fixed_Set (const ACE_Fixed_Set<T, ACE_SIZE> &)
 Copy constructor.

void operator= (const ACE_Fixed_Set<T, ACE_SIZE> &)
 Assignment operator.

 ~ACE_Fixed_Set (void)
 Destructor.

int is_empty (void) const
 Returns 1 if the container is empty, otherwise returns 0.

int is_full (void) const
 Returns 1 if the container is full, otherwise returns 0.

int insert (const T &new_item)
int remove (const T &item)
int find (const T &item) const
 Finds if <item> occurs in the set. Returns 0 if finds, else -1.

size_t size (void) const
 Size of the set.

void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

struct {
   T   item_
   int   is_free_
search_structure_ [ACE_SIZE]
size_t cur_size_
 Current size of the set.

size_t max_size_
 Maximum size of the set.


Friends

class  ACE_Fixed_Set_Iterator< T,ACE_SIZE >


Detailed Description

template<class T, size_t ACE_SIZE> template class ACE_Fixed_Set

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

This implementation of an unordered set uses a fixed array. This implementation does not allow duplicates...


Member Typedef Documentation

template<classT, size_tACE_SIZE>
typedef ACE_Fixed_Set_Iterator<T, ACE_SIZE> ACE_Fixed_Set<T, ACE_SIZE>::ITERATOR
 


Constructor & Destructor Documentation

template<classT, size_tACE_SIZE>
ACE_Fixed_Set<T, ACE_SIZE>::ACE_Fixed_Set<T, ACE_SIZE> ( void )
 

Constructor.

template<classT, size_tACE_SIZE>
ACE_Fixed_Set<T, ACE_SIZE>::ACE_Fixed_Set<T, ACE_SIZE> ( const ACE_Fixed_Set< T,ACE_SIZE >& fs )
 

Copy constructor.

template<classT, size_tACE_SIZE>
ACE_Fixed_Set<T, ACE_SIZE>::~ACE_Fixed_Set<T, ACE_SIZE> ( void )
 

Destructor.


Member Function Documentation

template<classT, size_tACE_SIZE>
void ACE_Fixed_Set<T, ACE_SIZE>::dump ( void ) const
 

Dump the state of an object.

template<classT, size_tACE_SIZE>
int ACE_Fixed_Set<T, ACE_SIZE>::find ( const T & item ) const
 

Finds if <item> occurs in the set. Returns 0 if finds, else -1.

template<classT, size_tACE_SIZE>
int ACE_Fixed_Set<T, ACE_SIZE>::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.

template<classT, size_tACE_SIZE>
ACE_INLINE int ACE_Fixed_Set< T,ACE_SIZE >::is_empty ( void ) const
 

Returns 1 if the container is empty, otherwise returns 0.

template<classT, size_tACE_SIZE>
ACE_INLINE int ACE_Fixed_Set< T,ACE_SIZE >::is_full ( void ) const
 

Returns 1 if the container is full, otherwise returns 0.

template<classT, size_tACE_SIZE>
void ACE_Fixed_Set<T, ACE_SIZE>::operator= ( const ACE_Fixed_Set< T,ACE_SIZE >& fs )
 

Assignment operator.

template<classT, size_tACE_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.

template<classT, size_tACE_SIZE>
size_t ACE_Fixed_Set<T, ACE_SIZE>::size ( void ) const
 

Size of the set.


Friends And Related Function Documentation

template<classT, size_tACE_SIZE>
class ACE_Fixed_Set_Iterator [friend]
 


Member Data Documentation

template<classT, size_tACE_SIZE>
ACE_Fixed_Set<T, ACE_SIZE>::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

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

Current size of the set.

template<classT, size_tACE_SIZE>
int ACE_Fixed_Set<T, ACE_SIZE>::is_free_ [private]
 

template<classT, size_tACE_SIZE>
T ACE_Fixed_Set<T, ACE_SIZE>::item_ [private]
 

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

Maximum size of the set.

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


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:30:28 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000