faudes::AttributeFlags Class Reference

#include <attributes.h>

Inheritance diagram for faudes::AttributeFlags:

faudes::AttributeVoid faudes::AttributeCFlags List of all members.

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 122 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.
virtual void Write (TokenWriter &rTw) const
 Write attribute value to tokenreader.
virtual void Write (void) const
 Write attribute value to console.
virtual void Read (TokenReader &rTr)
 Read attributes from tokenreader.
virtual std::string ToString (void) const
 Write attribute value to string.
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


Constructor & Destructor Documentation

faudes::AttributeFlags::AttributeFlags void   )  [inline]
 

Default constructor.

Definition at line 126 of file attributes.h.

virtual faudes::AttributeFlags::~AttributeFlags void   )  [inline, virtual]
 

Destructor.

Definition at line 129 of file attributes.h.


Member Function Documentation

void faudes::AttributeFlags::Clr fType  mask  )  [inline]
 

Clear multiple flags.

Definition at line 159 of file attributes.h.

bool faudes::AttributeFlags::IsDefault void   )  const [inline]
 

Test for default value.

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeCFlags.

Definition at line 205 of file attributes.h.

void faudes::AttributeFlags::Read TokenReader rTr  )  [virtual]
 

Read attributes from tokenreader.

If the naxt token is a hex integer, read it and interpret as flag word. If not, do nothing (dont flush tokens, dont throw errors)

Parameters:
rTr tokenreader to read from
Exceptions:
Exception 
  • IO error (id 1)

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeCFlags.

Definition at line 93 of file attributes.cpp.

void faudes::AttributeFlags::Set fType  mask  )  [inline]
 

Set multiple flags.

Definition at line 154 of file attributes.h.

bool faudes::AttributeFlags::Test fType  mask  )  const [inline]
 

Test a flag.

Definition at line 134 of file attributes.h.

bool faudes::AttributeFlags::TestAll fType  mask  )  const [inline]
 

Test multible flags, combine by "and".

Definition at line 139 of file attributes.h.

bool faudes::AttributeFlags::TestNone fType  mask  )  const [inline]
 

Test multible flags, combine by "not or".

Definition at line 149 of file attributes.h.

bool faudes::AttributeFlags::TestSome fType  mask  )  const [inline]
 

Test multible flags, combine by "or".

Definition at line 144 of file attributes.h.

virtual std::string faudes::AttributeFlags::ToString void   )  const [inline, virtual]
 

Write attribute value to string.

Returns:
string representation of attribute value

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeCFlags.

Definition at line 200 of file attributes.h.

void faudes::AttributeFlags::Write void   )  const [virtual]
 

Write attribute value to console.

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeCFlags.

Definition at line 86 of file attributes.cpp.

void faudes::AttributeFlags::Write TokenWriter rTw  )  const [virtual]
 

Write attribute value to tokenreader.

Parameters:
rTw TokenWriter to write to
Exceptions:
Exception 
  • IO error (id 2)

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeCFlags.

Definition at line 77 of file attributes.cpp.


Member Data Documentation

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

Definition at line 211 of file attributes.h.

fType faudes::AttributeFlags::mFlags
 

Flags (public access for convenience).

Definition at line 205 of file attributes.h.


The documentation for this class was generated from the following files:
Generated on Fri May 9 11:26:48 2008 for libFAUDES 2.09b by  doxygen 1.4.4