81 explicit SO(
bool p_exec ) :
exec_(p_exec) {}
90 virtual ~SO() =
default;
94 SO & operator=(
const SO & ) =
delete;
95 SO & operator=(
SO && ) =
delete;
124 [[nodiscard]]
virtual SO *
dup()
const = 0;
161 virtual std::string_view
type()
const = 0;
227 return shptr() !=
nullptr;
239 return "--nostringval--";
245 bool equal(
const SO * p_other )
const override {
248 if( p_other->
ot() !=
ot() )
250 const auto o =
static_cast<const SOshptr *
>( p_other );
266 using SOshptr::SOshptr;
282 virtual size_t dagheight(
size_t p_myheigth )
const = 0;
Counter base class.
Definition counter.h:30
Design by contract interface class.
Definition dbc.h:30
Semantic Object.
Definition so.h:67
virtual std::string_view type() const =0
Returns a type name.
virtual bool equal(const SO *) const =0
Checks if this SO is equal to another SO.
void setExec(bool p_exec)
Setter for exec_.
Definition so.h:106
virtual SO * dup() const =0
Creates a new instance as copy following the red book definition.
virtual ~SO()=default
Virtual dtor.
virtual std::string opequalequal() const
String representation for operators '==' and 'pstack'.
Definition so.h:147
virtual std::string opequal() const =0
String representation of object for operators '=', 'cvs' and 'stack'.
virtual bool ge(OpError &p_ec, const SO *) const
Greater or equal.
Definition so.h:194
virtual OTCode ot() const =0
Returns an OTCode.
bool getExec() const
Getter for exec_.
Definition so.h:100
SO(bool p_exec)
Ctor.
Definition so.h:81
SO(const SO &p_other)
Copy ctor.
Definition so.h:85
SO()
Ctor.
Definition so.h:76
virtual SO * clone() const
Creates a new instance as copy with deep cloning.
Definition so.h:132
virtual bool gt(OpError &p_ec, const SO *) const
Greater than.
Definition so.h:183
bool exec_
Flag indicating whether the SO is executable (true) or literal (false).
Definition so.h:71
virtual size_t getSize() const
Returns the size of the SO.
Definition so.h:116
Composite Semantic Object.
Definition so.h:261
virtual size_t dagheight(size_t p_myheigth) const =0
DAG Height.
static bool otcodeIsComposite(OTCode p_code)
Checks if an OTCode represents a composite type (A, Ax, D, K).
Definition so.h:290
Semantic Object with shared pointer to data.
Definition so.h:210
virtual void * shptr() const =0
Pointer to the shared object.
bool invariant() const noexcept override
Checks class invariants.
Definition so.h:226
bool equal(const SO *p_other) const override
Checks if this SO is equal to another SO.
Definition so.h:245
std::string opequal() const override
String representation of object for operators '=', 'cvs' and 'stack'.
Definition so.h:238
Helpers for design by contract idioms.
#define DBC_PRE(XXX)
Assert for preconditions.
Definition dbc.h:104
OpError
Operator error code enum.
Definition error.h:30
@ typecheck
operator error typecheck
Definition error.h:36
Miscellaneous definitions and functions.
OTCode
OTCode - the Object Type Code.
Definition so.h:38
@ X
any SO. Is used by checks to represent any object.