CLAM::FlagsBase Class Reference

Abstract class from which any Flag<N> instantiation is derived. More...

#include <Flags.hxx>

List of all members.

Classes

struct  tFlagValue
 The type of the name table rows. More...

Public Types

typedef unsigned int tValue
 The type of the positional indexes.

Public Member Functions

virtual unsigned int GetNFlags () const =0
virtual void SetFlag (unsigned int whichOne, bool value)=0
virtual bool IsSetFlag (unsigned int whichOne) const =0
std::string GetFlagString (unsigned int whichOne) const throw (IllegalValue)
 Retrieves the name of the flag at a position.
unsigned int GetFlagPosition (const std::string &whichOne) const throw (IllegalValue)
 Retrieves the position of the named flag.
virtual void StoreOn (Storage &storage) const
 Stores component's subitems on the given Storage.
virtual void LoadFrom (Storage &storage)
 Loads component's subitems from the given Storage.
bool CheckInvariant ()
 Checks that the object is internally consistent.

Protected Attributes

const tFlagValuemFlagValues
 A pointer to the user specific flag class table of value-symbol pairs for the flag.

Detailed Description

Abstract class from which any Flag<N> instantiation is derived.

It provides some clever pure virtual functions and shared implementations for the symbol managing.

Definition at line 40 of file Flags.hxx.


Member Typedef Documentation

The type of the positional indexes.

Definition at line 44 of file Flags.hxx.


Member Function Documentation

bool FlagsBase::CheckInvariant (  )  [inline]

Checks that the object is internally consistent.

It tests that:

  • the names array is not a NULL pointer (it still could be invalid)
  • the names array is shorter than the number of flags plus one for the NULL name
  • a NULL name is present at the end of the names array
  • the names array has no value replication
  • the names array has no name replication
    Todo:
    TODO: Check blanks in names

It tests that:

  • the names array is not a NULL pointer (it still could be invalid)
  • the names array is shorter than the number of flags plus one for the NULL name
  • a NULL name is present at the end of the names array
  • the names array has no value replication
  • the names array has no name replication
    Todo:
    TODO: Check blanks in names

Definition at line 167 of file Flags.cxx.

References GetNFlags(), mFlagValues, CLAM::FlagsBase::tFlagValue::name, and CLAM::FlagsBase::tFlagValue::value.

unsigned int FlagsBase::GetFlagPosition ( const std::string &  whichOne  )  const throw (IllegalValue)

Retrieves the position of the named flag.

Parameters:
whichOne The string containing the simbolic name
Returns:
The symbolic name of the selected flag as stream

Definition at line 55 of file Flags.cxx.

Referenced by LoadFrom(), and CLAM::operator>>().

std::string FlagsBase::GetFlagString ( unsigned int  whichOne  )  const throw (IllegalValue)

Retrieves the name of the flag at a position.

Parameters:
whichOne The position of the selected flag
Returns:
The symbolic name of the selected flag as stream

Definition at line 42 of file Flags.cxx.

Referenced by CLAM::operator<<(), and StoreOn().

virtual unsigned int CLAM::FlagsBase::GetNFlags (  )  const [pure virtual]
Returns:
the number of flags contained

Implemented in CLAM::Flags< N >, and CLAM::Flags< 4 >.

Referenced by CheckInvariant(), LoadFrom(), CLAM::operator<<(), CLAM::operator>>(), and StoreOn().

virtual bool CLAM::FlagsBase::IsSetFlag ( unsigned int  whichOne  )  const [pure virtual]

Implemented in CLAM::Flags< N >, and CLAM::Flags< 4 >.

Referenced by CLAM::operator<<(), and StoreOn().

void FlagsBase::LoadFrom ( Storage storage  )  [virtual]

Loads component's subitems from the given Storage.

Parameters:
storage The given storage where the subitem will be loaded from
See also:
Storage

Implements CLAM::Component.

Definition at line 85 of file Flags.cxx.

References GetFlagPosition(), GetNFlags(), CLAM::Storage::Load(), and SetFlag().

virtual void CLAM::FlagsBase::SetFlag ( unsigned int  whichOne,
bool  value 
) [pure virtual]

Implemented in CLAM::Flags< N >, and CLAM::Flags< 4 >.

Referenced by LoadFrom(), and CLAM::operator>>().

void FlagsBase::StoreOn ( Storage storage  )  const [virtual]

Stores component's subitems on the given Storage.

Parameters:
storage The given storage where the subitem will be stored
See also:
Storage

Implements CLAM::Component.

Definition at line 70 of file Flags.cxx.

References GetFlagString(), GetNFlags(), IsSetFlag(), and CLAM::Storage::Store().


Member Data Documentation

A pointer to the user specific flag class table of value-symbol pairs for the flag.

Definition at line 54 of file Flags.hxx.

Referenced by CheckInvariant(), and CLAM::Flags< 4 >::Flags().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3