#include <attributes.h>
Inheritance diagram for faudes::AttributeFlags:
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 251 of file attributes.h.
Public Member Functions | |
AttributeFlags (void) | |
Default constructor. | |
virtual | ~AttributeFlags (void) |
Destructor. | |
bool | Test (fType mask) const |
Test a flag. | |
bool | TestAll (fType mask) const |
Test multible flags, combine by "and". | |
bool | TestSome (fType mask) const |
Test multible flags, combine by "or". | |
bool | TestNone (fType mask) const |
Test multible flags, combine by "not or". | |
void | Set (fType mask) |
Set multiple flags. | |
void | Clr (fType mask) |
Clear multiple flags. | |
bool | IsDefault (void) const |
Test for default value. | |
Public Attributes | |
fType | mFlags |
Flags (public access for convenience). | |
Static Public Attributes | |
static const fType | mDefFlags = 0x0 |
Protected Member Functions | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Reads attribute from TokenReader, see AttributeVoid for public wrappers. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see AttributeVoid for public wrappers. |
|
Default constructor.
Definition at line 255 of file attributes.h. |
|
Destructor.
Definition at line 258 of file attributes.h. |
|
Clear multiple flags.
Definition at line 288 of file attributes.h. |
|
Reads attribute from TokenReader, see AttributeVoid 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.
Reimplemented from faudes::AttributeVoid. Reimplemented in faudes::AttributeCFlags, faudes::SimEventAttribute, faudes::AttributeTimedTrans, and faudes::AttributeTimedState. Definition at line 144 of file attributes.cpp. |
|
Write to TokenWriter, see AttributeVoid 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.
Reimplemented from faudes::AttributeVoid. Reimplemented in faudes::AttributeCFlags, faudes::SimEventAttribute, faudes::AttributeTimedTrans, and faudes::AttributeTimedState. Definition at line 132 of file attributes.cpp. |
|
Test for default value.
Reimplemented from faudes::AttributeVoid. Reimplemented in faudes::AttributeCFlags, faudes::SimEventAttribute, faudes::AttributeTimedTrans, and faudes::AttributeTimedState. Definition at line 293 of file attributes.h. |
|
Set multiple flags.
Definition at line 283 of file attributes.h. |
|
Test a flag.
Definition at line 263 of file attributes.h. |
|
Test multible flags, combine by "and".
Definition at line 268 of file attributes.h. |
|
Test multible flags, combine by "not or".
Definition at line 278 of file attributes.h. |
|
Test multible flags, combine by "or".
Definition at line 273 of file attributes.h. |
|
Definition at line 299 of file attributes.h. |
|
Flags (public access for convenience).
Definition at line 293 of file attributes.h. |