A simple list of shared_ptr items. More...
#include <mn_shared_list.hpp>
Public Member Functions | |
basic_shared_list (const allocator_type &allocator=allocator_type()) | |
Creates a basic_shared_list with no elements. More... | |
basic_shared_list (lock_type &lLock, const allocator_type &allocator=allocator_type()) noexcept | |
Creates a basic_shared_list with no elements. More... | |
template<class InputIterator > | |
basic_shared_list (InputIterator first, InputIterator last, const allocator_type &allocator=allocator_type()) noexcept | |
Builds a basic_shared_list from a range. More... | |
basic_shared_list (const basic_shared_list &rhs) noexcept | |
Construct a new basic shared list object. More... | |
iterator | begin_save (unsigned long xTicksToWait=portMAX_DELAY) |
Get the read/write iterator that points to the first element from the list. More... | |
const_iterator | begin_save () const |
Get the read/write iterator that points to the first element from the list. More... | |
iterator | end_save (unsigned long xTicksToWait=portMAX_DELAY) |
Get the read/write iterator that points to the last element from the list. More... | |
const_iterator | end_save (unsigned long xTicksToWait=portMAX_DELAY) const |
Get the read/write iterator that points to the last element from the list. More... | |
const_reference | front_save (unsigned long xTicksToWait=portMAX_DELAY) const |
Get a read/write reference to the data at the first element. More... | |
reference | front_save () |
Get a read/write reference to the data at the first element . More... | |
const_reference | back_save (unsigned long xTicksToWait=portMAX_DELAY) const |
Get a read/write reference to the data at the last element. More... | |
reference | back_save (unsigned long xTicksToWait=portMAX_DELAY) |
Get a read/write reference to the data at the last element. More... | |
void | push_front_save (pointer pValue, unsigned long xTicksToWait=portMAX_DELAY) |
Add data to the front of the list. More... | |
void | push_back_save (pointer pValue, unsigned long xTicksToWait=portMAX_DELAY) |
Add data to the back of the list. More... | |
void | push_front_save (pointer_type pValue, unsigned long xTicksToWait=portMAX_DELAY) |
Add data to the front of the list. More... | |
void | push_back_save (pointer_type pValue, unsigned long xTicksToWait=portMAX_DELAY) |
Add data to the back of the list. More... | |
void | pop_back_save (unsigned long xTicksToWait=portMAX_DELAY) |
Removes last element. More... | |
void | pop_front_save (unsigned long xTicksToWait=portMAX_DELAY) |
Removes first element. More... | |
iterator | insert (iterator pos, pointer value, unsigned long xTicksToWait=portMAX_DELAY) |
Inserts given value into the list before specified iterator. More... | |
iterator | insert_save (iterator pos, pointer_type value, unsigned long xTicksToWait=portMAX_DELAY) |
Inserts given value into the list before specified iterator. More... | |
iterator | erase_save (iterator it, unsigned long xTicksToWait=portMAX_DELAY) |
remove given value into the list before specified iterator. More... | |
iterator | erase_save (iterator first, iterator last, unsigned long xTicksToWait=portMAX_DELAY) |
Remove a range of elements. More... | |
base_type & | list (unsigned long xTicksToWait=portMAX_DELAY) noexcept |
Get the used list of this object. More... | |
const base_type & | list (unsigned long xTicksToWait=portMAX_DELAY) const noexcept |
Get the used list of this object. More... | |
int | lock (unsigned long xTicksToWait=portMAX_DELAY) |
Lock this object. More... | |
int | unlock () |
Unlock this object. More... | |
Public Member Functions inherited from mn::container::basic_list< T, TAllocator, TDeleter > | |
basic_list (const allocator_type &allocator=allocator_type()) | |
Construct a new basic list object. More... | |
template<class InputIterator > | |
basic_list (InputIterator first, InputIterator last, const allocator_type &allocator=allocator_type()) | |
Construct a new basic list object. More... | |
basic_list (const basic_list &rhs) | |
Construct a new basic list object. More... | |
~basic_list () | |
Destroy the basic list object. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
const T & | front () const |
T & | front () |
const T & | back () const |
T & | back () |
void | push_front (const T &value) |
void | pop_front () |
void | push_back (const T &value) |
void | pop_back () |
iterator | insert (iterator pos, const T &value) |
iterator | erase (iterator it) |
iterator | erase (iterator first, iterator last) |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
bool | empty () const |
void | clear () |
size_type | size () const |
allocator_type & | get_allocator () noexcept |
deleter_type & | get_deleter () noexcept |
void | set_allocator (const allocator_type &allocator) |
basic_list & | operator= (const basic_list &rhs) |
Protected Attributes | |
lock_type | m_lockObject |
The lock object. More... | |
Private Types | |
using | base_type = list< pointer::shared_atomic_ptr< T > > |
The base type of this object. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from mn::container::basic_list< T, TAllocator, TDeleter > | |
static const size_type | NodeSize = sizeof(node_type) |
Detailed Description
template<typename T, typename TLockType = mn::mutex_t>
class mn::container::basic_shared_list< T, TLockType >
A simple list of shared_ptr items.
- Template Parameters
-
T The type for an element. TLockType Type of the lock object.
- Note
- Only thread safe when you use all functions with end with _save. For example: insert_save(..) or push_back_save(..)
Member Typedef Documentation
◆ allocator_type
using mn::container::basic_shared_list< T, TLockType >::allocator_type = typename base_type::allocator_type |
◆ base_type
|
private |
The base type of this object.
◆ const_iterator
using mn::container::basic_shared_list< T, TLockType >::const_iterator = typename base_type::const_iterator |
◆ const_pointer
using mn::container::basic_shared_list< T, TLockType >::const_pointer = const typename base_type::value_type* |
◆ const_reference
using mn::container::basic_shared_list< T, TLockType >::const_reference = const typename base_type::value_type& |
◆ deleter
using mn::container::basic_shared_list< T, TLockType >::deleter = typename base_type::deleter |
◆ iterator
using mn::container::basic_shared_list< T, TLockType >::iterator = typename base_type::iterator |
◆ lock_type
using mn::container::basic_shared_list< T, TLockType >::lock_type = TLockType |
◆ node_type
using mn::container::basic_shared_list< T, TLockType >::node_type = typename base_type::node_type |
◆ pointer
using mn::container::basic_shared_list< T, TLockType >::pointer = typename base_type::value_type* |
◆ pointer_type
using mn::container::basic_shared_list< T, TLockType >::pointer_type = pointer::shared_atomic_ptr<T> |
◆ reference
using mn::container::basic_shared_list< T, TLockType >::reference = typename base_type::value_type& |
◆ self_type
using mn::container::basic_shared_list< T, TLockType >::self_type = basic_shared_list<T, TLockType> |
◆ size_type
using mn::container::basic_shared_list< T, TLockType >::size_type = typename base_type::size_type |
◆ value_type
using mn::container::basic_shared_list< T, TLockType >::value_type = typename base_type::value_type |
Constructor & Destructor Documentation
◆ basic_shared_list() [1/4]
|
inline |
Creates a basic_shared_list with no elements.
◆ basic_shared_list() [2/4]
|
inlinenoexcept |
Creates a basic_shared_list with no elements.
- Parameters
-
lLock Reference of the lock object.
◆ basic_shared_list() [3/4]
|
inlinenoexcept |
Builds a basic_shared_list from a range.
- Parameters
-
first An input iterator. last An input iterator. allocator An allocator object.
Create a basic_shared_list consisting of copies of the elements from [@afirst,@alast).
◆ basic_shared_list() [4/4]
|
inlinenoexcept |
Construct a new basic shared list object.
Member Function Documentation
◆ back_save() [1/2]
|
inline |
Get a read/write reference to the data at the last element.
- Returns
- A read/write reference to the data at the last element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ back_save() [2/2]
|
inline |
Get a read/write reference to the data at the last element.
- Returns
- A read/write reference to the data at the last element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ begin_save() [1/2]
|
inline |
Get the read/write iterator that points to the first element from the list.
- Returns
- The read/write iterator that points to the first element from the list.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ begin_save() [2/2]
|
inline |
Get the read/write iterator that points to the first element from the list.
- Returns
- The read/write iterator that points to the first element from the list.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ end_save() [1/2]
|
inline |
Get the read/write iterator that points to the last element from the list.
- Returns
- The read/write iterator that points to the last element from the list.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ end_save() [2/2]
|
inline |
Get the read/write iterator that points to the last element from the list.
- Returns
- The read/write iterator that points to the last element from the list.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ erase_save() [1/2]
|
inline |
Remove a range of elements.
- Parameters
-
first Iterator pointing to the first element to be erased. last Iterator pointing to one past the last element to be xTicksToWait How long to wait to get the lock until giving up.
- Returns
- An iterator pointing to the element pointed to by last prior to erasing (or end()).
◆ erase_save() [2/2]
|
inline |
remove given value into the list before specified iterator.
- Parameters
-
it An iterator into the list. xTicksToWait How long to wait to get the lock until giving up.
- Returns
- An iterator pointing to the next element (or end()).
◆ front_save() [1/2]
|
inline |
Get a read/write reference to the data at the first element .
- Returns
- A read/write reference to the data at the first element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ front_save() [2/2]
|
inline |
Get a read/write reference to the data at the first element.
- Returns
- A read/write reference to the data at the first element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ insert()
|
inline |
Inserts given value into the list before specified iterator.
- Parameters
-
pos An iterator into the list. value Data to be inserted. xTicksToWait How long to wait to get the lock until giving up.
- Returns
- An iterator that points to the inserted data.
◆ insert_save()
|
inline |
Inserts given value into the list before specified iterator.
- Parameters
-
pos An iterator into the list. value Data to be inserted. xTicksToWait How long to wait to get the lock until giving up.
- Returns
- An iterator that points to the inserted data.
◆ list() [1/2]
|
inlinenoexcept |
Get the used list of this object.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
- Returns
- The list.
◆ list() [2/2]
|
inlinenoexcept |
Get the used list of this object.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
- Returns
- The list.
◆ lock()
|
inline |
Lock this object.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
- Returns
- The error code from the using lock object.
◆ pop_back_save()
|
inline |
Removes last element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ pop_front_save()
|
inline |
Removes first element.
- Parameters
-
xTicksToWait How long to wait to get the lock until giving up.
◆ push_back_save() [1/2]
|
inline |
Add data to the back of the list.
- Parameters
-
pValue Data to be added. xTicksToWait How long to wait to get the lock until giving up.
◆ push_back_save() [2/2]
|
inline |
Add data to the back of the list.
- Parameters
-
pValue Data to be added. xTicksToWait How long to wait to get the lock until giving up.
◆ push_front_save() [1/2]
|
inline |
Add data to the front of the list.
- Parameters
-
pValue Data to be added. xTicksToWait How long to wait to get the lock until giving up.
◆ push_front_save() [2/2]
|
inline |
Add data to the front of the list.
- Parameters
-
pValue Data to be added. xTicksToWait How long to wait to get the lock until giving up.
◆ unlock()
|
inline |
Unlock this object.
- Returns
- The error code from the using lock object.
Member Data Documentation
◆ m_lockObject
|
protected |
The lock object.
The documentation for this class was generated from the following file: