Semantic Object Dictionary.
More...
#include <sod.h>
|
|
| SOD () |
| | Ctor.
|
| |
| | SOD (const SOcomposite &p_other) |
| | Ctor from parent class object.
|
| |
|
| SOD (const SOD &p_other) |
| | Copy ctor.
|
| |
|
| ~SOD () override |
| | Dtor.
|
| |
|
| SOD (SOD &&)=delete |
| |
|
SOD & | operator= (const SOD &)=delete |
| |
|
SOD & | operator= (SOD &&)=delete |
| |
| SOD * | dup () const override |
| | Creates a new instance as copy following the red book definition.
|
| |
| SOD * | clone () const override |
| | Creates a new instance as copy with deep cloning.
|
| |
| std::string | opequalequal () const override |
| | String representation for operators '==' and 'pstack'.
|
| |
| OTCode | ot () const override |
| | Returns an OTCode.
|
| |
| std::string_view | type () const override |
| | Returns a type name.
|
| |
| size_t | getSize () const override |
| | Returns the size of the SO.
|
| |
| size_t | dagheight (size_t p_myheight) const override |
| | DAG Height.
|
| |
|
auto | begin () const |
| | Returns an iterator to the begin of the map of two SOps.
|
| |
|
auto | end () const |
| | Returns an iterator to the marker at end of the map of two SOps.
|
| |
| void | insert (SOp p_key, SOp p_value) |
| | Insert with the red book definition of equal.
|
| |
| SOp | find (SO *p_key) const |
| | Searches for p_key in the dictionary.
|
| |
| auto | any_pop () |
| | Returns a pair from the dictionary.
|
| |
| void | undef (SO *p_key) |
| | Removes both p_key and its value from the dictionary.
|
| |
| std::string | opequal () const override |
| | String representation of object for operators '=', 'cvs' and 'stack'.
|
| |
| bool | equal (const SO *p_other) const override |
| | Checks if this SO is equal to another SO.
|
| |
|
| SO () |
| | Ctor.
|
| |
| | SO (bool p_exec) |
| | Ctor.
|
| |
|
| SO (const SO &p_other) |
| | Copy ctor.
|
| |
|
| SO (SO &&)=delete |
| |
|
| SO () |
| | Ctor.
|
| |
| | SO (bool p_exec) |
| | Ctor.
|
| |
|
| SO (const SO &p_other) |
| | Copy ctor.
|
| |
| virtual | ~SO ()=default |
| | Virtual dtor.
|
| |
|
| SO (SO &&)=delete |
| |
|
SO & | operator= (const SO &)=delete |
| |
|
SO & | operator= (SO &&)=delete |
| |
|
bool | getExec () const |
| | Getter for exec_.
|
| |
|
void | setExec (bool p_exec) |
| | Setter for exec_.
|
| |
| virtual bool | gt (OpError &p_ec, const SO *) const |
| | Greater than.
|
| |
| virtual bool | ge (OpError &p_ec, const SO *) const |
| | Greater or equal.
|
| |
|
| Counter (Counter< SO > &&)=delete |
| |
|
Counter< SO > & | operator= (const Counter< SO > &)=delete |
| |
|
Counter< SO > & | operator= (Counter< SO > &&)=delete |
| |
|
| void * | shptr () const override |
| | Pointer to the shared object.
|
| |
| bool | invariant () const noexcept override |
| | Checks class invariants.
|
| |
| bool | invariant () const noexcept override |
| | Checks class invariants.
|
| |
|
| Counter () |
| | Ctor.
|
| |
|
| Counter (const Counter< SO > &) |
| | Copy ctor.
|
| |
|
| ~Counter () |
| | Dtor.
|
| |
|
| ~DbC ()=default |
| | Protected dtor.
|
| |
|
|
std::shared_ptr< SODMap > | map_ |
| | The shared dictionary.
|
| |
|
| static bool | otcodeIsComposite (OTCode p_code) |
| | Checks if an OTCode represents a composite type (A, Ax, D, K).
|
| |
|
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 Dictionary.
- Invariant
- inherited from SOcomposite
-
map_.stlmap_ elements are never null
◆ SOD()
Ctor from parent class object.
- Parameters
-
| [in] | p_other | We construct as copy from this parent class object. |
◆ any_pop()
Returns a pair from the dictionary.
The pair is removed from the dictionary.
- Precondition
- getSize() > 0
- Returns
- std::pair<const SOp, SOp> ... from the SOD
◆ clone()
| SOD * SOD::clone |
( |
| ) |
const |
|
overridevirtual |
Creates a new instance as copy with deep cloning.
Default implementation falls back to dup().
Subclasses must override this if deep cloning is required.
- Returns
- SO * ... A deep copy.
- Postcondition
- return value != nullptr
-
return value maintains invariants
Reimplemented from SO.
◆ dagheight()
| size_t SOD::dagheight |
( |
size_t |
p_myheigth | ) |
const |
|
overridevirtual |
DAG Height.
The composite semantic objects can contain other composite semantic objects.
This creates a directed acyclic graph (DAG) of objects.
dagheight() calculates the height of this DAG starting at this.
Loops will be dedected by an heuristics. We stop the recursion if the heigth
exceeds DET_MAXDAGHEIGHT, a global constant in Leonardus.
- Parameters
-
| [in] | p_myheigth | Call with 0. Used internally for recursion. |
- Returns
- size_t ... The maximum height of the DAG of SOcomposite -or- DET_MAXDAGHEIGHT if there is a loop.
Implements SOcomposite.
◆ dup()
Creates a new instance as copy following the red book definition.
- Returns
- SO * ... A copy.
Implements SO.
◆ find()
| SOp SOD::find |
( |
SO * |
p_key | ) |
const |
Searches for p_key in the dictionary.
Equality is defined by SO::equal().
- Precondition
- p_key != nullptr
- Parameters
-
- Returns
- SOp ... a SOp to the value, the ownership stays within the dictionary; a nullptr if not found
◆ getSize()
| size_t SOD::getSize |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the size of the SO.
Default implementation returns 1 (for simple objects).
Override in subclasses to return the actual size
(e.g., length of a string, number of elements in a composite object).
Reimplemented from SO.
◆ insert()
| void SOD::insert |
( |
SOp |
p_key, |
|
|
SOp |
p_value |
|
) |
| |
Insert with the red book definition of equal.
The SOD takes ownership. If the key is found in the dictionary,
then this existing key and the corresponding value will be deleted.
- Precondition
- p_key != nullptr and p_value != nullptr.
- Parameters
-
| [in] | p_key | Key. |
| [in] | p_value | Value. |
◆ invariant()
| bool SOD::invariant |
( |
| ) |
const |
|
inlineoverrideprotectedvirtualnoexcept |
Checks class invariants.
- Returns
- bool ... Indicates whether the class invariants are maintained.
Reimplemented from DbC.
◆ opequalequal()
| string SOD::opequalequal |
( |
| ) |
const |
|
overridevirtual |
String representation for operators '==' and 'pstack'.
This function attempts to produce a result that resembles the red book syntax
for creating the object.
- Returns
- std::string ... The representation.
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.
◆ shptr()
| void * SOD::shptr |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
Pointer to the shared object.
- Returns
- void * ... The naked pointer.
Implements SOshptr.
◆ type()
| std::string_view SOD::type |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns a type name.
- Returns
- std::string_view ... The type name of the instance.
Implements SO.
◆ undef()
| void SOD::undef |
( |
SO * |
p_key | ) |
|
Removes both p_key and its value from the dictionary.
Equality is defined by SO::equal(). Doesn't generate a error if p_key can not be found.
- Precondition
- p_key != nullptr
- Parameters
-
The documentation for this class was generated from the following files: