Realizing a mapping from a pool of values to be cycled from the index.
More...
#include <Mapping.h>
|
| CycleMapping (const std::vector< std::string > &values) |
| Constructor receiving the values to be cycled.
|
|
std::string | map (int index, T &t) override |
| Return a value from the cycle value according to the given index.
|
|
std::string | info () override |
| Informal string summarizing the translation from the object to the attribute value.
|
|
|
std::vector< std::string > | m_values |
| Memory for the attribute values to be cycled.
|
|
template<class T>
class Belle2::TrackFindingCDC::CycleMapping< T >
Realizing a mapping from a pool of values to be cycled from the index.
Definition at line 73 of file Mapping.h.
◆ CycleMapping()
Constructor receiving the values to be cycled.
Definition at line 77 of file Mapping.h.
78 : m_values(values)
79 {
80 }
◆ info()
Informal string summarizing the translation from the object to the attribute value.
Reimplemented from Mapping< T >.
Definition at line 90 of file Mapping.h.
91 {
92 return "Cycle through " + bracketed(join(", ", m_values)) + "\n";
93 }
◆ map()
template<class T>
std::string map |
( |
int | index, |
|
|
T & | t ) |
|
inlineoverridevirtual |
Return a value from the cycle value according to the given index.
Reimplemented from Mapping< T >.
Definition at line 83 of file Mapping.h.
84 {
85 assert(index >= 0);
86 return m_values[index % m_values.size()];
87 }
◆ m_values
template<class T>
std::vector<std::string> m_values |
|
private |
Memory for the attribute values to be cycled.
Definition at line 97 of file Mapping.h.
The documentation for this class was generated from the following file:
- tracking/trackFindingCDC/display/include/Mapping.h