Leonardus
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SO Class Referenceabstract

Semantic Object. More...

#include <so.h>

+ Inheritance diagram for SO:
+ Collaboration diagram for SO:

Public Member Functions

 SO ()
 Ctor.
 
 SO (bool p_exec)
 Ctor.
 
 SO (const SO &p_other)
 Copy ctor.
 
virtual ~SO ()
 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 size_t getSize () const
 Returns the size of the SO.
 
virtual SO * dup () const =0
 Creates a new instance as copy following the red book definition.
 
virtual SO * clone () const
 Creates a new instance as copy with deep cloning.
 
virtual std::string opequal () const =0
 String representation of object for operators '=', 'cvs' and 'stack'.
 
virtual std::string opequalequal () const
 String representation for operators '==' and 'pstack'.
 
virtual OTCode ot () const =0
 Returns an OTCode.
 
virtual std::string type () const =0
 Returns a type name.
 
virtual bool equal (const SO *) const =0
 Checks if this SO is equal to another SO.
 
virtual bool gt (OpError &p_ec, const SO *) const
 Greater than.
 
virtual bool ge (OpError &p_ec, const SO *) const
 Greater or equal.
 
- Public Member Functions inherited from Counter< SO >
 Counter (Counter< SO > &&)=delete
 
Counter< SO > & operator= (const Counter< SO > &)=delete
 
Counter< SO > & operator= (Counter< SO > &&)=delete
 

Private Attributes

bool exec_
 Flag indicating whether the SO is executable (true) or literal (false).
 

Additional Inherited Members

- Static Public Member Functions inherited from Counter< SO >
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.
 
- Protected Member Functions inherited from Counter< SO >
 Counter ()
 Ctor.
 
 Counter (const Counter< SO > &)
 Copy ctor.
 
 ~Counter ()
 Dtor.
 
- Protected Member Functions inherited from DbC
 ~DbC ()=default
 Protected dtor.
 
virtual bool invariant () const noexcept
 Checks the invariants of the class in which it is defined.
 

Detailed Description

Semantic Object.

Invariant
Global Invariants: No Instance. Forced by pure virtual functions.

Constructor & Destructor Documentation

◆ SO()

SO::SO ( bool  p_exec)
inlineexplicit

Ctor.

Parameters
[in]p_execThe executive attribute of the semantic object.

◆ ~SO()

virtual SO::~SO ( )
inlinevirtual

Virtual dtor.

For polymorphic containers.

Member Function Documentation

◆ clone()

virtual SO * SO::clone ( ) const
inlinevirtual

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.

Reimplemented in SOA, SOD, SOK, and SOS.

◆ dup()

virtual SO * SO::dup ( ) const
pure virtual

Creates a new instance as copy following the red book definition.

Returns
SO * ... A copy.

Implemented in SOA, SOD, SOF, SOK, SOQ, SOS, SOM, SOL, SOI, SOB, SOR, SON, and SOO.

◆ equal()

virtual bool SO::equal ( const SO *  ) const
pure virtual

Checks if this SO is equal to another SO.

Equality means:
SOL und SOM are always equal.
For SOD, SOF 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

Implemented in SOA, SOD, SOF, SOK, SOQ, SOS, SOM, SOL, SOI, SOB, SOR, SON, and SOO.

◆ ge()

virtual bool SO::ge ( OpError &  p_ec,
const SO *   
) const
inlinevirtual

Greater or equal.

The redundancy between equal(), gt() and ge() is a matter of performance.

Parameters
[out]p_ecError code.
Returns
bool ... true is comparable and ge.

Reimplemented in SOQ, SOS, SOI, and SOR.

◆ getSize()

virtual size_t SO::getSize ( ) const
inlinevirtual

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

Reimplemented in SOA, SOD, SOK, SOS, and SON.

◆ gt()

virtual bool SO::gt ( OpError &  p_ec,
const SO *   
) const
inlinevirtual

Greater than.

The redundancy between equal(), gt() and ge() is a matter of performance.

Parameters
[out]p_ecError code.
Returns
bool ... true is comparable and gt.

Reimplemented in SOQ, SOS, SOI, and SOR.

◆ opequal()

virtual std::string SO::opequal ( ) const
pure virtual

String representation of object for operators '=', 'cvs' and 'stack'.

Returns
std::string ... The representation.

Implemented in SOcomposite, SOF, SOQ, SOS, SOM, SOL, SOI, SOB, SOR, SON, and SOO.

◆ opequalequal()

virtual std::string SO::opequalequal ( ) const
inlinevirtual

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 in SOA, SOD, SOF, SOK, SOS, SOM, and SOL.

◆ ot()

virtual OTCode SO::ot ( ) const
pure virtual

Returns an OTCode.

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

Returns
OTCode ... The OTCode of the instance.

Implemented in SOA, SOD, SOF, SOK, SOQ, SOS, SOM, SOL, SOI, SOB, SOR, SON, SOO, and SOo.

◆ type()

virtual std::string SO::type ( ) const
pure virtual

Returns a type name.

Returns
std::string ... The type name of the instance.

Implemented in SOA, SOD, SOF, SOK, SOQ, SOS, SOM, SOL, SOI, SOB, SOR, SON, and SOO.

Member Data Documentation

◆ exec_

bool SO::exec_
private

Flag indicating whether the SO is executable (true) or literal (false).

Only relevant for SON and SOA subclasses.


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