Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::FlagsTemplate< FlagType > Class Template Reference

#include <gromacs/utility/flags.h>

Description

template<typename FlagType>
class gmx::FlagsTemplate< FlagType >

Template class for typesafe handling of combination of flags.

Template Parameters
FlagTypeAn enumerated type that holds the possible single flags.

This class is not used publicly, but is present in an installed header because it is used internally in public template classes.

Currently, it is not completely transparent, since or'ing together two FlagType flags does not automatically create a FlagsTemplate object. Also, some operators and more complex operations (like testing for multiple flags at the same time) are missing, but can be added if the need arises.

Public Member Functions

 FlagsTemplate ()
 Creates a flags object with no flags set.
 
 FlagsTemplate (FlagType flag)
 Creates a flags object from a single flag.
 
bool test (FlagType flag) const
 Tests if the given flag is set. More...
 
void clearAll ()
 Clears all flags.
 
void set (FlagType flag)
 Sets the given flag.
 
void clear (FlagType flag)
 Clears the given flag.
 
void set (FlagType flag, bool bSet)
 Sets or clears the given flag.
 
FlagsTemplate< FlagType > operator| (const FlagsTemplate< FlagType > &other) const
 Combines flags from two flags objects.
 
FlagsTemplate< FlagType > & operator|= (const FlagsTemplate< FlagType > &other)
 Combines flags from another flag object.
 
FlagsTemplate< FlagType > operator& (const FlagsTemplate< FlagType > &other) const
 Combined flags from two flags objects.
 
FlagsTemplate< FlagType > operator~ () const
 Returns an object with all flags flipped.
 

Member Function Documentation

template<typename FlagType>
bool gmx::FlagsTemplate< FlagType >::test ( FlagType  flag) const
inline

Tests if the given flag is set.

Note that if flag has more than a single bit set, then returns true if any of them is set.


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