Detailed Description

Elementary type.

Definition at line 396 of file cfl_elementary.h.

#include <cfl_elementary.h>

Public Member Functions

 Boolean (void)
 Constructor. More...
 
 Boolean (bool val)
 Constructor provided with initial value. More...
 
 ~Boolean (void)
 Destructor. More...
 
virtual BooleanNew (void) const
 Construct on heap. More...
 
virtual BooleanCopy (void) const
 Construct copy on heap. More...
 
virtual const BooleanCast (const Type *pOther) const
 Cast the other object to Boolean. More...
 
void CValue (bool val)
 Set value. More...
 
bool CValue (void) const
 Get value. More...
 
bool * CReference (void)
 Get reference. More...
 
Booleanoperator= (const bool &bbool)
 Assignment operator. More...
 
Booleanoperator= (const Boolean &cobool)
 Assignment operator. More...
 
 operator bool () const
 Conversion to C++ type bool. More...
 
void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write data to Tokenwriter. More...
 
void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read data from TokenReader. More...
 
Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual void Clear (void)
 Clear configuration data. More...
 
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
bool operator!= (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void Name (const std::string &rName)
 Set the objects's name. More...
 
virtual const std::string & Name (void) const
 Get objects's name. More...
 
virtual const std::string & TypeName (void) const
 Get objects's type name. More...
 
void Write (const Type *pContext=0) const
 Write configuration data to console. More...
 
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
 Write configuration data to a file. More...
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file. More...
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter. More...
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file. More...
 
void XWrite (const Type *pContext=0) const
 Write configuration data in XML format to concole Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes. More...
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter. More...
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string. More...
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string. More...
 
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format. More...
 
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
 Write configuration data to a file, debugging format. More...
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter. More...
 
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter. More...
 
void SWrite (void) const
 Write statistics comment to console. More...
 
std::string ToSText (void) const
 Write statistics to a string. More...
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified. More...
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string. More...
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified. More...
 

Protected Attributes

bool mCBool
 Variable to store current value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
bool DoEqual (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data of this object to TokenWriter in XML format. More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debugging format to TokenWriter. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Write statistical data as a comment to TokenWriter. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Get objects's type definition. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Constructor & Destructor Documentation

◆ Boolean() [1/2]

faudes::Boolean::Boolean ( void  )

Constructor.

Definition at line 218 of file cfl_elementary.cpp.

◆ Boolean() [2/2]

faudes::Boolean::Boolean ( bool  val)

Constructor provided with initial value.

Parameters
valInitial value. (bool)

Definition at line 223 of file cfl_elementary.cpp.

◆ ~Boolean()

faudes::Boolean::~Boolean ( void  )
inline

Destructor.

Definition at line 414 of file cfl_elementary.h.

Member Function Documentation

◆ Cast()

const Boolean * faudes::Boolean::Cast ( const Type pOther) const
virtual

Cast the other object to Boolean.

Returns NULL if the cast is not possible.

Parameters
pOtherPointer to object to cast.
Returns
Pointer to Boolean instance, or NULL

Reimplemented from faudes::Type.

Definition at line 238 of file cfl_elementary.cpp.

◆ Copy()

Boolean * faudes::Boolean::Copy ( void  ) const
virtual

Construct copy on heap.

Create new Boolean instance and return pointer.

Returns
Pointer to Boolean instance.

Reimplemented from faudes::Type.

Definition at line 233 of file cfl_elementary.cpp.

◆ CReference()

bool * faudes::Boolean::CReference ( void  )

Get reference.

Returns
Reference to c value.

Definition at line 253 of file cfl_elementary.cpp.

◆ CValue() [1/2]

void faudes::Boolean::CValue ( bool  val)

Set value.

Parameters
valValue to be set.

Definition at line 243 of file cfl_elementary.cpp.

◆ CValue() [2/2]

bool faudes::Boolean::CValue ( void  ) const

Get value.

Returns
Value of object. (bool)

Definition at line 248 of file cfl_elementary.cpp.

◆ DoRead()

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

Read data from TokenReader.

NOTE: 0 = false 1 = true

Parameters
rTrReference to TokenReader.
rLabelSection to read.
pContextRead context to provide contextual information (ignored)
Exceptions
Exception
  • Token mismatch
  • IO Error

Reimplemented from faudes::Type.

Definition at line 275 of file cfl_elementary.cpp.

◆ DoWrite()

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

Write data to Tokenwriter.

NOTE: 0 = false 1 = true

Parameters
rTwReference to TokenWriter.
rLabelLabel of section to write.
pContextWrite context to provide contextual information (ignored)
Exceptions
Exception
  • IO Error

Reimplemented from faudes::Type.

Definition at line 258 of file cfl_elementary.cpp.

◆ New()

Boolean * faudes::Boolean::New ( void  ) const
virtual

Construct on heap.

Create new Boolean instance and return pointer.

NOTE: Calling function takes control.

Returns
Pointer to Boolean instance.

Reimplemented from faudes::Type.

Definition at line 228 of file cfl_elementary.cpp.

◆ operator bool()

faudes::Boolean::operator bool ( ) const
inline

Conversion to C++ type bool.

Definition at line 494 of file cfl_elementary.h.

◆ operator=() [1/3]

Boolean& faudes::Boolean::operator= ( const bool &  bbool)
inline

Assignment operator.

Definition at line 477 of file cfl_elementary.h.

◆ operator=() [2/3]

Boolean& faudes::Boolean::operator= ( const Boolean cobool)
inline

Assignment operator.

Definition at line 485 of file cfl_elementary.h.

◆ operator=() [3/3]

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 340 of file cfl_types.cpp.

Member Data Documentation

◆ mCBool

bool faudes::Boolean::mCBool
protected

Variable to store current value.

Definition at line 538 of file cfl_elementary.h.


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

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen