The thread that runs SSCSM code. More...
#include <sscsm_environment.h>
Inheritance diagram for SSCSMEnvironment:
Collaboration diagram for SSCSMEnvironment:Public Member Functions | |
| SSCSMEnvironment (std::shared_ptr< StupidChannel > channel) | |
| ~SSCSMEnvironment () override | |
| SSCSMScripting * | getScript () |
| ModVFS * | getModVFS () |
| void | updateVFSFiles (std::vector< std::pair< std::string, std::string > > &&files) |
| std::optional< std::string_view > | readVFSFile (const std::string &path) |
| void | setFatalError (const std::string &reason) |
| template<typename RQ > | |
| RQ::Answer | doRequest (RQ &&rq) |
Public Member Functions inherited from Thread | |
| Thread (const std::string &name="") | |
| virtual | ~Thread () |
| bool | start () |
| bool | stop () |
| bool | wait () |
| bool | isCurrentThread () const |
| bool | isRunning () const |
| bool | stopRequested () const |
| std::thread::id | getThreadId () const |
| bool | getReturnValue (void **ret) const |
| bool | bindToProcessor (unsigned int proc_number) |
| bool | setPriority (int prio) |
Private Member Functions | |
| void * | run () override |
| SerializedSSCSMAnswer | exchange (SerializedSSCSMRequest req) |
Private Attributes | |
| std::shared_ptr< StupidChannel > | m_channel |
| std::unique_ptr< SSCSMScripting > | m_script |
| std::unique_ptr< ModVFS > | m_vfs |
Additional Inherited Members | |
Static Public Member Functions inherited from Thread | |
| static Thread * | getCurrentThread () |
| static void | setName (const std::string &name) |
| static unsigned int | getNumberOfProcessors () |
Protected Attributes inherited from Thread | |
| std::string | m_name |
The thread that runs SSCSM code.
Meant to be replaced by a sandboxed process.
RAII-owns and abstracts away resources to communicate to the main process / thread.
See also SSCSMController for other side.
| SSCSMEnvironment::SSCSMEnvironment | ( | std::shared_ptr< StupidChannel > | channel | ) |
|
overridedefault |
|
inline |
References deserializeSSCSMAnswer(), exchange(), and serializeSSCSMRequest().
Referenced by run(), and setFatalError().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References StupidChannel::exchangeA(), and m_channel.
Referenced by doRequest().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_script.
Referenced by SSCSMEventLoadMods::exec(), and SSCSMEventOnStep::exec().
Here is the caller graph for this function:| std::optional< std::string_view > SSCSMEnvironment::readVFSFile | ( | const std::string & | path | ) |
References ModVFS::m_vfs, and m_vfs.
|
overrideprivatevirtual |
Implements Thread.
References doRequest(), setFatalError(), and BaseException::what().
Here is the call graph for this function:| void SSCSMEnvironment::setFatalError | ( | const std::string & | reason | ) |
References doRequest(), and SSCSMRequestSetFatalError::reason.
Referenced by run().
Here is the call graph for this function:
Here is the caller graph for this function:| void SSCSMEnvironment::updateVFSFiles | ( | std::vector< std::pair< std::string, std::string > > && | files | ) |
References ModVFS::m_vfs, m_vfs, and p().
Referenced by SSCSMEventUpdateVFSFiles::exec().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by exchange().
|
private |
Referenced by getScript().
|
private |
Referenced by getModVFS(), readVFSFile(), and updateVFSFiles().