Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Script::Request Class Reference

#include <Request.h>

Collaboration diagram for Script::Request:

Public Member Functions

 Request (const Interface &scriptInterface)
 NB: the definitions are in scriptinterface.cpp, because these access members of the PImpled implementation of Interface, and that seemed more convenient. More...
 
 Request (const Interface *scriptInterface)
 
 Request (std::shared_ptr< Interface > scriptInterface)
 
 ~Request ()
 
 Request (JSContext *cx)
 Create a script request from a JSContext. More...
 
const Interface & GetScriptInterface () const
 Return the scriptInterface active when creating this Request. More...
 
JS::Value globalValue () const
 

Public Attributes

JSContext * cx
 
JS::HandleObject glob
 
JS::HandleObject nativeScope
 

Private Member Functions

 Request ()=delete
 
 Request (const Request &rq)=delete
 
Request & operator= (const Request &rq)=delete
 

Private Attributes

const Interface & m_ScriptInterface
 
JS::Realm * m_FormerRealm
 

Constructor & Destructor Documentation

◆ Request() [1/6]

Script::Request::Request ( )
privatedelete

◆ Request() [2/6]

Script::Request::Request ( const Request &  rq)
privatedelete

◆ Request() [3/6]

Script::Request::Request ( const Interface &  scriptInterface)

NB: the definitions are in scriptinterface.cpp, because these access members of the PImpled implementation of Interface, and that seemed more convenient.

Constructor for Request - here because it needs access into Interface_impl.

◆ Request() [4/6]

Script::Request::Request ( const Interface *  scriptInterface)
inline

◆ Request() [5/6]

Script::Request::Request ( std::shared_ptr< Interface >  scriptInterface)
inline

◆ ~Request()

Script::Request::~Request ( )

◆ Request() [6/6]

Script::Request::Request ( JSContext *  cx)

Create a script request from a JSContext.

This can be used to get the script interface in a JSNative function. In general, you shouldn't have to rely on this otherwise.

Member Function Documentation

◆ GetScriptInterface()

const Interface & Script::Request::GetScriptInterface ( ) const

Return the scriptInterface active when creating this Request.

Note that this is multi-request safe: even if another Request is created, it will point to the original scriptInterface, and thus can be used to re-enter the realm.

◆ globalValue()

JS::Value Script::Request::globalValue ( ) const

◆ operator=()

Request & Script::Request::operator= ( const Request &  rq)
privatedelete

Member Data Documentation

◆ cx

JSContext* Script::Request::cx

◆ glob

JS::HandleObject Script::Request::glob

◆ m_FormerRealm

JS::Realm* Script::Request::m_FormerRealm
private

◆ m_ScriptInterface

const Interface& Script::Request::m_ScriptInterface
private

◆ nativeScope

JS::HandleObject Script::Request::nativeScope

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