ArkScript
A small, fast, functional and scripting language for video games
Ark::internal::Closure Class Reference

Closure management. More...

#include <Closure.hpp>

+ Collaboration diagram for Ark::internal::Closure:

Public Member Functions

 Closure () noexcept
 Construct a new Closure object.
 
 Closure (Scope_t &&scope_ptr, PageAddr_t pa) noexcept
 Construct a new Closure object.
 
 Closure (const Scope_t &scope_ptr, PageAddr_t pa) noexcept
 Construct a new Closure object.
 
const Scope_tscope () const noexcept
 Return the scope held by the object.
 
Scope_trefScope () noexcept
 Return a reference to the scpoe held by the object.
 
PageAddr_t pageAddr () const
 Return the page address of the object.
 
void toString (std::ostream &os, VM &vm) const noexcept
 Print the closure to a string.
 

Private Attributes

Scope_t m_scope
 
PageAddr_t m_page_addr
 

Friends

ARK_API_INLINE bool operator== (const Closure &A, const Closure &B) noexcept
 
ARK_API_INLINE bool operator< (const Closure &A, const Closure &B) noexcept
 

Detailed Description

Closure management.

Definition at line 44 of file Closure.hpp.

Constructor & Destructor Documentation

◆ Closure() [1/3]

Ark::internal::Closure::Closure ( )
noexcept

Construct a new Closure object.

Definition at line 9 of file Closure.cpp.

◆ Closure() [2/3]

Ark::internal::Closure::Closure ( Scope_t &&  scope_ptr,
PageAddr_t  pa 
)
noexcept

Construct a new Closure object.

Parameters
scope_ptrthe scope of the function turned into a closure
pathe current page address of the function turned into a closure

Definition at line 14 of file Closure.cpp.

◆ Closure() [3/3]

Ark::internal::Closure::Closure ( const Scope_t scope_ptr,
PageAddr_t  pa 
)
noexcept

Construct a new Closure object.

Parameters
scope_ptrthe scope of the function turned into a closure
pathe current page address of the function turned into a closure

Definition at line 19 of file Closure.cpp.

Member Function Documentation

◆ pageAddr()

PageAddr_t Ark::internal::Closure::pageAddr ( ) const
inline

Return the page address of the object.

Returns
PageAddr_t

Definition at line 88 of file Closure.hpp.

References m_page_addr.

◆ refScope()

Scope_t & Ark::internal::Closure::refScope ( )
noexcept

Return a reference to the scpoe held by the object.

Returns
Scope_t&

Definition at line 29 of file Closure.cpp.

References m_scope.

◆ scope()

const Scope_t & Ark::internal::Closure::scope ( ) const
noexcept

Return the scope held by the object.

Returns
const Scope_t&

Definition at line 24 of file Closure.cpp.

References m_scope.

Referenced by Ark::VM::safeRun().

◆ toString()

void Ark::internal::Closure::toString ( std::ostream &  os,
VM vm 
) const
noexcept

Print the closure to a string.

Parameters
os
vm

Definition at line 34 of file Closure.cpp.

Friends And Related Function Documentation

◆ operator<

ARK_API_INLINE bool operator< ( const Closure A,
const Closure B 
)
friend

Definition at line 112 of file Closure.hpp.

◆ operator==

ARK_API_INLINE bool operator== ( const Closure A,
const Closure B 
)
friend

Definition at line 107 of file Closure.hpp.

Member Data Documentation

◆ m_page_addr

PageAddr_t Ark::internal::Closure::m_page_addr
private

Definition at line 104 of file Closure.hpp.

Referenced by pageAddr().

◆ m_scope

Scope_t Ark::internal::Closure::m_scope
private

Definition at line 102 of file Closure.hpp.

Referenced by refScope(), and scope().


The documentation for this class was generated from the following files: