![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
A class to store fields captured by a closure. More...
#include <ClosureScope.hpp>
Public Member Functions | |
ClosureScope () noexcept=default | |
Create a new ClosureScope. | |
void | push_back (uint16_t id, Value &&val) |
Put a value in the scope. | |
void | push_back (uint16_t id, const Value &val) |
Put a value in the scope. | |
Value * | operator[] (uint16_t id_to_look_for) |
void | mergeRefInto (ScopeView &other) |
Merge values from this scope as refs in the other scope. | |
Private Attributes | |
std::vector< std::pair< uint16_t, Value > > | m_data |
Friends | |
class | Closure |
ARK_API bool | operator== (const ClosureScope &A, const ClosureScope &B) |
A class to store fields captured by a closure.
Definition at line 28 of file ClosureScope.hpp.
|
defaultnoexcept |
Create a new ClosureScope.
void Ark::internal::ClosureScope::mergeRefInto | ( | ScopeView & | other | ) |
Merge values from this scope as refs in the other scope.
This scope must be kept alive for the ref to be used
other |
Definition at line 27 of file ClosureScope.cpp.
References m_data, Ark::internal::ScopeView::push_back(), and Ark::Reference.
Value * Ark::internal::ClosureScope::operator[] | ( | uint16_t | id_to_look_for | ) |
Definition at line 17 of file ClosureScope.cpp.
References m_data.
void Ark::internal::ClosureScope::push_back | ( | uint16_t | id, |
const Value & | val ) |
Put a value in the scope.
id | The symbol id of the variable |
val | The value linked to the symbol |
Definition at line 12 of file ClosureScope.cpp.
References m_data.
void Ark::internal::ClosureScope::push_back | ( | uint16_t | id, |
Value && | val ) |
Put a value in the scope.
id | The symbol id of the variable |
val | The value linked to the symbol |
Definition at line 7 of file ClosureScope.cpp.
References m_data.
|
friend |
Definition at line 61 of file ClosureScope.hpp.
|
friend |
Definition at line 38 of file ClosureScope.cpp.
|
private |
Definition at line 66 of file ClosureScope.hpp.
Referenced by mergeRefInto(), operator[](), push_back(), and push_back().