MysoreScript
|
Value wraps an object pointer. More...
#include <interpreter.hh>
Public Member Functions | |
Obj * | address () |
Returns the address of the object. More... | |
Value () | |
Default constructor, the value is null. More... | |
Value (Obj o) | |
Construct a new value from an object pointer. More... | |
Value (Value &o) | |
Copy constructor. More... | |
Value (Value &&o) | |
Move constructor. More... | |
~Value () | |
Destructor, responsible for removing the reference from the GC's view. More... | |
void | operator= (Obj o) |
void | operator= (Value &o) |
operator Obj () | |
bool | isInteger () |
Returns true if this object is a small integer, false otherwise. More... | |
int | getIntValue () |
Returns the integer value of this object, if it is a small integer. More... | |
Value wraps an object pointer.
It is responsible for informing the garbage collector that the object is referenced outside of the GC'd heap and so should not be deallocated.
Note that the GC tracks the stack, so it is not necessary to use this class for object pointers stored purely on the stack.
Definition at line 25 of file interpreter.hh.
|
inline |
Default constructor, the value is null.
Definition at line 57 of file interpreter.hh.
|
inline |
Construct a new value from an object pointer.
Definition at line 61 of file interpreter.hh.
|
inline |
Copy constructor.
Definition at line 65 of file interpreter.hh.
|
inline |
Move constructor.
Definition at line 69 of file interpreter.hh.
Interpreter::Value::~Value | ( | ) |
Destructor, responsible for removing the reference from the GC's view.
Definition at line 313 of file interpreter.cc.
|
inline |
Returns the address of the object.
This is used so that the storage can be used for values in a symbol table. All globals are handled by creating an instance of this class and then adding the address to the symbol table.
Definition at line 50 of file interpreter.hh.
|
inline |
Returns the integer value of this object, if it is a small integer.
Definition at line 94 of file interpreter.hh.
|
inline |
Returns true if this object is a small integer, false otherwise.
Definition at line 87 of file interpreter.hh.
|
inline |
Definition at line 80 of file interpreter.hh.
|
inline |
Definition at line 78 of file interpreter.hh.
|
inline |
Definition at line 79 of file interpreter.hh.