This object represents the default queue implementation used by Orocos objects.
More...
#include <rtt/internal/List.hpp>
template<class T>
class RTT::internal::List< T >
This object represents the default queue implementation used by Orocos objects.
Definition at line 65 of file List.hpp.
Create a queue of fixed size.
Optionally, add the number of threads that may concurrently access this queue.
Definition at line 78 of file List.hpp.
Append a single value to the list.
This function calls the copy-constructor of item and may call the destructor of item
- Parameters
-
- Returns
- false if the list is full.
- Note
- This function is only real-time if the destructor or copy-constructor of of T is real-time.
Definition at line 344 of file ListLockFree.hpp.
Referenced by RTT::corba::CorbaDispatcher::dispatchChannel().
Append a sequence of values to the list.
- Parameters
-
items | the values to append. |
- Returns
- the number of values written (may be less than d.size())
- Note
- This function is only real-time if the destructor and copy-constructor of of T is real-time.
Definition at line 401 of file ListLockFree.hpp.
template<class T>
template<class Function >
template<class T>
template<class Function >
Apply a function to the non-blanked elements of the list.
If during an apply_and_blank, the erase_and_blank function is called, that element will not be subject to func if not yet processed. You must not call this function concurrently from multiple threads.
- Parameters
-
func | The function to apply. |
blank | The 'blank' item. Each item of this list will be compared to this item using operator==(), if it matches, it is considered blank, and func is not applied. |
- See also
- erase_and_blank
- Deprecated:
- This complicated function is nowhere used.
- Note
- This function is only real-time if the destructor and copy-constructor of of T is real-time.
Definition at line 552 of file ListLockFree.hpp.
Returns the maximum number of elements this list can hold.
- Note
- Always real-time.
Definition at line 178 of file ListLockFree.hpp.
Clears all elements in the list.
- Postcondition
- this->empty() == true
- Note
- This function is not real-time if the destructor of of T is not real-time.
Definition at line 316 of file ListLockFree.hpp.
template<class T>
template<typename Pred >
Erase a value from the list.
- Parameters
-
function | each elements for which pred returns true are removed |
- Returns
- true if at least one element has been removed
- Note
- This function is only real-time if the destructor and copy-constructor of of T is real-time.
Definition at line 480 of file ListLockFree.hpp.
Erase an element from the list and blank it if possible.
If during an apply_and_blank, the erase_and_blank function is called, that element will not be subject to func if not yet processed. You may call this function concurrently from multiple threads.
- Warning
- It is possible that item is being processed within apply_and_blank. In that case the 'blank' operation has no effect.
- Parameters
-
item | The item to erase from the list. |
blank | The 'blank' item to use to blank item from the list. |
- See also
- apply_and_blank
- Deprecated:
- This complicated function is nowhere used.
- Note
- This function is only real-time if the destructor and copy-constructor of of T is real-time.
Definition at line 597 of file ListLockFree.hpp.
template<class T>
template<class Function >
Find an item in the list such that func( item ) == true.
- Parameters
-
blank | The value to return if not found. |
- Returns
- The item that matches func(item) or blank if none matches.
- Note
- This function is only real-time if the copy-constructor of of T is real-time.
Definition at line 626 of file ListLockFree.hpp.
Grow the capacity to contain at least n additional items.
This method tries to avoid too much re-allocations, by growing a bit more than required every N invocations and growing nothing in between.
- Parameters
-
items | The number of items to at least additionally reserve. |
- Note
- Almost never real-time.
Definition at line 224 of file ListLockFree.hpp.
Reserve a capacity for this list.
If you wish to invoke this method concurrently, guard it with a mutex. The other methods may be invoked concurrently with this method.
- Parameters
-
lsize | the minimal number of items this list will be able to hold. Will not drop below the current capacity() and this method will do nothing if lsize < this->capacity(). @ Not real-time if lsize <= this->capacity(). |
Definition at line 252 of file ListLockFree.hpp.
Referenced by RTT::internal::SignalBase::reserve().
Shrink the capacity with at most n items.
This method does not actually free memory, it just prevents a (number of) subsequent grow() invocations to allocate more memory.
- Parameters
-
items | The number of items to at most remove from the capacity. |
- Note
- Always real-time.
Definition at line 238 of file ListLockFree.hpp.
Returns the current number of elements in this list.
- Note
- Always real-time.
Definition at line 192 of file ListLockFree.hpp.
The maximum number of threads.
The number of threads which may concurrently access this buffer.
Definition at line 93 of file ListLockFree.hpp.
The documentation for this class was generated from the following file: