Belle II Software development
|
A mixin class to attach a set of weighted items to a class. More...
#include <WithWeightedItems.h>
Public Member Functions | |
WithWeightedItems (const T &t) | |
Also forward the copy constructor form the base class object. | |
Weight | getWeight () const |
Cumulated weight of the contained items. | |
template<class APredicate > | |
void | eraseIf (const APredicate &predicate) |
Erase items from this node that satisfy the predicate. | |
void | insert (const AItem &item, Weight weight=1.0) |
Add an item with weight. | |
template<class AMeasure > | |
void | insert (const This &items, AMeasure &measure) |
Add the items from another item range assigning a weight from the predicate. | |
std::vector< WithWeight< AItem > >::iterator | begin () |
Begin iterator of the contained items. | |
std::vector< WithWeight< AItem > >::const_iterator | begin () const |
Begin iterator of the contained items. | |
std::vector< WithWeight< AItem > >::iterator | end () |
End iterator of the contained items. | |
std::vector< WithWeight< AItem > >::const_iterator | end () const |
End iterator of the contained items. | |
size_t | size () const |
Getter for the number of items. | |
void | clear () |
Clear the contained items. | |
Private Types | |
using | Super = T |
Type of the base class. | |
using | This = WithWeightedItems< T, AItem > |
Type of this class. | |
Private Attributes | |
std::vector< WithWeight< AItem > > | m_items |
Memory for the weighted items. | |
std::vector< WithWeight< AItem > >::iterator | m_itEnd {m_items.end()} |
Memory for the end of the items that are not erased. | |
A mixin class to attach a set of weighted items to a class.
Definition at line 25 of file WithWeightedItems.h.
|
private |
Type of the base class.
Definition at line 29 of file WithWeightedItems.h.
|
private |
Type of this class.
Definition at line 32 of file WithWeightedItems.h.
|
inlineexplicit |
Also forward the copy constructor form the base class object.
Definition at line 42 of file WithWeightedItems.h.
|
inline |
Begin iterator of the contained items.
Definition at line 91 of file WithWeightedItems.h.
|
inline |
Begin iterator of the contained items.
Definition at line 97 of file WithWeightedItems.h.
|
inline |
Clear the contained items.
Definition at line 122 of file WithWeightedItems.h.
|
inline |
End iterator of the contained items.
Definition at line 103 of file WithWeightedItems.h.
|
inline |
End iterator of the contained items.
Definition at line 109 of file WithWeightedItems.h.
|
inline |
Erase items from this node that satisfy the predicate.
Definition at line 60 of file WithWeightedItems.h.
|
inline |
Cumulated weight of the contained items.
Definition at line 48 of file WithWeightedItems.h.
|
inline |
|
inline |
Add the items from another item range assigning a weight from the predicate.
Definition at line 80 of file WithWeightedItems.h.
|
inline |
Getter for the number of items.
Definition at line 115 of file WithWeightedItems.h.
|
private |
Memory for the weighted items.
Definition at line 132 of file WithWeightedItems.h.
|
private |
Memory for the end of the items that are not erased.
Definition at line 135 of file WithWeightedItems.h.