#include <cfl_types.h>

Public Member Functions

 Documentation (void)
 
 Documentation (const Documentation &rOther)
 
virtual ~Documentation (void)
 
void Clear (void)
 
const std::string & Name (void) const
 
const std::string & PlugIn (void) const
 
const std::string & CType (void) const
 
const std::string & TextDoc (void) const
 
const std::string & HtmlDoc (void) const
 
const std::string & Keywords (void) const
 
std::string MatchKeyword (const std::string &rPattern) const
 
int KeywordsSize (void) const
 
std::string KeywordAt (int pos) const
 
bool AutoRegistered (void) const
 
bool ApplicationRegistered (void) const
 
virtual void MergeDocumentation (TokenReader &rTr)
 
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 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)
 

Protected Member Functions

void Name (const std::string &name)
 
void PlugIn (const std::string &plugin)
 
void CType (const std::string &name)
 
void TextDoc (const std::string &textdoc)
 
void AutoRegistered (bool flag)
 
void ApplicationRegistered (bool flag)
 
void HtmlDoc (const std::string &fname)
 
void AddKeyword (const std::string &rKeyword)
 
void DoAssign (const Documentation &rSrc)
 
bool DoEqual (const Documentation &rOther) const
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
virtual void DoReadCore (TokenReader &rTr)
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoWriteCore (TokenWriter &rTw) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoSWrite (TokenWriter &rTw) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Protected Attributes

std::string mName
 
std::string mPlugIn
 
std::string mCType
 
std::string mTextDoc
 
std::string mHtmlDoc
 
std::string mKeywords
 
bool mAutoRegistered
 
bool mApplicationRegistered
 

Static Protected Attributes

static const char mDelim = ';'
 

Detailed Description

Structure to hold documentation data relating to a faudes-type or -function. This class is the common base for faudes::TypeDefinition and faudes::FunctionDefinition. It supports token io as demonstrated by the follwoing example for a type defintion:

<TypeDefinition name="CoreFaudes::Generator" ctype="faudes::Generator">
<Documentation ref="generators.html#plain">
The common 5 tuple G=(Sigma, Q, delta, Qo, Qm).
<Keywords> "generator" "language" </Keywords>
</TypeDefinition>
const std::string & Keywords(void) const
Definition: cfl_types.cpp:402

Technical detail: Documentation is derived from Type for the purpose of token IO. We still implement the faudes type interface to make it a fully qualified faudes data type.

Technical detail: To facilitate inheritance, token io of member data and token io of the section tags is separated.

Definition at line 1029 of file cfl_types.h.

Constructor & Destructor Documentation

◆ Documentation() [1/2]

faudes::Documentation::Documentation ( void  )

Constructor

Definition at line 353 of file cfl_types.cpp.

◆ Documentation() [2/2]

faudes::Documentation::Documentation ( const Documentation rOther)

Copy constructor

Definition at line 359 of file cfl_types.cpp.

◆ ~Documentation()

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

Destructor

Definition at line 1048 of file cfl_types.h.

Member Function Documentation

◆ AddKeyword()

void faudes::Documentation::AddKeyword ( const std::string &  rKeyword)
protected

Append keyword.

Parameters
rKeywordKeyword

Definition at line 416 of file cfl_types.cpp.

◆ ApplicationRegistered() [1/2]

void faudes::Documentation::ApplicationRegistered ( bool  flag)
protected

Set application-registered flag.

See also AutoRegistered(void)

Parameters
flagFlag value.

Definition at line 413 of file cfl_types.cpp.

◆ ApplicationRegistered() [2/2]

bool faudes::Documentation::ApplicationRegistered ( void  ) const

Get application-registered flag.

Returns
True <> registered by application

Definition at line 404 of file cfl_types.cpp.

◆ AutoRegistered() [1/2]

void faudes::Documentation::AutoRegistered ( bool  flag)
protected

Set auto-register flag.

See also AutoRegistered(void)

Parameters
flagFlag value.

Definition at line 412 of file cfl_types.cpp.

◆ AutoRegistered() [2/2]

