Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Script::ModuleLoader::Future Class Reference

The future is fulfilled once the evaluation of the module completes. More...

#include <ModuleLoader.h>

Classes

struct  Evaluating
 
struct  Fulfilled
 
struct  Invalid
 
struct  Rejected
 
struct  WaitingForFileChange
 

Public Types

using Status = std::variant< Evaluating, Fulfilled, Rejected, WaitingForFileChange, Invalid >
 

Public Member Functions

 Future (const Script::Request &rq, ModuleLoader &reqistry, Result &result, VfsPath modulePath)
 
 Future ()=default
 
 Future (const Future &)=delete
 
Future & operator= (const Future &)=delete
 
 Future (Future &&other) noexcept
 
Future & operator= (Future &&other) noexcept
 
 ~Future ()
 
bool IsDone () const noexcept
 
JSObject * Get ()
 Throws if the evaluation of the module failed. More...
 

Private Member Functions

bool IsWaiting () const noexcept
 
void SetWaiting () noexcept
 
void SetReservedSlot (JS::Value privateValue) noexcept
 

Private Attributes

friend Result
 
Status m_Status {Invalid{}}
 

Detailed Description

The future is fulfilled once the evaluation of the module completes.

Note: The evaluation might not be started yet.

Member Typedef Documentation

◆ Status

Constructor & Destructor Documentation

◆ Future() [1/4]

Script::ModuleLoader::Future::Future ( const Script::Request &  rq,
ModuleLoader &  reqistry,
Result &  result,
VfsPath  modulePath 
)
explicit

◆ Future() [2/4]

Script::ModuleLoader::Future::Future ( )
default

◆ Future() [3/4]

Script::ModuleLoader::Future::Future ( const Future &  )
delete

◆ Future() [4/4]

Script::ModuleLoader::Future::Future ( Future &&  other)
noexcept

◆ ~Future()

Script::ModuleLoader::Future::~Future ( )

Member Function Documentation

◆ Get()

JSObject * Script::ModuleLoader::Future::Get ( )

Throws if the evaluation of the module failed.

Returns
The module namespace. All exported values are a property of this object. default is a property with name "default".

◆ IsDone()

bool Script::ModuleLoader::Future::IsDone ( ) const
noexcept

◆ IsWaiting()

bool Script::ModuleLoader::Future::IsWaiting ( ) const
privatenoexcept

◆ operator=() [1/2]

Future & Script::ModuleLoader::Future::operator= ( const Future &  )
delete

◆ operator=() [2/2]

ModuleLoader::Future & Script::ModuleLoader::Future::operator= ( Future &&  other)
noexcept

◆ SetReservedSlot()

void Script::ModuleLoader::Future::SetReservedSlot ( JS::Value  privateValue)
privatenoexcept

◆ SetWaiting()

void Script::ModuleLoader::Future::SetWaiting ( )
privatenoexcept

Member Data Documentation

◆ m_Status

Status Script::ModuleLoader::Future::m_Status {Invalid{}}
private

◆ Result

friend Script::ModuleLoader::Future::Result
private

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