|
|
||||||
|
Classes |
Public Types |
Public Member Functions |
Protected Types |
Protected Member Functions |
Protected Attributes |
Private Attributes |
List of all members
faudes::vBaseVector Class Reference Detailed DescriptionVector bass class. This class is designed as a random access container for a small number of comperatively large objects, eg a vector of generators to model a decentralized DES. The API is restricted to simple positional access and there are no explicit iterators nor is there a deferred copy mechanism. As with other faudes containers, vBaseVector is the universal base class for all faudes vector data types. The latter explicitely refer to the element data type and are implemented as templates. Internally, the vBaseVector template uses STL vector of pointers to the individual entries. When adding an entry, you may either do so be refernce or by pointer. When setting by reference, the vector takes a copy and owns the new entry. When setting by a pointer, the vector only records the reference. The vector tracks ownership of each entry in order to properly destruct entries. vBaseVector serves as a base class for all libFaudes vectors:
Token io assumes that the type parameter is a faudes type, ie. entries of the vector provide token io themselfs. To derive a vector class with non-faudes-type entries, you will need to reimplement token io. As a convenience feature, the vector keeps a record of filenames associated with individual entries. You can inspect and edit this record via the FilenameAt members. When writing the vector to a file and all entries have an associated filename, output will be to the individual files. Definition at line 75 of file cfl_basevector.h.
Member Typedef Documentation◆ iterator
convenience typedef Definition at line 582 of file cfl_basevector.h. ◆ Position
convenience typedef for positions (must be unsigned) Definition at line 210 of file cfl_basevector.h. Constructor & Destructor Documentation◆ vBaseVector() [1/3]
Constructor. Definition at line 49 of file cfl_basevector.cpp. ◆ vBaseVector() [2/3]
Copy-constructor. This will copy the actual elements and we will take ownership of the copies. If the elements are fauddes sets, the performance penalty will only show oncle we write to an element.
Definition at line 73 of file cfl_basevector.cpp. ◆ vBaseVector() [3/3]
Constructor from file.
Definition at line 60 of file cfl_basevector.cpp. ◆ ~vBaseVector()
Virtual destructor Definition at line 81 of file cfl_basevector.cpp. Member Function Documentation◆ Append() [1/3]
Append specified entry. Synonymous for PushBack. This method reads the sepcified entry from file and the vector becomes the owner of the new entry.
Definition at line 429 of file cfl_basevector.cpp. ◆ Append() [2/3]
Append specified entry. Synonymous for PushBack. This method takes a copy of the entry to replace and the vector becomes the owner of the copy.
Definition at line 419 of file cfl_basevector.cpp. ◆ Append() [3/3]
Append specified entry. Synonymous for PushBack. This method avoids to copy the entry to replace and only records the reference. The vector does not take ownership of the new entry. I.e., when the vector is destroyed, or the entry is deleted from the vector, the entry itself remains allocated.
Definition at line 424 of file cfl_basevector.cpp. ◆ AssignByReference()
Assign by reference This method will take references from the source entry, i.e., it will not take copies and will not attain ownership. The caller is hence responsible for the livetime of the elements. To obtain a full copy, use the copy constror or Assign() instead. Definition at line 136 of file cfl_basevector.cpp. ◆ At() [1/2]Access element.
Reimplemented in faudes::TBaseVector< T >, faudes::TBaseVector< EventSet >, faudes::TBaseVector< Generator >, and faudes::TBaseVector< RabinPair >. Definition at line 229 of file cfl_basevector.cpp. ◆ At() [2/2]Access element.
Reimplemented in faudes::TBaseVector< T >, faudes::TBaseVector< EventSet >, faudes::TBaseVector< Generator >, and faudes::TBaseVector< RabinPair >. Definition at line 217 of file cfl_basevector.cpp. ◆ Clear()
Clear all vector Reimplemented from faudes::Type. Definition at line 158 of file cfl_basevector.cpp. ◆ DoAssign()
Assignment method (we will take copies and own all those thereafter) Definition at line 113 of file cfl_basevector.cpp. ◆ DoDWrite()
Token output, debugging see Type::DWrite for public wrappers. The method assumes that the type parameter is a faudes type and uses the provide write method per entry. Reimplement this function in derived classes for non-faudes type vectors.
Reimplemented from faudes::Type. Definition at line 567 of file cfl_basevector.cpp. ◆ DoEqual()
Test equality of configuration data. To be equal, all elements must match.
Definition at line 168 of file cfl_basevector.cpp. ◆ DoRead()
Token input, see Type::Read for public wrappers. The method assumes that the type parameter is a faudes type and uses the provide read method per entry. Reimplement this function in derived classes for non-faudes type vectors. By convention, the default label "" should be translated to some meaningful default, eg "GeneratorVector" for a vector of generators. The pContext pointer can be type-checked and interpreted, ie as a symboltable to provide symbolic names. It is also passed on to vector entries.
Reimplemented from faudes::Type. Definition at line 592 of file cfl_basevector.cpp. ◆ DoSWrite()
Token output, see Type::SWrite for public wrappers. The method assumes that the type parameter is a faudes type and uses the provide write method per entry. Reimplement this function in derived classes for non-faudes type vectors.
Reimplemented from faudes::Type. Reimplemented in faudes::RabinAcceptance. Definition at line 580 of file cfl_basevector.cpp. ◆ DoWrite()
Token output, see Type::Write for public wrappers. The method assumes that the type parameter is a faudes type and uses the provide write method per entry. Reimplement this function in derived classes for non-faudes type vectors.
Reimplemented from faudes::Type. Definition at line 506 of file cfl_basevector.cpp. ◆ DoXWrite()
Token output strict XML, see Type::XWrite for public wrappers. The method assumes that the type parameter is a faudes type and uses the provide writed method per entry. Reimplement this function in derived classes for non-faudes type vectors.
Reimplemented from faudes::Type. Definition at line 537 of file cfl_basevector.cpp. ◆ Element()
Prototype for vector entries. This is a convenience wrapper for Elementp.
Definition at line 98 of file cfl_basevector.cpp. ◆ Elementp()
Prototype for vector entries. The virtual base vBaseVector will provide a plain Type object. Derived vector classes are meant to reimplement this function.
Reimplemented in faudes::TBaseVector< T >, faudes::TBaseVector< EventSet >, faudes::TBaseVector< Generator >, and faudes::TBaseVector< RabinPair >. Definition at line 92 of file cfl_basevector.cpp. ◆ ElementTry()
Test whether the specified element is acceptebla for this vector. This is a convenience wrapper for Elementp.
Reimplemented in faudes::TBaseVector< T >, faudes::TBaseVector< EventSet >, faudes::TBaseVector< Generator >, and faudes::TBaseVector< RabinPair >. Definition at line 108 of file cfl_basevector.cpp. ◆ Empty()
Check if the vBaseVector is Empty (amounts to the default configuration)
Definition at line 212 of file cfl_basevector.cpp. ◆ Erase()
Erase entry by position. If the vector owns the entry, it will be destructed.
Definition at line 302 of file cfl_basevector.cpp. ◆ EraseDoublets()
Cnsolidate by removing doublets. This method iterates through the vector to find ad eliminate semantical doublets; i.e., it refers to equality as implementyed by the faudes type method DoEqual. This is generally inefficient, consider to use an ordered set instead. Definition at line 449 of file cfl_basevector.cpp. ◆ FilenameAt() [1/2]
Get filename of entry.
Definition at line 465 of file cfl_basevector.cpp. ◆ FilenameAt() [2/2]
Specify a filename. When each entry has a filename specified, file io of the vector will be to individual files.
Definition at line 477 of file cfl_basevector.cpp. ◆ Find()
Find element. This method iterates through the vector to find a matching element. This is generally inefficient, consider to use an ordered set instead.
Definition at line 435 of file cfl_basevector.cpp. ◆ Insert() [1/3]
Insert specified entry. This method reads the sepcified entry from file and the vector becomes the owner of the new entry.
Definition at line 361 of file cfl_basevector.cpp. ◆ Insert() [2/3]Insert specified entry. This method takes a copy of the entry to be inserted and the vector becomes the owner of the copy.
Definition at line 317 of file cfl_basevector.cpp. ◆ Insert() [3/3]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.
Definition at line 339 of file cfl_basevector.cpp. ◆ IsDefault()
Check for default configuration aka empty
Reimplemented from faudes::AttrType. Definition at line 207 of file cfl_basevector.cpp. ◆ NewElement()
Factory method for vector entries. This is a convenience wrapper using Elementp.
Definition at line 103 of file cfl_basevector.cpp. ◆ PushBack() [1/3]
Append specified entry. This method reads the sepcified entry from file and the vector becomes the owner of the new entry.
Definition at line 408 of file cfl_basevector.cpp. ◆ PushBack() [2/3]
Append specified entry. This method takes a copy of the entry to replace and the vector becomes the owner of the copy.
Definition at line 380 of file cfl_basevector.cpp. ◆ PushBack() [3/3]
Append specified entry. This method avoids to copy the entry to replace and only records the reference. The vector does not take ownership of the new entry. I.e., when the vector is destroyed, or the entry is deleted from the vector, the entry itself remains allocated.
Definition at line 394 of file cfl_basevector.cpp. ◆ Replace() [1/3]
Replace specified entry. This method reads the sepcified entry from file and the vector becomes the owner of the new entry.
Definition at line 285 of file cfl_basevector.cpp. ◆ Replace() [2/3]Replace specified entry. This method takes a copy of the entry to replace and the vector becomes the owner of the copy.
Definition at line 243 of file cfl_basevector.cpp. ◆ Replace() [3/3]Replace specified entry. This method avoids to copy the entry to replace and only records the reference. The vector does not take ownership of the new entry. I.e., when the vector is destroyed, or the entry is deleted from the vector, the entry itself remains allocated.
Definition at line 264 of file cfl_basevector.cpp. ◆ Size() [1/2]
Set size of vector. If the new size is smaller than the current size, the vector is truncated. If it is larger, default members are inserted at the end.
Definition at line 186 of file cfl_basevector.cpp. ◆ Size() [2/2]
◆ TakeCopies()
Take local copies of all entries. This method will construct local copies of all entries not previously owned. Definition at line 489 of file cfl_basevector.cpp. ◆ TakeOwnership()
Take ownership of all entries. This method will take ownership of all entries, including those, that have been set by pointer reference. When the vector is destructed, all entries will be destructed, too. However, write access may invalidate element pointers. Definition at line 499 of file cfl_basevector.cpp. Member Data Documentation◆ mElementTag
Current/cached name of elements (use protected accessor methods for caching) Definition at line 590 of file cfl_basevector.h. ◆ mElementTagDef
Defauft name of elements (if not over written by registry) Definition at line 595 of file cfl_basevector.h. ◆ mFaudesTypeName
Current/cached faudes type-name Definition at line 587 of file cfl_basevector.h. ◆ mMyName
Name of TBaseVector Definition at line 600 of file cfl_basevector.h. ◆ mVector
STL vector of element Definition at line 579 of file cfl_basevector.h. The documentation for this class was generated from the following files: libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen |