ACE_Ordered_MultiSet< T > Class Template ReferenceImplement a simple ordered multiset of {T} of unbounded size that allows duplicates. This class template requires that < operator semantics be defined for the parameterized type {T}, but does not impose any restriction on how that ordering operator is implemented. The set is implemented as a linked list. More...
Collaboration diagram for ACE_Ordered_MultiSet< T >:
Detailed Descriptiontemplate<class T>
Implement a simple ordered multiset of {T} of unbounded size that allows duplicates. This class template requires that < operator semantics be defined for the parameterized type {T}, but does not impose any restriction on how that ordering operator is implemented. The set is implemented as a linked list.
|
typedef ACE_Ordered_MultiSet_Iterator<T> ACE_Ordered_MultiSet< T >::ITERATOR |
ACE_Ordered_MultiSet< T >::ACE_Ordered_MultiSet | ( | ACE_Allocator * | the_allocator = 0 |
) | [inline] |
Constructor. Use user specified allocation strategy if specified. Initialize the set using the allocation strategy specified. If none, use the default strategy.
ACE_Ordered_MultiSet< T >::ACE_Ordered_MultiSet | ( | const ACE_Ordered_MultiSet< T > & | us | ) | [inline] |
Copy constructor.
Initialize the set to be a copy of the provided set.
ACE_Ordered_MultiSet< T >::~ACE_Ordered_MultiSet | ( | void | ) | [inline] |
Destructor.
Delete the nodes of the set.
void ACE_Ordered_MultiSet< T >::operator= | ( | const ACE_Ordered_MultiSet< T > & | us | ) | [inline] |
Assignment operator.
Delete the nodes in lhs, and copy the nodes from the rhs.
ACE_INLINE int ACE_Ordered_MultiSet< T >::is_empty | ( | void | ) | const [inline] |
Returns 1 if the container is empty, otherwise returns 0.
Constant time check to determine if the set is empty.
ACE_INLINE size_t ACE_Ordered_MultiSet< T >::size | ( | void | ) | const [inline] |
Size of the set.
Constant time check to determine the size of the set.
int ACE_Ordered_MultiSet< T >::insert | ( | const T & | new_item | ) | [inline] |
Insert new_item into the ordered multiset. Returns -1 if failures occur, else 0. Linear time, order preserving insert into the set beginning at the head.
int ACE_Ordered_MultiSet< T >::insert | ( | const T & | new_item, | |
ITERATOR & | iter | |||
) | [inline] |
Linear time insert beginning at the point specified by the provided iterator.
Insert new_item into the ordered multiset, starting its search at the node pointed to by the iterator, and if insertion was successful, updates the iterator to point to the newly inserted node. Returns -1 if failures occur, else 0.
int ACE_Ordered_MultiSet< T >::remove | ( | const T & | item | ) | [inline] |
Remove first occurrence of item from the set. Returns 0 if it removes the item, -1 if it can't find the item. Linear time search operation which removes the item from the set if found .
int ACE_Ordered_MultiSet< T >::find | ( | const T & | item, | |
ITERATOR & | iter | |||
) | const [inline] |
Linear find operation.
Finds first occurrence of item in the multiset, using the iterator's current position as a hint to improve performance. If find succeeds, it positions the iterator at that node and returns 0, or if it cannot locate the node, it leaves the iterator alone and just returns -1.
void ACE_Ordered_MultiSet< T >::reset | ( | void | ) | [inline] |
Reset the ACE_Ordered_MultiSet to be empty.
Delete the nodes inside the set.
void ACE_Ordered_MultiSet< T >::dump | ( | void | ) | const [inline] |
Dump the state of an object.
int ACE_Ordered_MultiSet< T >::insert_from | ( | const T & | item, | |
ACE_DNode< T > * | start_position, | |||
ACE_DNode< T > ** | new_position | |||
) | [inline, private] |
Insert item, starting its search at the position given, and if successful updates the passed pointer to point to the newly inserted item's node.
int ACE_Ordered_MultiSet< T >::locate | ( | const T & | item, | |
ACE_DNode< T > * | start_position, | |||
ACE_DNode< T > *& | new_position | |||
) | const [inline, private] |
Looks for first occurance of item in the ordered set, using the passed starting position as a hint: if there is such an instance, it updates the new_position pointer to point to this node and returns 0; if there is no such node, then if there is a node before where the item would have been, it updates the new_position pointer to point to this node and returns -1; if there is no such node, then if there is a node after where the item would have been, it updates the new_position pointer to point to this node (or 0 if there is no such node) and returns 1;
void ACE_Ordered_MultiSet< T >::delete_nodes | ( | void | ) | [inline, private] |
Delete all the nodes in the Set.
void ACE_Ordered_MultiSet< T >::copy_nodes | ( | const ACE_Ordered_MultiSet< T > & | us | ) | [inline, private] |
Copy nodes into this set.
friend class ACE_Ordered_MultiSet_Iterator< T > [friend] |
ACE_Ordered_MultiSet< T >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
ACE_DNode<T>* ACE_Ordered_MultiSet< T >::head_ [private] |
Head of the bilinked list of Nodes.
ACE_DNode<T>* ACE_Ordered_MultiSet< T >::tail_ [private] |
Head of the bilinked list of Nodes.
size_t ACE_Ordered_MultiSet< T >::cur_size_ [private] |
Current size of the set.
ACE_Allocator* ACE_Ordered_MultiSet< T >::allocator_ [private] |
Allocation strategy of the set.