CIAO::Object_Set< T, T_var > Class Template Reference
A helper template class for maintaining and managing a set of object reference.
More...
#include <Object_Set_T.h>
Collaboration diagram for CIAO::Object_Set< T, T_var >:
[legend]List of all members.
Detailed Description
template<class T, class T_var>
class CIAO::Object_Set< T, T_var >
A helper template class for maintaining and managing a set of object reference.
This class provides a naive implementation of an object reference set. It is naive because it simply keeps object references in an objref_var array without checking for duplication. More importantly, it takes O(n) to to look for an object reference and return it. What we really need is a thread-safe hash_set<> like class here. Since this is mostly used only during setup/assemble time for a CIAO application, i.e., not on critical path, this class serves as a place holder for later, more efficient implementation.
Constructor & Destructor Documentation
|
Default contructor that also allows initializing the initial capacity of the set and the increment step. |
Member Function Documentation
|
Adding a new object reference to the set. Return -1 if error occurred. |
|
Access the underlying T_var array directly. This is added to get around a bug in TAO's sequence of object C++ mapping. |
|
Query the current capacity the set.
|
|
Get a copy of the object reference set into the incoming array buffer with capacity of size . buffer is usually allocated using a sequence's allocbuf method. Notice that caller is responsible to release the object references in buffer.
- Return values:
-
| actual | number of objrefs copied into buffer . |
|
template<class T, class T_var> |
void CIAO::Object_Set< T, T_var >::grow |
( |
void |
|
) |
[protected] |
|
|
Grow the internal array holding the object references.
|
template<class T, class T_var> |
int CIAO::Object_Set< T, T_var >::object_in_set |
( |
T * |
objref |
) |
|
|
|
Check if an object is in the set. Return 0 if false. |
template<class T, class T_var> |
void CIAO::Object_Set< T, T_var >::release |
( |
void |
|
) |
|
|
|
Release all object references. |
|
Removing an object from the set. Return -1 if error occurred.
|
|
Removing all objects from the set. Return -1 if error occurred.
|
|
Query the current size the set contains.
|
Member Data Documentation
|
Pointer to the dynamically allocated buffer that holds the object references. |
|
Maximun capacity of this->buffer_;.
|
|
How many more slots to add each time we expand the capacity of this set. |
The documentation for this class was generated from the following files:
Generated on Wed Dec 21 00:02:28 2005 for CIAO by
1.3.9.1