Apply cpp naming to files
This commit is contained in:
parent
89eec0e329
commit
9d01ba2c8a
73 changed files with 160 additions and 160 deletions
39
Objects/public/interpreter/OperandsStack.hpp
Normal file
39
Objects/public/interpreter/OperandsStack.hpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include "ByteCode.hpp"
|
||||
#include "core/Object.hpp"
|
||||
|
||||
namespace obj {
|
||||
|
||||
// can be other aligned value as well
|
||||
typedef obj::Object* Operand;
|
||||
|
||||
class OperandStack {
|
||||
|
||||
enum : tp::alni {
|
||||
MAX_STACK_SIZE = 512
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
Operand* mBuff;
|
||||
tp::ualni mIdx;
|
||||
|
||||
OperandStack();
|
||||
void push(Operand operand);
|
||||
void pop();
|
||||
|
||||
Operand getOperand();
|
||||
|
||||
template <typename ObjectType>
|
||||
ObjectType* getOperand() {
|
||||
auto operand = getOperand();
|
||||
auto ret = NDO_CAST(ObjectType, operand);
|
||||
ASSERT(ret && "Operand Has Invalid Object Type");
|
||||
return ret;
|
||||
}
|
||||
|
||||
~OperandStack();
|
||||
};
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue