Kryptostack
so.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8
9#include "counter.h"
10#include "helper.h"
11
12using namespace std;
13
17class SO : public Counter<SO> {
18protected:
19 bool exec_ = false;
21public:
23 SO( bool p_exec = false ) : exec_(p_exec) {}
24
27 virtual ~SO() {}
28
31 bool getExec() const { return exec_; }
32
34 void setExec( bool p_exec ) { exec_ = p_exec; }
35
37 virtual size_t getSize() const { return 1; }
38
41 virtual SO* dup() const = 0;
42
44 virtual SO* clone() const { return dup(); }
45
47 virtual string opequal() const = 0;
48
50 virtual string opequalequal( class Context & ) const { return opequal(); }
51
56 virtual OTCode ot() const = 0;
57
67 virtual bool equal( const SO* p_other ) const = 0;
68};
69
71using SOp = SO *;
The context of execution.
Definition: context.h:17
Counter base class.
Definition: counter.h:10
Semantic Object.
Definition: so.h:17
virtual bool equal(const SO *p_other) const =0
Equality.
void setExec(bool p_exec)
Setter for exec_.
Definition: so.h:34
SO(bool p_exec=false)
Ctor.
Definition: so.h:23
virtual ~SO()
Virtual dtor.
Definition: so.h:27
virtual public_virtual SO * dup() const =0
Creates a new instance as copy following the PostScript definition.
virtual OTCode ot() const =0
Returns an OTCode.
public_accessor bool getExec() const
Getter for exec_.
Definition: so.h:31
virtual string opequal() const =0
For operators '=' and 'stack'.
virtual SO * clone() const
Creates a new instance as copy with deep cloning.
Definition: so.h:44
virtual string opequalequal(class Context &) const
For operators '==' and 'pstack'.
Definition: so.h:50
bool exec_
All SOs have executive vs.
Definition: so.h:19
virtual size_t getSize() const
Getter for the number of characters or number of objects.
Definition: so.h:37
The class Counter.
#define public_virtual
virtual member functions
Definition: helper.h:15
#define public_accessor
accessor functions
Definition: helper.h:14
Miscellaneous definitions and functions.
char OTCode
OTCode - the Object Type Code.
Definition: helper.h:22