#include <multiset.hpp>
Classes | |
struct | Chunk |
struct | ComparingPredicate |
struct | IndexPredicate |
struct | Item |
struct | OperatorToFalsePredicateAdapter |
struct | YesPredicate |
Public Member Functions | |
void | clear () |
T * | emplace () |
template<typename P1 > | |
T * | emplace (P1 p1) |
template<typename P1 , typename P2 > | |
T * | emplace (P1 p1, P2 p2) |
template<typename P1 , typename P2 , typename P3 > | |
T * | emplace (P1 p1, P2 p2, P3 p3) |
template<typename Predicate > | |
T * | find (Predicate predicate) |
template<typename Predicate > | |
const T * | find (Predicate predicate) const |
template<typename Operator > | |
void | forEach (Operator oper) |
template<typename Operator > | |
void | forEach (Operator oper) const |
T * | getByIndex (unsigned index) |
const T * | getByIndex (unsigned index) const |
unsigned | getSize () const |
bool | isEmpty () const |
Multiset (IPoolAllocator &allocator) | |
void | removeAll (const T &ref) |
template<typename Predicate > | |
void | removeAllWhere (Predicate predicate) |
void | removeFirst (const T &ref) |
template<typename Predicate > | |
void | removeFirstWhere (Predicate predicate) |
~Multiset () | |
Private Types | |
enum | RemoveStrategy { RemoveOne, RemoveAll } |
Private Member Functions | |
void | compact () |
Item * | findOrCreateFreeSlot () |
template<typename Predicate > | |
void | removeWhere (Predicate predicate, RemoveStrategy strategy) |
![]() | |
Noncopyable () | |
~Noncopyable () | |
Private Attributes | |
IPoolAllocator & | allocator_ |
LinkedListRoot< Chunk > | list_ |
Slow but memory efficient unordered multiset. Unlike Map<>, this container does not move objects, so they don't have to be copyable.
Items will be allocated in the node's memory pool.
Definition at line 29 of file multiset.hpp.
|
private |
Enumerator | |
---|---|
RemoveOne | |
RemoveAll |
Definition at line 131 of file multiset.hpp.
|
inline |
Definition at line 191 of file multiset.hpp.
|
inline |
Definition at line 195 of file multiset.hpp.
|
inline |
Definition at line 271 of file multiset.hpp.
|
private |
Definition at line 369 of file multiset.hpp.
|
inline |
Creates one item in-place and returns a pointer to it. If creation fails due to lack of memory, UAVCAN_NULLPTR will be returned. Complexity is O(N).
Definition at line 205 of file multiset.hpp.
Definition at line 218 of file multiset.hpp.
|
inline |
Definition at line 231 of file multiset.hpp.
|
inline |
Definition at line 244 of file multiset.hpp.
T * uavcan::Multiset< T >::find | ( | Predicate | predicate | ) |
Returns first entry where the predicate returns true. Predicate prototype: bool (const T& item)
Definition at line 437 of file multiset.hpp.
|
inline |
Definition at line 282 of file multiset.hpp.
|
private |
Definition at line 342 of file multiset.hpp.
|
inline |
Calls Operator for each item of the set. Operator prototype: void (T& item) void (const T& item) - const overload
Definition at line 294 of file multiset.hpp.
|
inline |
Definition at line 301 of file multiset.hpp.
|
inline |
Returns an item located at the specified position from the beginning. Note that addition and removal operations invalidate indices. If index is greater than or equal the number of items, null pointer will be returned. Complexity is O(N).
Definition at line 313 of file multiset.hpp.
|
inline |
Definition at line 319 of file multiset.hpp.
unsigned uavcan::Multiset< T >::getSize |
Counts number of items stored. Best case complexity is O(N).
Definition at line 461 of file multiset.hpp.
|
inline |
Complexity is O(1).
Definition at line 327 of file multiset.hpp.
|
inline |
Definition at line 269 of file multiset.hpp.
|
inline |
Removes entries where the predicate returns true. Predicate prototype: bool (T& item)
Definition at line 262 of file multiset.hpp.
|
inline |
Definition at line 267 of file multiset.hpp.
|
inline |
Definition at line 265 of file multiset.hpp.
|
private |
Definition at line 395 of file multiset.hpp.
|
private |
Definition at line 122 of file multiset.hpp.
|
private |
Definition at line 121 of file multiset.hpp.