#include <cfl_basevector.h>

Public Types

typedef std::vector< int >::size_type Position
 
- Public Types inherited from faudes::vBaseVector
typedef size_t Position
 

Public Member Functions

 TBaseVector (void)
 
 TBaseVector (const TBaseVector &rOtherSet)
 
 TBaseVector (const vBaseVector &rOtherSet)
 
 TBaseVector (const std::string &rFilename, const std::string &rLabel="BaseVector")
 
virtual ~TBaseVector (void)
 
virtual const T * Elementp (void) const
 
virtual bool ElementTry (const Type &rElement) const
 
virtual const T & At (const Position &pos) const
 
virtual T & At (const Position &pos)
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::vBaseVector
 vBaseVector (void)
 
 vBaseVector (const vBaseVector &rOtherVector)
 
 vBaseVector (const std::string &rFilename, const std::string &rLabel="BaseVector")
 
virtual ~vBaseVector (void)
 
virtual const TypeElement (void) const
 
virtual TypeNewElement (void)
 
const std::string & Name (void) const
 
void Name (const std::string &rName)
 
virtual void Clear (void)
 
Idx Size (void) const
 
void Size (Idx len)
 
bool Empty (void) const
 
virtual void Replace (const Position &pos, const Type &rElem)
 
virtual void Replace (const Position &pos, Type *pElem)
 
virtual void Replace (const Position &pos, const std::string &rFileName)
 
virtual void Erase (const Position &pos)
 
virtual void Insert (const Position &pos, const Type &rElem)
 
virtual void Insert (const Position &pos, Type *rElem)
 
virtual void Insert (const Position &pos, const std::string &rFileName)
 
virtual void PushBack (const Type &rElem)
 
virtual void PushBack (Type *rElem)
 
virtual void PushBack (const std::string &rFileName)
 
virtual void Append (const Type &rElem)
 
virtual void Append (Type *rElem)
 
virtual void Append (const std::string &rFileName)
 
virtual Position Find (const Type &rElem)
 
void FilenameAt (const Position &pos, const std::string &rFileName)
 
const std::string & FilenameAt (const Position &pos) const
 
void TakeOwnership (void)
 
void TakeCopies (void)
 
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 DoAssign (const TBaseVector< T > &rSourceVector)
 
- Protected Member Functions inherited from faudes::vBaseVector
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoSWrite (TokenWriter &rTw) const
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
void DoAssign (const vBaseVector &rSourceVector)
 
- 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 const TypeDefinitionTypeDefinitionp (void) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Additional Inherited Members

- Protected Types inherited from faudes::vBaseVector
typedef std::vector< ElementRecord >::iterator iterator
 
- Protected Attributes inherited from faudes::vBaseVector
std::vector< ElementRecordmVector
 

Detailed Description

template<class T>
class faudes::TBaseVector< T >

Vector template.

The vector templates specializes the bass vBaseVector in that it uses the template parameter to specify the type of its entries. See vBaseVector for element access methods.

TVectorSet serves is used to implement the libFaudes vectors

  • GeneratorVector (vector or generators)
  • SytemVector (vector or generators)
  • EventSetVector (vector of event sets)
  • AlphabetVector (vector of event sets)

Definition at line 577 of file cfl_basevector.h.

Member Typedef Documentation

◆ Position

template<class T >
typedef std::vector<int>::size_type faudes::TBaseVector< T >::Position

convenience typedef for positions

Definition at line 650 of file cfl_basevector.h.

Constructor & Destructor Documentation

◆ TBaseVector() [1/4]

template<class T >
faudes::TBaseVector< T >::TBaseVector ( void  )

Constructor.

Definition at line 707 of file cfl_basevector.h.

◆ TBaseVector() [2/4]

template<class T >
faudes::TBaseVector< T >::TBaseVector ( const TBaseVector< T > &  rOtherSet)

Copy-constructor.

Parameters
rOtherSetSource to copy from

Definition at line 725 of file cfl_basevector.h.

◆ TBaseVector() [3/4]

template<class T >
faudes::TBaseVector< T >::TBaseVector ( const vBaseVector rOtherSet)

Copy-constructor. This version takes any vector as source, but throughs an exception, if element types dont match.

Parameters
rOtherSetSource to copy from
Exceptions
Exception
  • Cannot cast elements (63)

Definition at line 733 of file cfl_basevector.h.

◆ TBaseVector() [4/4]

template<class T >
faudes::TBaseVector< T >::TBaseVector ( const std::string &  rFilename,
const std::string &  rLabel = "BaseVector" 
)

Constructor from file.

Parameters
rFilenameName of File
rLabelSection for the set in the file;

Definition at line 715 of file cfl_basevector.h.

◆ ~TBaseVector()

template<class T >
faudes::TBaseVector< T >::~TBaseVector ( void  )
virtual

Virtual destructor

Definition at line 741 of file cfl_basevector.h.

Member Function Documentation

◆ At() [1/2]

template<class T >
T & faudes::TBaseVector< T >::At ( const Position pos)
virtual

Access element.

Parameters
posSpecify entry to access
Exceptions
Exception
  • Position out of range (id 69)

Reimplemented from faudes::vBaseVector.

Definition at line 788 of file cfl_basevector.h.

◆ At() [2/2]

template<class T >
const T & faudes::TBaseVector< T >::At ( const Position pos) const
virtual

Access element.

Parameters
posSpecify entry to access
Exceptions
Exception
  • Position out of range (id 69)

Reimplemented from faudes::vBaseVector.

Definition at line 769 of file cfl_basevector.h.

◆ DoAssign()

template<class T >
void faudes::TBaseVector< T >::DoAssign ( const TBaseVector< T > &  rSourceVector)
protected

Assignment method

Definition at line 760 of file cfl_basevector.h.

◆ Elementp()

template<class T >
const T * faudes::TBaseVector< T >::Elementp ( void  ) const
virtual

Prototype for vector entries. This template class uses the virtual function to know its element type.

Returns
Element protoype

Reimplemented from faudes::vBaseVector.

Definition at line 747 of file cfl_basevector.h.

◆ ElementTry()

template<class T >
bool faudes::TBaseVector< T >::ElementTry ( const Type rElement) const
virtual

Test whether the specified element is acceptebla for this vector. This is a convenience wrapper for Elementp.

Parameters
rElementElement to type check.
Returns
True, if provided element is accepted by this vector.

Reimplemented from faudes::vBaseVector.

Definition at line 753 of file cfl_basevector.h.

◆ operator!=()

template<class T >
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 83 of file cfl_types.cpp.

◆ operator=()

template<class T >
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 81 of file cfl_types.cpp.

◆ operator==()

template<class T >
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 82 of file cfl_types.cpp.


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

libFAUDES 2.33b --- 2025.05.07 --- c++ api documentaion by doxygen