Inheritance diagram for CdbBdbSRallocatorP< RT, RT_OPERATIONS_POLICY >:

Public Member Functions | |
| CdbBdbSRallocatorP () | |
| Default constructor. | |
| virtual | ~CdbBdbSRallocatorP () |
| Destructor. | |
| virtual CdbStatus | isAllocated (const RT &theResource) const |
| Check allocation of specified resource. | |
| virtual CdbStatus | force (const RT &theResource) |
| Force allocation of specified resource. | |
| virtual CdbStatus | allocate (RT &theResource) |
| Allocate a resource. | |
| virtual CdbStatus | release (const RT &theResource) |
| Release specified resource. | |
| virtual CdbItr< RT > | iterator () const |
| Get an instance of an iterator for allocated resources. | |
| virtual void | dump (std::ostream &o) const |
| Dump the contents of the object. | |
This persistent class represents "resource allocator", whose primary focus (although not limited to) is at various sorts of identifiers. This facility is capable of managing individual values (not ranges) of resources.
The class has the following template parameters:
RT: the type of the managed resource. This class is expected to provide the following public interface:
Basically, it's the same interface, which is required to put objects of the RT type into a B-tree.
RT_OPERATIONS_POLICY: an optional policy for the RT type. The role of this policy is to supply an appropriate abstraction for the following operations:
IMPORTANT: It's assumed that when the iterated value will reach its maximum available state then the iterator will switch back to the minimum state as defined above.
IMPORTANT: The "Resource Allocator" neither assumes an existence nor relies at any internal state the RT_OPERATIONS_POLICY class may have. It means that the methods of a concrete policy classs supplied through this template parameter can be invoked at any sequence and they will always provide repeatable results for the same values of their input parameters.
See the interface of the default RT_OPERATIONS_POLICY class as a specification for the interface of user-defined policy classes.
This class also provides default version of the RT_OPERATIONS_POLICY class, which is sufficient enough for most primitive ("countable") data types like: d_ULong, d_UShort, etc. The default implementation of the RT_OPERATIONS_POLICY relies on the following:
The abstract user defined types require proper policy class to be supplied along with RT type to override the default policy unless the RT type has sufficient (both formally and semantically) public interface meeting the requirements of the default implementation for OPERATIONS.
Definition at line 98 of file CdbBdbSRallocatorP.ddl.
|
|||||||||
|
Default constructor. Initializes an empty collectiuon Definition at line 21 of file CdbBdbSRallocatorP.cc. |
|
|||||||||
|
Destructor. Will also destroy all the elements. Definition at line 35 of file CdbBdbSRallocatorP.cc. |
|
||||||||||
|
Allocate a resource. The method will return:
Definition at line 55 of file CdbBdbSRallocatorP.cc. References CdbItr< T >::next(), CdbStatus::NotFound, CdbStatus::Success, and CdbItr< T >::value(). |
|
||||||||||
|
Dump the contents of the object.
Definition at line 155 of file CdbBdbSRallocatorP.cc. References CdbItr< T >::next(), and CdbItr< T >::value(). |
|
||||||||||
|
Force allocation of specified resource. The method makes sure that specified resource, whose value passed to the procedure gets allocated. The passed resource can already be allocated. The method will return:
Definition at line 97 of file CdbBdbSRallocatorP.cc. References CdbBdbSRallocatorP< RT, RT_OPERATIONS_POLICY >::isAllocated(), CdbStatus::NotFound, and CdbStatus::Success. |
|
||||||||||
|
Check allocation of specified resource. The method will return:
Definition at line 44 of file CdbBdbSRallocatorP.cc. References CdbStatus::Error, CdbStatus::NotFound, and CdbStatus::Success. Referenced by CdbBdbSRallocatorP< RT, RT_OPERATIONS_POLICY >::force(), and CdbBdbSRallocatorP< RT, RT_OPERATIONS_POLICY >::release(). |
|
|||||||||
|
Get an instance of an iterator for allocated resources. This kind of iterator provides "non-sorted" access to the values of allocated resources. Definition at line 147 of file CdbBdbSRallocatorP.cc. |
|
||||||||||
|
Release specified resource. The method will return:
Definition at line 132 of file CdbBdbSRallocatorP.cc. References CdbBdbSRallocatorP< RT, RT_OPERATIONS_POLICY >::isAllocated(), and CdbStatus::Success. |
1.3-rc3