Semantic Object Array.
More...
#include <soa.h>
|
|
| SOA (size_t p_len=0, bool p_exec=false) |
| | Ctor.
|
| |
| void | setSO (size_t p_index, SOp p_sop) |
| | Setter for an array object.
|
| |
| SOp | at (size_t p_pos) const |
| | Returns a copy of the SOp at the given position.
|
| |
| SOA * | dup () const override |
| | Creates a new instance as copy following the red book definition.
|
| |
| SOA * | clone () const override |
| | Creates a new instance as copy with deep cloning.
|
| |
| std::string | opequalequal () const override |
| | For operators '==' and 'pstack'.
|
| |
| OTCode | ot () const override |
| | Returns an OTCode.
|
| |
| std::string | type () const override |
| | Returns a type name.
|
| |
| bool | equal (const SO *p_other) const override |
| | Equality.
|
| |
| size_t | getSize () const override |
| | Getter for the number of characters or number of objects.
|
| |
| size_t | treeheight (size_t p_myheight) const override |
| | Tree Height.
|
| |
|
auto | begin () |
| | Returns an iterator to the first SOp.
|
| |
|
auto | end () |
| | Returns an iterator to the marker at end of the vector of SOps.
|
| |
| void | reduce () |
| | Reduces the array by one SO at the end.
|
| |
|
void | unfold2exec (Context &k) const |
| | Unfolds duplicates of the array-content to the execution stack.
|
| |
| SOp | front_pop () |
| | Returns a copy of the SOp at position 0 and removes this first position from the array.
|
| |
|
void | bind (Context &k) |
| | Replaces executable names with operator objects recursively into elements that are SOA.
|
| |
| std::string | opequal () const override |
| | For operators '=', 'cvs' and 'stack'.
|
| |
|
| SO (bool p_exec=false) |
| | Ctor.
|
| |
|
| SO (bool p_exec=false) |
| | Ctor.
|
| |
| virtual | ~SO ()=default |
| | Virtual dtor.
|
| |
|
bool | getExec () const |
| | Getter for exec_.
|
| |
|
void | setExec (bool p_exec) |
| | Setter for exec_.
|
| |
| virtual bool | gt (const SO *) const |
| | Greater than.
|
| |
| virtual bool | ge (const SO *) const |
| | Greater or equal.
|
| |
|
| Counter (Counter< SO > &&)=delete |
| |
|
Counter< SO > & | operator= (const Counter< SO > &)=delete |
| |
|
Counter< SO > & | operator= (Counter< SO > &&)=delete |
| |
|
| bool | invariant () const noexcept override |
| | Checks class invariants.
|
| |
|
| Counter () |
| | Ctor.
|
| |
|
| Counter (const Counter< SO > &) |
| | Copy ctor.
|
| |
|
| ~Counter () |
| | Dtor.
|
| |
|
|
std::shared_ptr< SOAArray > | vec_ |
| | The shared array.
|
| |
|
|
static size_t | getTotalCounter () |
| | Static getter for totaly created objects.
|
| |
|
static size_t | getAliveCounter () |
| | Static getter for objects alive.
|
| |
|
static size_t | getWatermarkCounter () |
| | Static getter for the object counter watermark.
|
| |
Semantic Object Array.
SOA owns its objects.
- Invariant
- vec_ never is null
-
vec_.stlvec_ elements are never null
◆ at()
| SOp SOA::at |
( |
size_t |
p_pos | ) |
const |
|
inline |
Returns a copy of the SOp at the given position.
The arrays keeps ownership of the element.
- Parameters
-
| [in] | p_pos | position, which is not checked. |
- Precondition
- p_pos < vectorsize
◆ clone()
| SOA * SOA::clone |
( |
| ) |
const |
|
overridevirtual |
Creates a new instance as copy with deep cloning.
- Postcondition
- return value != nullptr
-
return value maintains invariants
Reimplemented from SO.
◆ dup()
Creates a new instance as copy following the red book definition.
Implements SO.
◆ equal()
| bool SOA::equal |
( |
const SO * |
| ) |
const |
|
inlineoverridevirtual |
Equality.
Equality means: SOL und SOM are always equal.
For SOD and SOK, share_ptr<> points to the same object.
For SOA, share_ptr<> points to the same object, but empty arrays are equal nonetheless.
For SOO and SOo the function pointer must be the same.
Otherwise the value must be the same, even for SOS with shared_ptr<>.
- Returns
- bool ... true if the SO's are of the same type and equal
- See also
- Will be used directly and unchanged as operator eq
Implements SO.
◆ front_pop()
Returns a copy of the SOp at position 0 and removes this first position from the array.
Has an undefined result if size of vector is 0.
- Precondition
- vectorsize > 0
◆ getSize()
| size_t SOA::getSize |
( |
| ) |
const |
|
inlineoverridevirtual |
Getter for the number of characters or number of objects.
Reimplemented from SO.
◆ invariant()
| bool SOA::invariant |
( |
| ) |
const |
|
inlineoverrideprotectedvirtualnoexcept |
Checks class invariants.
- Returns
- bool ... Indicates whether the class invariants are maintained.
Reimplemented from DbC.
◆ opequalequal()
| string SOA::opequalequal |
( |
| ) |
const |
|
overridevirtual |
For operators '==' and 'pstack'.
This function attempts to produce a result that resembles the red book syntax for creating the object.
Reimplemented from SO.
◆ ot()
Returns an OTCode.
A "manual" implementation of polymorphism, where C++-polymorphisms fail
- Returns
- OTCode ... The OTCode of the instance.
Implements SO.
◆ reduce()
Reduces the array by one SO at the end.
The element will be deleted. An empty array stays unchanged without an error condition.
◆ setSO()
| void SOA::setSO |
( |
size_t |
p_index, |
|
|
SOp |
p_sop |
|
) |
| |
|
inline |
Setter for an array object.
The existing SOx will be deleted.
- Parameters
-
| [in] | p_index | index from 0 to size-1. Attention: no range check. |
| [in] | p_sop | the SOA takes ownership of this SO. |
- Precondition
- p_index < arraysize
-
p_sop != nullptr
◆ treeheight()
| size_t SOA::treeheight |
( |
size_t |
p_myheigth | ) |
const |
|
overridevirtual |
Tree Height.
The composite semantic objects can contain other composite semantic objects.
This creates a tree of objects. treeheigth() calculates the height of this tree
starting at this.
Loops will be dedected by an heuristics. We stop the recursion if the heigth exceeds
maxtreeheight.
- Parameters
-
| [in] | p_myheigth | ... Call with value 0. Used internally for recursion. |
- Returns
- size_t ... The maximum height of the tree of SOcomposite -or- maxtreeheight if there is a loop.
Reimplemented from SOcomposite.
◆ type()
| std::string SOA::type |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns a type name.
- Returns
- std::string ... The type name of the instance.
Implements SO.
The documentation for this class was generated from the following files: