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

Semantic Object Integer. More...

#include <sosimp.h>

+ Inheritance diagram for SOI:
+ Collaboration diagram for SOI:

Public Member Functions

 SOI (const std::string &p_s)
 Ctor from a string representation.
 
 SOI (__int128 p_i)
 Ctor from an 128 bit integer.
 
 ~SOI () override
 Dtor.
 
 SOI (const SOI &)=delete
 
 SOI (SOI &&)=delete
 
SOI & operator= (const SOI &)=delete
 
SOI & operator= (SOI &&)=delete
 
__int128 getInteger () const
 Getter for the integer value.
 
void setInteger (__int128 p_i)
 Setter for the integer value.
 
SOI * dup () const override
 Creates a new instance as copy following the red book definition.
 
std::string opequal () const override
 String representation of object for operators '=', 'cvs' and 'stack'.
 
OTCode ot () const override
 Returns an OTCode.
 
std::string type () const override
 Returns a type name.
 
bool equal (const SO *p_other) const override
 Checks if this SO is equal to another SO.
 
bool gt (OpError &p_ec, const SO *p_other) const override
 Greater than.
 
bool ge (OpError &p_ec, const SO *p_other) const override
 Greater or equal.
 
void decrement ()
 In place decrement.
 
void increment ()
 In place increment.
 
- Public Member Functions inherited from SO
 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 * clone () const
 Creates a new instance as copy with deep cloning.
 
virtual std::string opequalequal () const
 String representation for operators '==' and 'pstack'.
 
- 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

__int128 i_
 The 128 bit integer.
 

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

A 128-bit two's complement integer, thus -2^127 to 2^127-1

Invariant
None.

Constructor & Destructor Documentation

◆ SOI() [1/2]

SOI::SOI ( const std::string &  p_s)
inlineexplicit

Ctor from a string representation.

Precondition
p_s format is: [-][digit]+ .
p_s parsed as integer fits into an 128 bit integer.
Parameters
[in]p_sThe string to parse as integer.

◆ SOI() [2/2]

SOI::SOI ( __int128  p_i)
inlineexplicit

Ctor from an 128 bit integer.

Parameters
[in]p_iThe integer value.

Member Function Documentation

◆ dup()

SOI * SOI::dup ( ) const
inlineoverridevirtual

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

Returns
SO * ... A copy.

Implements SO.

◆ equal()

bool SOI::equal ( const SO *  p_other) const
inlineoverridevirtual

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
Parameters
[in]p_otherThe object to compare with.

Implements SO.

◆ ge()

bool SOI::ge ( OpError &  p_ec,
const SO *  p_other 
) const
inlineoverridevirtual

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.
Parameters
[in]p_otherThe object to compare with.

Reimplemented from SO.

◆ gt()

bool SOI::gt ( OpError &  p_ec,
const SO *  p_other 
) const
inlineoverridevirtual

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.
Parameters
[in]p_otherThe object to compare with.

Reimplemented from SO.

◆ opequal()

std::string SOI::opequal ( ) const
inlineoverridevirtual

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

Returns
std::string ... The representation.

Implements SO.

◆ ot()

OTCode SOI::ot ( ) const
inlineoverridevirtual

Returns an OTCode.

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

Returns
OTCode ... The OTCode of the instance.

Implements SO.

◆ type()

std::string SOI::type ( ) const
inlineoverridevirtual

Returns a type name.

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

Implements SO.


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