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

Semantic Object Array. More...

#include <sox.h>

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

Classes

struct  SOAArray
 Semantic Object Array - array member class. More...
 

Public Member Functions

 SOA (size_t p_l=0, bool p_exec=false)
 ctor.
 
public_accessor void setSO (size_t p_index, SOp p_o)
 Setter for an array object. More...
 
SOp at (size_t p_pos) const
 Returns a copy of the SOp at the given position. More...
 
public_virtual SOAdup () const override
 Creates a new instance as copy following the PostScript definition. More...
 
SOAclone () const override
 Creates a new instance as copy with deep cloning. More...
 
string opequal () const override
 For operators '=' and 'stack'. More...
 
string opequalequal (Context &) 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 reduce ()
 Reduces the array by one SO at the end. More...
 
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.
 
- 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

 SOA (shared_ptr< SOAArray > p_v, bool p_exec)
 Private ctor for dup().
 

Private Attributes

shared_ptr< SOAArrayv_
 The shared array.
 

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 Array.

SOA owns its objects.

Invariant
v_ never is null.

Member Function Documentation

◆ 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.

◆ clone()

SOA * SOA::clone ( ) const
inlineoverridevirtual

Creates a new instance as copy with deep cloning.

Reimplemented from SO.

◆ dup()

public_virtual SOA * SOA::dup ( ) const
inlineoverridevirtual

Creates a new instance as copy following the PostScript definition.

Implements SO.

◆ equal()

bool SOA::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.

◆ getSize()

size_t SOA::getSize ( ) const
inlineoverridevirtual

Getter for the number of characters or number of objects.

Reimplemented from SO.

◆ opequal()

string SOA::opequal ( ) const
inlineoverridevirtual

For operators '=' and 'stack'.

Implements SO.

◆ opequalequal()

string SOA::opequalequal ( Context ) const
overridevirtual

For operators '==' and 'pstack'.

Reimplemented from SO.

◆ ot()

OTCode SOA::ot ( ) const
inlineoverridevirtual

Returns an OTCode.

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

Returns
char ... OTCode of the SO

Implements SO.

◆ reduce()

public_other void SOA::reduce ( )
inline

Reduces the array by one SO at the end.

The element will be deleted. An empty array stays unchanged without an error condition.

◆ setSO()

public_accessor void SOA::setSO ( size_t  p_index,
SOp  p_o 
)
inline

Setter for an array object.

Without range check. Takes ownership of p_o. The existing SOx will be deleted.


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