TAO_CosNaming 3.1.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
ACE_Unbounded_List< T > Class Template Reference

Implement a simple unordered set of <T> of unbounded size. More...

#include <Naming_Service_Container.h>

Collaboration diagram for ACE_Unbounded_List< T >:
Collaboration graph
[legend]

Public Types

typedef ACE_Unbounded_List_Iterator< T > ITERATOR
 
typedef ACE_Unbounded_List_Iterator< T > iterator
 

Public Member Functions

 ACE_Unbounded_List (ACE_Allocator *alloc=0)
 
 ACE_Unbounded_List (const ACE_Unbounded_List< T > &)
 Copy constructor.
 
void operator= (const ACE_Unbounded_List< T > &)
 Assignment operator.
 
 ~ACE_Unbounded_List ()
 Destructor.
 
int is_empty () const
 Returns 1 if the container is empty, otherwise returns 0.
 
int is_full () const
 Returns 1 if the container is full, otherwise returns 0.
 
int insert (const T &new_item)
 
int remove (const T &item)
 
size_t size () const
 Size of the set.
 
void dump () const
 Dump the state of an object.
 
void reset ()
 Reset the <ACE_Unbounded_List> to be empty.
 
ACE_Unbounded_List_Iterator< T > begin ()
 
ACE_Unbounded_List_Iterator< T > end ()
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Member Functions

int insert_tail (const T &item)
 
void delete_nodes ()
 Delete all the nodes in the List.
 
void copy_nodes (const ACE_Unbounded_List< T > &)
 Copy nodes into this set.
 

Private Attributes

ACE_NS_Node< T > * head_
 Head of the linked list of NS_Nodes.
 
size_t cur_size_
 Current size of the set.
 
ACE_Allocatorallocator_
 Allocation strategy of the set.
 

Friends

class ACE_Unbounded_List_Iterator< T >
 

Detailed Description

template<class T>
class ACE_Unbounded_List< T >

Implement a simple unordered set of <T> of unbounded size.

This implementation of an unordered set uses a circular linked list with a dummy node. This implementation does not allow duplicates, but it maintains FIFO ordering of insertions.

Member Typedef Documentation

◆ ITERATOR

template<class T >
typedef ACE_Unbounded_List_Iterator<T> ACE_Unbounded_List< T >::ITERATOR

◆ iterator

template<class T >
typedef ACE_Unbounded_List_Iterator<T> ACE_Unbounded_List< T >::iterator

Constructor & Destructor Documentation

◆ ACE_Unbounded_List() [1/2]

template<class T >
ACE_Unbounded_List< T >::ACE_Unbounded_List ( ACE_Allocator * alloc = 0)

Constructor. Use user specified allocation strategy if specified.

◆ ACE_Unbounded_List() [2/2]

template<class T >
ACE_Unbounded_List< T >::ACE_Unbounded_List ( const ACE_Unbounded_List< T > & us)

Copy constructor.

◆ ~ACE_Unbounded_List()

template<class T >
ACE_Unbounded_List< T >::~ACE_Unbounded_List ( )

Destructor.

Member Function Documentation

◆ begin()

template<class T >
ACE_Unbounded_List_Iterator< T > ACE_Unbounded_List< T >::begin ( )

◆ copy_nodes()

template<class T >
void ACE_Unbounded_List< T >::copy_nodes ( const ACE_Unbounded_List< T > & us)
private

Copy nodes into this set.

◆ delete_nodes()

template<class T >
void ACE_Unbounded_List< T >::delete_nodes ( )
private

Delete all the nodes in the List.

◆ dump()

template<class T >
void ACE_Unbounded_List< T >::dump ( ) const

Dump the state of an object.

◆ end()

template<class T >
ACE_Unbounded_List_Iterator< T > ACE_Unbounded_List< T >::end ( )

◆ insert()

template<class T >
int ACE_Unbounded_List< T >::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.

◆ insert_tail()

template<class T >
int ACE_Unbounded_List< T >::insert_tail ( const T & item)
private

Insert at the tail of the set (doesn't check for duplicates).

◆ is_empty()

template<class T >
int ACE_Unbounded_List< T >::is_empty ( ) const

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

◆ is_full()

template<class T >
int ACE_Unbounded_List< T >::is_full ( ) const

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

◆ operator=()

template<class T >
void ACE_Unbounded_List< T >::operator= ( const ACE_Unbounded_List< T > & us)

Assignment operator.

◆ remove()

template<class T >
int ACE_Unbounded_List< T >::remove ( const T & item)

Remove first occurrence of from the set. Returns 0 if it removes the item, -1 if it can't find the item, and -1 if a failure occurs.

◆ reset()

template<class T >
void ACE_Unbounded_List< T >::reset ( )

Reset the <ACE_Unbounded_List> to be empty.

◆ size()

template<class T >
size_t ACE_Unbounded_List< T >::size ( ) const

Size of the set.

Friends And Related Symbol Documentation

◆ ACE_Unbounded_List_Iterator< T >

template<class T >
friend class ACE_Unbounded_List_Iterator< T >
friend

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<class T >
ACE_Unbounded_List< T >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ allocator_

template<class T >
ACE_Allocator* ACE_Unbounded_List< T >::allocator_
private

Allocation strategy of the set.

◆ cur_size_

template<class T >
size_t ACE_Unbounded_List< T >::cur_size_
private

Current size of the set.

◆ head_

template<class T >
ACE_NS_Node<T>* ACE_Unbounded_List< T >::head_
private

Head of the linked list of NS_Nodes.


The documentation for this class was generated from the following files: