#include <cfl_attributes.h>

Public Member Functions

 AttributeFlags (void)
 
 AttributeFlags (const AttributeFlags &rOther)
 
virtual ~AttributeFlags (void)
 
bool Test (fType mask) const
 
bool TestAll (fType mask) const
 
bool TestSome (fType mask) const
 
bool TestNone (fType mask) const
 
void Set (fType mask)
 
void Clr (fType mask)
 
virtual bool IsDefault (void) const
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::AttributeVoid
 AttributeVoid (void)
 
 AttributeVoid (const AttributeVoid &rSrcAttr)
 
virtual ~AttributeVoid (void)
 
virtual void SetDefault (void)
 
virtual void Clear (void)
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 
 Type (const Type &rType)
 
virtual ~Type (void)
 
virtual TypeNew (void) const
 
virtual TypeCopy (void) const
 
virtual const TypeCast (const Type *pOther) const
 
virtual TypeAssign (const Type &rSrc)
 
Typeoperator= (const Type &rSrc)
 
virtual bool Equal (const Type &rOther) const
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
virtual void Name (const std::string &rName)
 
virtual const std::string & Name (void) const
 
virtual const std::string & TypeName (void) const
 
void Write (const Type *pContext=0) const
 
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 
void XWrite (const Type *pContext=0) const
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 
void DWrite (const Type *pContext=0) const
 
void DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
void SWrite (TokenWriter &rTw) const
 
void SWrite (void) const
 
std::string ToSText (void) const
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 

Public Attributes

fType mFlags
 

Static Public Attributes

static const fType mDefFlags =0x0
 

Protected Member Functions

void DoAssign (const AttributeFlags &rSrcAttr)
 
bool DoEqual (const AttributeFlags &rOther) const
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
- Protected Member Functions inherited from faudes::AttributeVoid
void DoAssign (const AttributeVoid &rSrcAttr)
 
bool DoEqual (const AttributeVoid &rOther) const
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoSWrite (TokenWriter &rTw) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Additional Inherited Members

- Static Public Member Functions inherited from faudes::AttributeVoid
static void Skip (TokenReader &rTr)
 

Detailed Description

Boolean flags Attribute. This attribute class uses a flag word to represent boolean values. The current implementation uses a long int type and hence handles up to 32 flags. Each flag is accessed by the according bit mask.

The current version of libFAUDES uses bits 0,1,2 of event attributes for controllability properties (see AttributeCFlags) and the bits 31 and 32 of state attributes for the Qt based GUI project. Further versions may use the lower 8 bits of the event aflags and the higher 8 bits of state flags. You are free to use any flags for your application, but if possible try to avoid the above mentioned. For extensive use of flags, you may also consider to define a separate attribute class, perhaps with a different fType.

Definition at line 207 of file cfl_attributes.h.

Constructor & Destructor Documentation

◆ AttributeFlags() [1/2]

faudes::AttributeFlags::AttributeFlags ( void  )
inline

Default constructor

Definition at line 218 of file cfl_attributes.h.

◆ AttributeFlags() [2/2]

faudes::AttributeFlags::AttributeFlags ( const AttributeFlags rOther)
inline

Copy constructor

Definition at line 221 of file cfl_attributes.h.

◆ ~AttributeFlags()

virtual faudes::AttributeFlags::~AttributeFlags ( void  )
inlinevirtual

Destructor

Definition at line 224 of file cfl_attributes.h.

Member Function Documentation

◆ Clr()

void faudes::AttributeFlags::Clr ( fType  mask)
inline

Clear multiple flags

Definition at line 254 of file cfl_attributes.h.

◆ DoAssign()

void faudes::AttributeFlags::DoAssign ( const AttributeFlags rSrcAttr)
protected

Assignment method.

Parameters
rSrcAttrSource to assign from

Definition at line 114 of file cfl_attributes.cpp.

◆ DoEqual()

bool faudes::AttributeFlags::DoEqual ( const AttributeFlags rOther) const
protected

Test equality of configuration data.

Parameters
rOtherOther object to compare with.
Returns
True on match.

Definition at line 122 of file cfl_attributes.cpp.

◆ DoRead()

void faudes::AttributeFlags::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Reads attribute from TokenReader, see Type for public wrappers.

Test whether the current token is an integer with base 16. If so, read the token to the flags value. Else, dont take any tokens. The label and context arguments are ignored.

