Recycle access to a data container.
More...
#include <RecycleAccess.h>
Recycle access to a data container.
A recycle access allows to recycle data which is not used anymore. In other words, it provides a mechanism to reclaim objects which are ready to be destroyed and to reuse the memory the occupy. This avoids frequent allocation and deallocation of these objects.
§ RecycleAccess() [1/2]
| stromx::runtime::RecycleAccess::RecycleAccess |
( |
const DataContainer & |
data | ) |
|
|
explicit |
Constructs a recycle access and adds data to it.
- Parameters
-
| data | This data will be recycled by this access. |
§ RecycleAccess() [2/2]
| stromx::runtime::RecycleAccess::RecycleAccess |
( |
| ) |
|
|
inline |
Constructs an empty recycle access.
§ add()
| void stromx::runtime::RecycleAccess::add |
( |
const DataContainer & |
data | ) |
|
Adds data to the recycle access.
- Parameters
-
| data | This data will be recycled by this access. |
§ empty()
| bool stromx::runtime::RecycleAccess::empty |
( |
| ) |
const |
Returns true if the recycle access does not reference any data which can be recycled.
§ get() [1/2]
| Data * stromx::runtime::RecycleAccess::get |
( |
| ) |
const |
Waits for data which has been added to the recycle access and is ready to be recycled, i.e. no other objects reference it. Returns 0 if the recycle access does not reference any data which can be recycled.
§ get() [2/2]
| Data * stromx::runtime::RecycleAccess::get |
( |
const unsigned int |
timeout | ) |
const |
Waits for data which has been added to the recycle access and is ready to be recycled, i.e. no other objects reference it. Returns 0 if the recycle access does not reference any data which can be recycled.
- Parameters
-
| timeout | The maximal time to wait in milliseconds. |
- Exceptions
-
| Timeout | If no data was recycled during the timeout. |
§ operator()() [1/2]
| Data* stromx::runtime::RecycleAccess::operator() |
( |
| ) |
const |
|
inline |
Waits for data which has been added to the recycle access and is ready to be recycled, i.e. no other objects reference it. Returns 0 if the recycle access does not reference any data which can be recycled.
§ operator()() [2/2]
| Data* stromx::runtime::RecycleAccess::operator() |
( |
const unsigned int |
timeout | ) |
const |
|
inline |
Waits for data which has been added to the recycle access and is ready to be recycled, i.e. no other objects reference it. Returns 0 if the recycle access does not reference any data which can be recycled.
- Parameters
-
| timeout | The maximal time to wait in milliseconds. |
- Exceptions
-
| Timeout | If no data was recycled during the timeout. |
§ release()
| void stromx::runtime::RecycleAccess::release |
( |
| ) |
|
|
inline |
Releases the write access. The access is empty after calling this function.
The documentation for this class was generated from the following files: