|
|
||||||
|
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 70 of file cfl_basevector.h.
Member Typedef Documentation◆ iterator
convenience typedef Definition at line 521 of file cfl_basevector.h. ◆ Position
convenience typedef for positions (must be unsigned) Definition at line 197 of file cfl_basevector.h. Constructor & Destructor Documentation◆ vBaseVector() [1/3]
Constructor. Definition at line 46 of file cfl_basevector.cpp. ◆ vBaseVector() [2/3]
Copy-constructor.
Definition at line 68 of file cfl_basevector.cpp. ◆ vBaseVector() [3/3]
Constructor from file.
Definition at line 56 of file cfl_basevector.cpp. ◆ ~vBaseVector()
Virtual destructor. Definition at line 76 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 392 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 382 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 387 of file cfl_basevector.cpp. ◆ At() [1/2]Access element.
Reimplemented in faudes::TBaseVector< T >, and faudes::TBaseVector< Generator >. Definition at line 192 of file cfl_basevector.cpp. ◆ At() [2/2]Access element.
Reimplemented in faudes::TBaseVector< T >, and faudes::TBaseVector< Generator >. Definition at line 180 of file cfl_basevector.cpp. ◆ Clear()
Clear all vector. Reimplemented from faudes::Type. Definition at line 127 of file cfl_basevector.cpp. ◆ DoAssign()
Assignment method Definition at line 108 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 469 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 494 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. Definition at line 482 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 439 of file cfl_basevector.cpp. ◆ Element()
Prototype for vector entries. This is a convenience wrapper for Elementp.
Definition at line 93 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 >, and faudes::TBaseVector< Generator >. Definition at line 87 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 >, and faudes::TBaseVector< Generator >. Definition at line 103 of file cfl_basevector.cpp. ◆ Empty()
Check if the vBaseVector ist Empty.
Definition at line 174 of file cfl_basevector.cpp. ◆ Erase()
Erase entry by position. If the vector owns the entry, it will be destructed.
Definition at line 265 of file cfl_basevector.cpp. ◆ FilenameAt() [1/2]
Get filename of entry.
Definition at line 398 of file cfl_basevector.cpp. ◆ FilenameAt() [2/2]
Specify a filename. When each entry has a filenam specified, file io of the vector will be to indivudual files.
Definition at line 410 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 324 of file cfl_basevector.cpp. ◆ Insert() [2/3]Insert specified entry. This method takes a copy of the entry to replace and the vector becomes the owner of the copy.
Definition at line 280 of file cfl_basevector.cpp. ◆ Insert() [3/3]Insert 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 302 of file cfl_basevector.cpp. ◆ Name() [1/2]
Set name of vBaseVector.
Reimplemented from faudes::Type. Definition at line 143 of file cfl_basevector.cpp. ◆ Name() [2/2]
Return name of vBaseVector.
Reimplemented from faudes::Type. Definition at line 138 of file cfl_basevector.cpp. ◆ NewElement()
Factory method for vector entries. This is a convenience wrapper using Elementp.
Definition at line 98 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 371 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 343 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 357 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 248 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 206 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 227 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 153 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 422 of file cfl_basevector.cpp. ◆ TakeOwnership()
Take ownership of all entries. Thsi 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 432 of file cfl_basevector.cpp. Member Data Documentation◆ mMyName
Name of TBaseVector. Definition at line 526 of file cfl_basevector.h. ◆ mVector
STL vector of element. Definition at line 518 of file cfl_basevector.h. The documentation for this class was generated from the following files: libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |