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 628 of file cfl_basevector.h.

#include <cfl_basevector.h>

Classes

class  CIterator
 
class  Iterator
 

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)
 
Iterator Begin (void)
 
CIterator Begin (void) const
 
Iterator End (void)
 
CIterator End (void) const
 
virtual void Insert (const T &rElem)
 
virtual Iterator Erase (const Iterator &vit)
 
virtual void Insert (const Position &pos, const Type &rElem)
 
virtual void Insert (const Position &pos, Type *pElem)
 
virtual void Insert (const Position &pos, const std::string &rFileName)
 
virtual void Erase (const Position &pos)
 
- Public Member Functions inherited from faudes::vBaseVector
 vBaseVector (void)
 
 vBaseVector (const vBaseVector &rOtherVector)
 
 vBaseVector (const std::string &rFilename, const std::string &rLabel="Vector")
 
virtual ~vBaseVector (void)
 
void AssignByReference (vBaseVector &rSourceVector)
 
virtual const TypeElement (void) const
 
virtual TypeNewElement (void)
 
virtual void Clear (void)
 
Idx Size (void) const
 
void Size (Idx len)
 
bool IsDefault (void) const
 
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 *pElem)
 
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)
 
virtual void EraseDoublets (void)
 
void FilenameAt (const Position &pos, const std::string &rFileName)
 
const std::string & FilenameAt (const Position &pos) const
 
void TakeOwnership (void)
 
void TakeCopies (void)
 
- Public Member Functions inherited from faudes::ExtType
 ExtType (void)
 
 ExtType (const ExtType &rType)
 
virtual ~ExtType (void)
 
const std::string & Name (void) const
 
void Name (const std::string &rName)
 
virtual const std::string & TypeName (void) const
 
virtual void TypeName (const std::string &rType)
 
virtual const std::string & ElementTag (void) const
 
virtual void ElementTag (const std::string &rTag)
 
virtual const std::string & ElementType (void) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::AttrType
 AttrType (void)
 
 AttrType (const AttrType &rSrc)
 
virtual ~AttrType (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
 
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 DoXWrite (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)
 
bool DoEqual (const vBaseVector &rOther) const
 
- Protected Member Functions inherited from faudes::AttrType
void DoAssign (const AttrType &rSrc)
 
bool DoEqual (const AttrType &rOther) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Additional Inherited Members

- Static Public Member Functions inherited from faudes::AttrType
static void Skip (TokenReader &rTr)
 
- Protected Types inherited from faudes::vBaseVector
typedef std::vector< ElementRecord >::iterator iterator
 
- Protected Attributes inherited from faudes::vBaseVector
std::vector< ElementRecordmVector
 
std::string mElementTagDef
 
- Protected Attributes inherited from faudes::ExtType
std::string mElementType
 
std::string mElementTagDef
 
std::string mObjectName
 

Member Typedef Documentation

◆ Position

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

convenience typedef for positions

Definition at line 703 of file cfl_basevector.h.

Constructor & Destructor Documentation

◆ TBaseVector() [1/4]

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

Constructor.

Definition at line 868 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 886 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 894 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 876 of file cfl_basevector.h.

◆ ~TBaseVector()

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

Virtual destructor

Definition at line 902 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 949 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 930 of file cfl_basevector.h.

◆ Begin() [1/2]

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

Iterator to the begin of set

Returns
Iterator

Definition at line 969 of file cfl_basevector.h.

◆ Begin() [2/2]

template<class T >
TBaseVector< T >::CIterator faudes::TBaseVector< T >::Begin ( void  ) const

Iterator to the begin of set, const variant

Returns
Iterator

Definition at line 970 of file cfl_basevector.h.

◆ DoAssign()

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

Assignment method

Definition at line 921 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 908 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 914 of file cfl_basevector.h.

◆ End() [1/2]

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

Iterator to the end of set

Returns
Iterator

Definition at line 971 of file cfl_basevector.h.

◆ End() [2/2]

template<class T >
TBaseVector< T >::CIterator faudes::TBaseVector< T >::End ( void  ) const

Iterator to the end of set, const variant

Returns
Iterator

Definition at line 972 of file cfl_basevector.h.

◆ Erase() [1/2]

template<class T >
TBaseVector< T >::Iterator faudes::TBaseVector< T >::Erase ( const Iterator vit)
virtual

Erase specified entry.

Parameters
vitIterator to element to erase

Definition at line 976 of file cfl_basevector.h.

◆ Erase() [2/2]

template<class T >
void faudes::vBaseVector::Erase

Erase entry by position. If the vector owns the entry, it will be destructed.

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

Definition at line 288 of file cfl_basevector.cpp.

◆ Insert() [1/4]

template<class T >
void faudes::vBaseVector::Insert ( void  )

Insert specified entry. This method reads the sepcified entry from file and the vector becomes the owner of the new entry.

Parameters
posPosition at which to insert
rFileNameElement to insert
Exceptions
Exception
  • Position out of range (id 69)

Definition at line 332 of file cfl_basevector.cpp.

◆ Insert() [2/4]

template<class T >
void faudes::vBaseVector::Insert ( void  )

Insert specified entry. This method takes a copy of the entry to be inserted and the vector becomes the owner of the copy.

Parameters
posPosition at which to insert
rElemElement to insert
Exceptions
Exception
  • Position out of range (id 69)
  • Cannot cast element type (63)

Definition at line 303 of file cfl_basevector.cpp.

◆ Insert() [3/4]

template<class T >
void faudes::vBaseVector::Insert ( void  )

Insert specified entry. This method avoids to make a copy and inserts only a reference. The caller remains the owner and is responsable for destruction.

Parameters
posPosition at which to insert
rElemElement to insert
Exceptions
Exception
  • Position out of range (id 69)
  • Cannot cast element type (63)

Definition at line 318 of file cfl_basevector.cpp.

◆ Insert() [4/4]

template<class T >
void faudes::TBaseVector< T >::Insert ( const T &  rElem)
virtual

Insert specified entry.

Insert with no position defaults to Append/PushBack

Parameters
posPosition at which to insert
rElemElement to insert
Exceptions
Exception
  • Position out of range (id 69)
  • Cannot cast element type (63)

Definition at line 975 of file cfl_basevector.h.


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

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen