Kryptostack
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SOD Class Reference

Semantic Object Dictionary. More...

#include <sox.h>

Inheritance diagram for SOD:
Inheritance graph
[legend]
Collaboration diagram for SOD:
Collaboration graph
[legend]

Classes

struct  SODMap
 Semantic Object Dictionary - map member class. More...
 

Public Member Functions

 SOD ()
 Ctor.
 
public_virtual SODdup () const override
 Creates a new instance as copy following the PostScript definition. More...
 
SODclone () const override
 Creates a new instance as copy with deep cloning. More...
 
string opequal () const override
 For operators '=' and 'stack'. More...
 
string opequalequal (Context &k) const override
 For operators '==' and 'pstack'. More...
 
OTCode ot () const override
 Returns an OTCode. 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...
 
public_other void insert (SOp p_key, SOp p_value, bool p_forcebegin=false)
 Insert with PostScript definition of equal. More...
 
SOp find (const SO *p_key) const
 Searches for p_key in the dictionary. More...
 
pair< SOp, SOpany_pop ()
 Returns a pair from the dictionary. More...
 
- Public Member Functions inherited from SO
 SO (bool p_exec=false)
 Ctor.
 
virtual ~SO ()
 Virtual dtor. More...
 
public_accessor 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 public_virtual SOdup () const =0
 Creates a new instance as copy following the PostScript definition. More...
 
virtual SOclone () const
 Creates a new instance as copy with deep cloning. More...
 
virtual string opequal () const =0
 For operators '=' and 'stack'. More...
 
virtual string opequalequal (class Context &) const
 For operators '==' and 'pstack'. More...
 
virtual OTCode ot () const =0
 Returns an OTCode. More...
 
virtual bool equal (const SO *p_other) const =0
 Equality. More...
 
- Public Member Functions inherited from Counter< SO >
 Counter ()
 Ctor.
 

Private Member Functions

 SOD (shared_ptr< SODMap > p_d)
 Private ctor for dup().
 

Private Attributes

shared_ptr< SODMapd_
 The shared dictionary.
 

Additional Inherited Members

- Static Public Member Functions inherited from Counter< SO >
static int getTotalCounter ()
 Static getter for created objects.
 
static int getAliveCounter ()
 Static getter for objects alive.
 
- Protected Attributes inherited from SO
bool exec_ = false
 All SOs have executive vs. More...
 

Detailed Description

Semantic Object Dictionary.

Member Function Documentation

◆ any_pop()

pair< SOp, SOp > SOD::any_pop ( )
inline

Returns a pair from the dictionary.

Has no check for empty dictionary.

◆ clone()

SOD * SOD::clone ( ) const
inlineoverridevirtual

Creates a new instance as copy with deep cloning.

Reimplemented from SO.

◆ dup()

public_virtual SOD * SOD::dup ( ) const
inlineoverridevirtual

Creates a new instance as copy following the PostScript definition.

Implements SO.

◆ equal()

bool SOD::equal ( const SO p_other) const
inlineoverridevirtual

Equality.

Equality means: For SOD, share_ptr<> points to the same object.
For SOA, share_ptr<> points to the same object, but empty arrays are equal nonetheless.
SO0 und SOM are always equal.
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

Implements SO.

◆ find()

SOp SOD::find ( const SO p_key) const

Searches for p_key in the dictionary.

Equality is defined by SO::equal().

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

Getter for the number of characters or number of objects.

Reimplemented from SO.

◆ insert()

void SOD::insert ( SOp  p_key,
SOp  p_value,
bool  p_forcebegin = false 
)

Insert with PostScript definition of equal.

The SOA takes ownership. If the key is found in the dictionary, then this existing key and the corresponding value will be deleted.

Parameters
[in]p_keykey
[in]p_valuevalue
[in]p_forcebeginThis parameter forces the insertion of the key-value pair at the beginning of the dictionary.

◆ opequal()

string SOD::opequal ( ) const
inlineoverridevirtual

For operators '=' and 'stack'.

Implements SO.

◆ opequalequal()

string SOD::opequalequal ( Context ) const
overridevirtual

For operators '==' and 'pstack'.

Reimplemented from SO.

◆ ot()

OTCode SOD::ot ( ) const
inlineoverridevirtual

Returns an OTCode.

A "manual" implementation of polymorphism, where C++-polymorphisms fail

Returns
char ... OTCode of the SO

Implements SO.


The documentation for this class was generated from the following files: