AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
autopas::options::IteratorBehavior Class Reference

Class representing the choices for behaviors of iterators. More...

#include <IteratorBehavior.h>

Inheritance diagram for autopas::options::IteratorBehavior:
Inheritance graph
[legend]
Collaboration diagram for autopas::options::IteratorBehavior:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from autopas::options::Option< IteratorBehavior >
 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< IteratorBehaviorgetDiscouragedOptions ()
 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 Public Member Functions inherited from autopas::options::Option< IteratorBehavior >
static std::set< IteratorBehaviorgetAllOptions ()
 Provides a way to iterate over the possible options.
 
static std::set< IteratorBehaviorgetMostOptions ()
 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.
 

Detailed Description

Class representing the choices for behaviors of iterators.

Choices are a bit vector and can thus be combined via a logical OR.

Member Enumeration Documentation

◆ Value

Different possibilities for iterator behaviors.

Enumerator
owned 

Iterate only over owned particles.

halo 

Iterate only over halo particles.

ownedOrHalo 

Iterate over both halo and owned particles.

Defined fore ease of access.

dummy 

Iterate only over dummy particles.

ownedOrHaloOrDummy 

Iterate over both halo and owned particles and also dummy particles.

Defined fore ease of access.

forceSequential 

Force the iterator to behave like a sequential iterator even when created in a parallel region.

containerOnly 

Force the iterator to iterate over Container only.

Constructor & Destructor Documentation

◆ IteratorBehavior() [1/2]

constexpr autopas::options::IteratorBehavior::IteratorBehavior ( Value  option)
inlineconstexpr

Constructor from value.

Parameters
option

◆ IteratorBehavior() [2/2]

constexpr autopas::options::IteratorBehavior::IteratorBehavior ( Value_t  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.

Parameters
option

Member Function Documentation

◆ contains()

template<typename ParticleType >
bool autopas::options::IteratorBehavior::contains ( ParticleType &  particle)
inline

Check whether this iterator behavior covers the given particle.

Template Parameters
ParticleType
Parameters
particleparticle to be checked
Returns
true if this iterator behavior covers the given particle, false otherwise

◆ getDiscouragedOptions()

static std::set< IteratorBehavior > autopas::options::IteratorBehavior::getDiscouragedOptions ( )
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.

Returns

◆ getOptionNames()

static std::map< IteratorBehavior, std::string > autopas::options::IteratorBehavior::getOptionNames ( )
inlinestatic

Provides a way to iterate over the possible choices of AcquisitionFunction.

Returns
map option -> string representation

◆ operator Value()

constexpr autopas::options::IteratorBehavior::operator Value ( ) const
inlineconstexpr

Cast to value.

Returns

The documentation for this class was generated from the following file: