COPASI API  4.40.278
CFlags< Enum > Class Template Reference

#include <CFlags.h>

Inheritance diagram for CFlags< Enum >:
[legend]

Public Types

typedef std::bitset< static_cast< size_t >Enum::__SIZE) > bitset
 

Public Member Functions

 CFlags ()
 
 CFlags (const bitset &flags)
 
 CFlags (const CFlags &src)
 
 CFlags (const Enum &flag)
 
 CFlags (const std::string &str)
 
template<typename AType >
std::vector< AType > getAnnotations (const CEnumAnnotation< AType, Enum > &annotation, const CFlags &filter=All) const
 
bool isSet (const Enum &flag) const
 
 operator bitset ()
 
 operator bool () const
 
bool operator!= (const CFlags< Enum > &rhs) const
 
CFlagsoperator&= (const CFlags &flags)
 
CFlagsoperator&= (const Enum &flag)
 
bool operator== (const CFlags< Enum > &rhs) const
 
CFlagsoperator^= (const CFlags &flags)
 
CFlagsoperator^= (const Enum &flag)
 
CFlagsoperator|= (const CFlags &flags)
 
CFlagsoperator|= (const Enum &flag)
 
 ~CFlags ()
 

Static Public Attributes

static const CFlags All
 
static const CFlags None
 

Member Typedef Documentation

◆ bitset

template<class Enum >
typedef std::bitset< static_cast< size_t >Enum::__SIZE) > CFlags< Enum >::bitset

Constructor & Destructor Documentation

◆ CFlags() [1/5]

template<class Enum >
CFlags< Enum >::CFlags ( )
inline

◆ CFlags() [2/5]

template<class Enum >
CFlags< Enum >::CFlags ( const CFlags< Enum > &  src)
inline

Copy constructor

Parameters
constCFlags & src

◆ CFlags() [3/5]

template<class Enum >
CFlags< Enum >::CFlags ( const Enum &  flag)
inline

Enum constructor

Parameters
constEnum & flag

◆ CFlags() [4/5]

template<class Enum >
CFlags< Enum >::CFlags ( const bitset flags)
inline

Bitset constructor

Parameters
constbitset & flags

◆ CFlags() [5/5]

template<class Enum >
CFlags< Enum >::CFlags ( const std::string &  str)
inline

String constructor

Parameters
conststd::string & str

◆ ~CFlags()

template<class Enum >
CFlags< Enum >::~CFlags ( )
inline

Destructor

Member Function Documentation

◆ getAnnotations()

template<class Enum >
template<typename AType >
std::vector< AType > CFlags< Enum >::getAnnotations ( const CEnumAnnotation< AType, Enum > &  annotation,
const CFlags< Enum > &  filter = All 
) const
inline

Create the subset of the provided annotations for the flags which are set

Parameters
constCEnumAnnotation< AType, Enum > & annotation
constCFlags & filter (Default: All)
Returns
std::vector< AType > Annotations

Referenced by CValidity::getIssueMessages().

◆ isSet()

◆ operator bitset()

template<class Enum >
CFlags< Enum >::operator bitset ( )
inline

Cast to bitset

◆ operator bool()

template<class Enum >
CFlags< Enum >::operator bool ( ) const
inline

Cast to bool

References CFlags< Enum >::None, and CFlags< Enum >::operator!=().

◆ operator!=()

template<class Enum >
bool CFlags< Enum >::operator!= ( const CFlags< Enum > &  rhs) const
inline

Inequality comparison operator

Parameters
constCFlags< Enum > & rhs
Returns
bool notEqual

Referenced by CFlags< Enum >::operator bool().

◆ operator&=() [1/2]

template<class Enum >
CFlags& CFlags< Enum >::operator&= ( const CFlags< Enum > &  flags)
inline

Bitwise AND assignment operator

Parameters
constCFlags & flags
Returns
CFlags & *this

Referenced by CFlags< Enum >::operator&=().

◆ operator&=() [2/2]

template<class Enum >
CFlags& CFlags< Enum >::operator&= ( const Enum &  flag)
inline

Bitwise AND assignment operator

Parameters
constEnum & flag
Returns
CFlags & *this

References CFlags< Enum >::CFlags(), and CFlags< Enum >::operator&=().

◆ operator==()

template<class Enum >
bool CFlags< Enum >::operator== ( const CFlags< Enum > &  rhs) const
inline

Equality comparison operator

Parameters
constCFlags< Enum > & rhs
Returns
bool equal

References operator==().

◆ operator^=() [1/2]

template<class Enum >
CFlags& CFlags< Enum >::operator^= ( const CFlags< Enum > &  flags)
inline

Bitwise XOR assignment operator

Parameters
constCFlags & flags
Returns
CFlags & *this

Referenced by CFlags< Enum >::operator^=().

◆ operator^=() [2/2]

template<class Enum >
CFlags& CFlags< Enum >::operator^= ( const Enum &  flag)
inline

Bitwise XOR assignment operator

Parameters
constEnum & flag
Returns
CFlags & *this

References CFlags< Enum >::CFlags(), and CFlags< Enum >::operator^=().

◆ operator|=() [1/2]

template<class Enum >
CFlags& CFlags< Enum >::operator|= ( const CFlags< Enum > &  flags)
inline

Bitwise OR assignment operator

Parameters
constCFlags & flags
Returns
CFlags & *this

Referenced by CFlags< Enum >::operator|=().

◆ operator|=() [2/2]

template<class Enum >
CFlags& CFlags< Enum >::operator|= ( const Enum &  flag)
inline

Bitwise OR assignment operator

Parameters
constEnum & flag
Returns
CFlags & *this

References CFlags< Enum >::CFlags(), and CFlags< Enum >::operator|=().

Member Data Documentation

◆ All

◆ None

template<class Enum >
const CFlags< Enum > CFlags< Enum >::None
static

Static member where no flag is set

Referenced by CFlags< Enum >::operator bool().


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