Class representing the choices for behaviors of iterators. More...
#include <IteratorBehavior.h>
Public Types | |
enum | Value : Value_t { owned = 0b00001 , halo = 0b00010 , ownedOrHalo = 0b00011 , dummy = 0b00100 , ownedOrHaloOrDummy = 0b00111 , forceSequential = 0b01000 , containerOnly = 0b10000 } |
Different possibilities for iterator behaviors. More... | |
using | Value_t = unsigned int |
Type used for the internal enum. | |
Public Member Functions | |
IteratorBehavior ()=default | |
Constructor. | |
constexpr | IteratorBehavior (Value option) |
Constructor from value. | |
constexpr | IteratorBehavior (Value_t option) |
Constructor from number value. | |
constexpr | operator Value () const |
Cast to value. | |
template<typename ParticleType > | |
bool | contains (ParticleType &particle) |
Check whether this iterator behavior covers the given particle. | |
![]() | |
operator bool ()=delete | |
Prevents cast to bool by deleting the conversion operator. | |
std::string | to_string (bool fixedLength=false) const |
Converts an Option object to its respective string representation. | |
Static Public Member Functions | |
static std::set< IteratorBehavior > | getDiscouragedOptions () |
Set of options that are very unlikely to be interesting. | |
static std::map< IteratorBehavior, std::string > | getOptionNames () |
Provides a way to iterate over the possible choices of AcquisitionFunction. | |
![]() | |
static std::set< IteratorBehavior > | getAllOptions () |
Provides a way to iterate over the possible options. | |
static std::set< IteratorBehavior > | getMostOptions () |
Provides a way to iterate over the possible options minus those that are very unlikely to be on interest. | |
static size_t | maxStringLength () |
Returns the number of characters in the string representation of the longest option. | |
static OutputContainer | parseOptions (const std::string &optionsString) |
Converts a string of options to a set of enums. | |
static IteratorBehavior | parseOptionExact (const std::string &optionString) |
Converts a string to an enum. | |
Class representing the choices for behaviors of iterators.
Choices are a bit vector and can thus be combined via a logical OR.
Different possibilities for iterator behaviors.
|
inlineconstexpr |
Constructor from value.
option |
|
inlineconstexpr |
Constructor from number value.
This is useful when combining values and directly using the result as argument of type IteratorBehavior. This is necessary since e.g. owned & halo results in an object of Value_t instead of Value.
option |
|
inline |
Check whether this iterator behavior covers the given particle.
ParticleType |
particle | particle to be checked |
|
inlinestatic |
Set of options that are very unlikely to be interesting.
Technically these options are not discouraged but when fetching a set of desired behaviors these are probably not useful and would be excluded anyway.
|
inlinestatic |
Provides a way to iterate over the possible choices of AcquisitionFunction.
|
inlineconstexpr |
Cast to value.