AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
Flag Class Reference

The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal to specify, which elements should be visited. More...

#include <Flag.hpp>

Public Member Functions

constexpr Flag ()=default
 Constructs a unset Flag.
 
constexpr Flag (const std::uint64_t f)
 Constructs a Flag initialized by f.
 
constexpr Flag (Flag const &)=default
 Copy constructor.
 
constexpr Flag (Flag &&)=default
 Move constructor.
 
constexpr bool operator== (Flag const &f) const
 Compares two Flags.
 
constexpr bool operator!= (Flag const &f) const
 Compares two Flags.
 
constexpr Flagoperator= (Flag const &f)
 Assignment operator.
 
constexpr operator bool () const
 Typecast.
 
constexpr void setFlags (const std::uint64_t f)
 Set flags_.
 
constexpr void setFlags (Flag const &f)
 Set flags_.
 
constexpr void setFlag (const std::uint64_t f)
 Sets flags_ to flags_ | f.
 
constexpr void setFlag (Flag const &f)
 Sets flags_ to flags_ | f.flags_.
 
constexpr void unsetFlag (const std::uint64_t f)
 Sets flags_ to flags_ & ~f.
 
constexpr void unsetFlag (Flag const &f)
 Sets flags_ to flags_ & ~f.flags_.
 
constexpr std::uint64_t flags () const
 
constexpr Flag operator&= (Flag const &f)
 Sets flags_ to flags_ &= f.flags_.
 
constexpr Flagoperator|= (Flag const &f)
 Sets flags_ to flags_ & f.flags_.
 
constexpr Flag operator~ () const
 Returns ~flags_.
 
constexpr bool isSet (Flag const &f) const
 Checks whether all set bits of f.flags_ are set in flags_ too.
 
constexpr bool isUnset (Flag const &f) const
 Returns !isSet(f)
 
constexpr bool isAnySet () const
 Returns true if flags_ != 0.
 

Protected Attributes

std::uint64_t flags_ = 0
 Internal flag representation.
 

Friends

Flag operator+ (Flag r, Flag const &f)
 Returns flags_ | f.flags_.
 
Flag operator- (Flag r, Flag const &f)
 Returns flags_ & ~f.flags_.
 
Flag operator| (Flag r, Flag const &f)
 Returns flags_ | f.flags_.
 
Flag operator& (Flag r, Flag const &f)
 Returns flags_ & f.flags_.
 
Flag operator^ (Flag r, Flag const &f)
 Returns flags_ ^ f.flags_.
 

Detailed Description

The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal to specify, which elements should be visited.


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