bool faudes::Documentation::AutoRegistered ( void  ) const

Get auto-register flag.

This flag indicated that the respective type was (will be) registered by a libFAUDES static initialisation protorype.

Returns
True <> C++-automatic-registration

Definition at line 403 of file cfl_types.cpp.

◆ Clear()

void faudes::Documentation::Clear ( void  )
virtual

Clear

Reimplemented from faudes::Type.

Reimplemented in faudes::TypeDefinition, and faudes::LuaFunctionDefinition.

Definition at line 385 of file cfl_types.cpp.

◆ CType() [1/2]

void faudes::Documentation::CType ( const std::string &  name)
protected

Set C++ type

Parameters
nameNew ctype.

Definition at line 409 of file cfl_types.cpp.

◆ CType() [2/2]

const std::string & faudes::Documentation::CType ( void  ) const

Get corresponding C++ type

Returns
CType, or "" if no such

Definition at line 399 of file cfl_types.cpp.

◆ DoAssign()

void faudes::Documentation::DoAssign ( const Documentation rSrc)
protected

Std faudes type interface: assignment.

Parameters
rSrcSource to copy from

Definition at line 364 of file cfl_types.cpp.

◆ DoEqual()

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

Std faudes type interface: test equality

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

Definition at line 374 of file cfl_types.cpp.

◆ DoRead()

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

Read configuration data of this object from TokenReader.

This virtual function reads documentation from a token stream. The section defaults to Documentation. It invokes DoReadCore to do the member data token reading.

Parameters
rTrTokenReader to read from
rLabelSection to read
pContextRead context to provide contextual information (ignored)
Exceptions
Exception
  • Token mismatch (id 50, 51, 52)
  • IO Error (id 1)

Reimplemented from faudes::Type.

Reimplemented in faudes::TypeDefinition, faudes::FunctionDefinition, and faudes::LuaFunctionDefinition.

Definition at line 514 of file cfl_types.cpp.

◆ DoReadCore()

void faudes::Documentation::DoReadCore ( TokenReader rTr)
protectedvirtual

Read configuration data of this object from TokenReader.

This virtual function reads documentation member data only. It does NOT read the enclosing begin and end tokens.

Parameters
rTrTokenReader to read from
Exceptions
Exception
  • Token mismatch (id 50, 51, 52)
  • IO Error (id 1)

Reimplemented in faudes::TypeDefinition, faudes::FunctionDefinition, and faudes::LuaFunctionDefinition.

Definition at line 565 of file cfl_types.cpp.

◆ DoWrite()

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

Write configuration data of this object to TokenWriter.

This virtual function writes documentation to a token stream. The section defaults to Documentation. It invokes DoWriteCore to do the actual member data writing.

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::TypeDefinition, faudes::FunctionDefinition, and faudes::LuaFunctionDefinition.

Definition at line 643 of file cfl_types.cpp.

◆ DoWriteCore()

void faudes::Documentation::DoWriteCore ( TokenWriter rTw) const
protectedvirtual

Write configuration data of this object to TokenWriter.

This virtual function reads documentation members only. It does NOT write enclosing begin and end tokens.

Parameters
rTwReference to TokenWriter
Exceptions
Exception
  • IO errors (id 2)

Reimplemented in faudes::TypeDefinition, faudes::FunctionDefinition, and faudes::LuaFunctionDefinition.

Definition at line 668 of file cfl_types.cpp.

◆ HtmlDoc() [1/2]

void faudes::Documentation::HtmlDoc ( const std::string &  fname)
protected

Set name of file pointing to the html documentation.

Parameters
fnameFilename

Definition at line 411 of file cfl_types.cpp.

◆ HtmlDoc() [2/2]

const std::string & faudes::Documentation::HtmlDoc ( void  ) const
Returns
Filename pointing to the html documentation.

Definition at line 401 of file cfl_types.cpp.

◆ KeywordAt()

std::string faudes::Documentation::KeywordAt ( int  pos) const
Parameters
posPosition of keyword
Returns
Keyword at specified position (or "" if pos out of range)

Definition at line 453 of file cfl_types.cpp.

