#include <Containers_T.h>
Inheritance diagram for ACE_Fixed_Set< T, ACE_SIZE >:
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) | |
Default 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) |
Linear time insertion of an item unique to the set. | |
int | remove (const T &item) |
Linear time removal operation of an 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] |
Holds the contents of the set. | |
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 > |
class | ACE_Fixed_Set_Const_Iterator< T, 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
|
|
|
|
|
Default Constructor. Creates an empy set |
|
Copy constructor. Initializes a set to be a copy of the set parameter. |
|
Destructor. Destroys a set. |
|
Dump the state of an object.
|
|
Finds if item occurs in the set. Returns 0 if finds, else -1. Performs a linear find operation for the specified item. |
|
Linear time insertion of an item unique to the set. Insert new_item into the set (doesn't allow duplicates). Returns -1 if failures occur, 1 if item is already present, else 0. |
|
Returns 1 if the container is empty, otherwise returns 0. Performs constant time check to determine if a set is empty. |
|
Returns 1 if the container is full, otherwise returns 0. Performs a constant time check to see if the set is full. |
|
Assignment operator. Deep copy of one set to another. |
|
Linear time removal operation of an 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. |
|
Size of the set. Returns the current size of the set. |
|
|
|
|
|
Declare the dynamic allocation hooks.
|
|
Current size of the set.
|
|
Keeps track of whether this item is in use or not.
|
|
Item in the set.
|
|
Maximum size of the set.
|
|
Holds the contents of the set.
|