Leonardus
|
Semantic Object Dictionary. More...
#include <sod.h>
Classes | |
struct | SODMap |
Semantic Object Dictionary - map member class. More... | |
Public Member Functions | |
SOD () | |
Ctor. | |
SOD * | dup () const override |
Creates a new instance as copy following the red book definition. More... | |
SOD * | clone () const override |
Creates a new instance as copy with deep cloning. More... | |
std::string | opequalequal () const override |
For operators '==' and 'pstack'. More... | |
OTCode | ot () const override |
Returns an OTCode. More... | |
std::string | type () const override |
Returns a type name. More... | |
bool | equal (const SO *p_other) const override |
Equality. More... | |
size_t | getSize () const override |
Getter for the number of characters or number of objects. More... | |
size_t | treeheight (size_t p_myheight) const override |
Tree Height. More... | |
auto | begin () |
Returns an iterator to the begin of the map of two SOps. | |
auto | end () |
Returns an iterator to the marker at end of the map of two SOps. | |
void | insert (SOp p_key, SOp p_value, bool p_forcebegin=false) |
Insert with the red book definition of equal. More... | |
SOp | find (const SO *p_key) const |
Searches for p_key in the dictionary. More... | |
auto | any_pop () |
Returns a pair from the dictionary. More... | |
void | undef (const SO *p_key) |
Removes both p_key and its value from the dictionary. More... | |
![]() | |
std::string | opequal () const override |
For operators '=', 'cvs' and 'stack'. More... | |
virtual size_t | treeheight (size_t p_myheigth) const |
Tree Height. More... | |
SO (bool p_exec=false) | |
Ctor. | |
![]() | |
SO (bool p_exec=false) | |
Ctor. | |
virtual | ~SO ()=default |
Virtual dtor. More... | |
bool | getExec () const |
Getter for exec_. | |
void | setExec (bool p_exec) |
Setter for exec_. | |
virtual size_t | getSize () const |
Getter for the number of characters or number of objects. More... | |
virtual SO * | dup () const =0 |
Creates a new instance as copy following the red book definition. More... | |
virtual SO * | clone () const |
Creates a new instance as copy with deep cloning. More... | |
virtual std::string | opequal () const =0 |
For operators '=', 'cvs' and 'stack'. More... | |
virtual std::string | opequalequal () const |
For operators '==' and 'pstack'. More... | |
virtual OTCode | ot () const =0 |
Returns an OTCode. More... | |
virtual std::string | type () const =0 |
Returns a type name. More... | |
virtual bool | equal (const SO *) const =0 |
Equality. More... | |
virtual bool | gt (const SO *) const |
Greater than. More... | |
virtual bool | ge (const SO *) const |
Greater or equal. More... | |
![]() | |
Counter (Counter< SO > &&)=delete | |
Counter< SO > & | operator= (const Counter< SO > &)=delete |
Counter< SO > & | operator= (Counter< SO > &&)=delete |
Protected Member Functions | |
bool | invariant () const noexcept override |
Checks class invariants. More... | |
![]() | |
Counter () | |
Ctor. | |
Counter (const Counter< SO > &) | |
Copy ctor. | |
~Counter () | |
Dtor. | |
virtual bool | invariant () const noexcept |
Checks the invariants of the class in which it is defined. More... | |
Private Attributes | |
std::shared_ptr< SODMap > | map_ |
The shared dictionary. | |
Additional Inherited Members | |
![]() | |
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.
|
inline |
Returns a pair from the dictionary.
|
overridevirtual |
Creates a new instance as copy with deep cloning.
Reimplemented from SO.
|
inlineoverridevirtual |
Creates a new instance as copy following the red book definition.
Implements SO.
|
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<>.
Implements SO.
Searches for p_key in the dictionary.
Equality is defined by SO::equal().
|
inlineoverridevirtual |
Getter for the number of characters or number of objects.
Reimplemented from SO.
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.
[in] | p_key | Key. |
[in] | p_value | Value. |
[in] | p_forcebegin | This parameter forces the insertion of the key-value pair at the beginning of the dictionary. |
|
inlineoverrideprotectedvirtualnoexcept |
Checks class invariants.
Reimplemented from DbC.
|
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.
|
inlineoverridevirtual |
Returns an OTCode.
A "manual" implementation of polymorphism, where C++-polymorphisms fail
Implements SO.
|
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
.
[in] | p_myheigth | ... Call with value 0. Used internally for recursion. |
Reimplemented from SOcomposite.
|
inlineoverridevirtual |
void SOD::undef | ( | const 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.