◆ Keywords()

const std::string & faudes::Documentation::Keywords ( void  ) const
Returns
CSV-string containing keywords.

Definition at line 402 of file cfl_types.cpp.

◆ KeywordsSize()

int faudes::Documentation::KeywordsSize ( void  ) const

Not implemented

Returns
Number of keywords.

Definition at line 477 of file cfl_types.cpp.

◆ MatchKeyword()

std::string faudes::Documentation::MatchKeyword ( const std::string &  rPattern) const

Search comma-seperated keywords for a substring. This should be extended to regular expressions in a future release.

Parameters
rPatternString-pattern.
Returns
Matching keyword or "" if no match

Definition at line 426 of file cfl_types.cpp.

◆ MergeDocumentation()

void faudes::Documentation::MergeDocumentation ( TokenReader rTr)
virtual

Merge documentation from token stream. An exception is thrown if the current type name differs from the one in the documentation.

Parameters
rTrTokenReader to read from.
Exceptions
Exception
  • Type mismatch (id )
  • Token mismatch (id 50, 51, 52)
  • IO Error (id 1)

Definition at line 492 of file cfl_types.cpp.

◆ Name() [1/2]

void faudes::Documentation::Name ( const std::string &  name)
protectedvirtual

Set name.

Parameters
nameNew name.

Reimplemented from faudes::Type.

Definition at line 407 of file cfl_types.cpp.

◆ Name() [2/2]

const std::string & faudes::Documentation::Name ( void  ) const
virtual

Get name of the entety to document (aka faudes-type or faudes-function).

Returns
Name

Reimplemented from faudes::Type.

Definition at line 397 of file cfl_types.cpp.

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

◆ PlugIn() [1/2]

void faudes::Documentation::PlugIn ( const std::string &  plugin)
protected

Set name of plugin

Parameters
pluginNew name.

Definition at line 408 of file cfl_types.cpp.

◆ PlugIn() [2/2]

const std::string & faudes::Documentation::PlugIn ( void  ) const

Get name of plugin. The plugin name defaults to CoreFaudes.

Returns
Name

Definition at line 398 of file cfl_types.cpp.

◆ TextDoc() [1/2]

void faudes::Documentation::TextDoc ( const std::string &  textdoc)
protected

Set a short textual documentation.

Parameters
textdocNew textual documentation.

Definition at line 410 of file cfl_types.cpp.

◆ TextDoc() [2/2]

const std::string & faudes::Documentation::TextDoc ( void  ) const
Returns
Short textual documentation.

Definition at line 400 of file cfl_types.cpp.

Member Data Documentation

◆ mApplicationRegistered

bool faudes::Documentation::mApplicationRegistered
protected

Flag to indicate application registration

Definition at line 1345 of file cfl_types.h.

◆ mAutoRegistered

bool faudes::Documentation::mAutoRegistered
protected

Flag to indicate automated registration

Definition at line 1342 of file cfl_types.h.

◆ mCType

std::string faudes::Documentation::mCType
protected

Corresponing C++ type, or "" if no such.

Definition at line 1327 of file cfl_types.h.

◆ mDelim

const char faudes::Documentation::mDelim = ';'
staticprotected

Constant characted used to seperate keywords

Definition at line 1339 of file cfl_types.h.

◆ mHtmlDoc

std::string faudes::Documentation::mHtmlDoc
protected

String containing the filename of the corresponding html-documentation.

Definition at line 1333 of file cfl_types.h.

◆ mKeywords

std::string faudes::Documentation::mKeywords
protected

Comma-seperated string containing all keywords.

Definition at line 1336 of file cfl_types.h.

◆ mName

std::string faudes::Documentation::mName
protected

Faudes name.

Definition at line 1321 of file cfl_types.h.

◆ mPlugIn

std::string faudes::Documentation::mPlugIn
protected

Faudes plugin.

Definition at line 1324 of file cfl_types.h.

◆ mTextDoc

std::string faudes::Documentation::mTextDoc
protected

String containing the text-documentation.

Definition at line 1330 of file cfl_types.h.


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

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