Parameters
rTrTokenReader to read from
rLabelSection to read
pContextRead context to provide contextual information
Exceptions
Exception
  • IO error (id 1)

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributePriority, faudes::AttributeCFlags, faudes::AttributeTimedState, faudes::AttributeTimedTrans, faudes::SimEventAttribute, faudes::AttributeSimCondition, faudes::AttributeColoredState, faudes::AttributeIosState, faudes::AttributeIosEvent, faudes::AttributeLhaState, faudes::AttributeLhaTrans, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeFailureTypeMap, faudes::AttributeFailureEvents, faudes::DiagLabelSet, and faudes::AttributeDiagnoserState.

Definition at line 155 of file cfl_attributes.cpp.

◆ DoWrite()

void faudes::AttributeFlags::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Write to TokenWriter, see Type for public wrappers.

If not the defult value, write the flag value as base 16 integer token. Else, do nothing. The label and context arguments are ignored.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributePriority, faudes::AttributeCFlags, faudes::AttributeTimedState, faudes::AttributeTimedTrans, faudes::SimEventAttribute, faudes::AttributeSimCondition, faudes::AttributeColoredState, faudes::AttributeIosState, faudes::AttributeIosEvent, faudes::AttributeLhaState, faudes::AttributeLhaTrans, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::AttributeFailureEvents, and faudes::AttributeDiagnoserState.

Definition at line 130 of file cfl_attributes.cpp.

◆ DoXWrite()

void faudes::AttributeFlags::DoXWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Write to TokenWriter, see Type for public wrappers.

If not the defult value, write the flags in XML format. Else, do nothing. The label and context arguments are ignored.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::Type.

Reimplemented in faudes::AttributePriority, faudes::AttributeCFlags, faudes::AttributeColoredState, faudes::AttributeIosState, faudes::AttributeIosEvent, faudes::AttributeLhaState, faudes::AttributeLhaTrans, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::AttributeFailureEvents, and faudes::AttributeDiagnoserState.

Definition at line 142 of file cfl_attributes.cpp.

◆ IsDefault()

◆ operator!=()

bool faudes::Type::operator!=

Test equality of configuration data. See operator==(const Type&).

This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters
rOtherOther objevt to compare with.
Returns
True on mismatch.

Definition at line 60 of file cfl_types.cpp.

◆ operator=()

Type & faudes::Type::operator=

Assign configurationdata from other object. Derived classes should implement the operator form for the assignment for each source type which allows for a non-trivial assignment. This includes the particular case were the source and destination types match exactly. In the latter case the DoAssign method should be invoked. In contrast to the Assign function, the operator form must not be reimplemented for missmatched source types: the operator form only accepts sensible source types. This allows for compiletime typeckecking. However, the downside is that when the type is not known at compiletime, configuration is not properly assigned.

Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters
rSrcSource to copy from
Returns
Reference to this object.

Definition at line 58 of file cfl_types.cpp.

◆ operator==()

bool faudes::Type::operator==

Test equality of configuration data. The operator form of the equality test is only defined for matching types, no cast will be performed. Thus, the test will be optimistic if the type is not known at compiletime. The object name or id is not considered in the test.

This methoc calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters
rOtherOther object to compare with.
Returns
True on match.

Definition at line 59 of file cfl_types.cpp.

◆ Set()

void faudes::AttributeFlags::Set ( fType  mask)
inline

Set multiple flags

Definition at line 249 of file cfl_attributes.h.

◆ Test()

bool faudes::AttributeFlags::Test ( fType  mask) const
inline

Test a flag

Definition at line 229 of file cfl_attributes.h.

◆ TestAll()

bool faudes::AttributeFlags::TestAll ( fType  mask) const
inline

Test multible flags, combine by "and"

Definition at line 234 of file cfl_attributes.h.

◆ TestNone()

bool faudes::AttributeFlags::TestNone ( fType  mask) const
inline

Test multible flags, combine by "not or"

Definition at line 244 of file cfl_attributes.h.

◆ TestSome()

bool faudes::AttributeFlags::TestSome ( fType  mask) const
inline

Test multible flags, combine by "or"

Definition at line 239 of file cfl_attributes.h.

Member Data Documentation

◆ mDefFlags

const fType faudes::AttributeFlags::mDefFlags =0x0
static

Definition at line 265 of file cfl_attributes.h.

◆ mFlags

fType faudes::AttributeFlags::mFlags

Flags (public access for convenience)

Definition at line 262 of file cfl_attributes.h.


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

libFAUDES 2.33c --- 2025.05.15 --- c++ api documentaion by doxygen