openMSX
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
openmsx::Reactor Class Referencefinal

Contains the main loop of openMSX. More...

#include <Reactor.hh>

Inheritance diagram for openmsx::Reactor:
Inheritance graph
[legend]
Collaboration diagram for openmsx::Reactor:
Collaboration graph
[legend]

Public Types

using Board = std::shared_ptr< MSXMotherBoard >
 

Public Member Functions

 Reactor ()
 
void init ()
 
 ~Reactor ()
 
void runStartupScripts (const CommandLineParser &parser)
 
void powerOn ()
 
void run ()
 
void enterMainLoop ()
 
ShortcutsgetShortcuts ()
 
RTSchedulergetRTScheduler ()
 
EventDistributorgetEventDistributor ()
 
GlobalCliCommgetGlobalCliComm ()
 
GlobalCommandControllergetGlobalCommandController ()
 
InputEventGeneratorgetInputEventGenerator ()
 
DisplaygetDisplay ()
 
MixergetMixer ()
 
DiskFactorygetDiskFactory ()
 
DiskManipulatorgetDiskManipulator ()
 
EnumSetting< int > & getMachineSetting ()
 
FilePoolgetFilePool ()
 
ImGuiManagergetImGuiManager ()
 
const HotKeygetHotKey () const
 
SymbolManagergetSymbolManager () const
 
AviRecordergetRecorder () const
 
RomDatabasegetSoftwareDatabase ()
 
void switchMachine (const std::string &machine)
 
MSXMotherBoardgetMotherBoard () const
 
const MsxChar2UnicodegetMsxChar2Unicode () const
 
void block ()
 
void unblock ()
 
GlobalSettingsgetGlobalSettings ()
 
InfoCommandgetOpenMSXInfoCommand ()
 
CommandControllergetCommandController ()
 
CliCommgetCliComm ()
 
InterpretergetInterpreter ()
 
std::string_view getMachineID () const
 
Board createEmptyMotherBoard ()
 
void replaceBoard (MSXMotherBoard &oldBoard, Board newBoard)
 
Board getMachine (std::string_view machineID) const
 
bool isFullyStarted () const
 
auto getMachineIDs () const
 

Static Public Member Functions

static std::vector< std::string > getHwConfigs (std::string_view type)
 

Friends

class MachineCommand
 
class TestMachineCommand
 
class CreateMachineCommand
 
class DeleteMachineCommand
 
class ListMachinesCommand
 
class ActivateMachineCommand
 
class StoreMachineCommand
 
class RestoreMachineCommand
 

Detailed Description

Contains the main loop of openMSX.

openMSX is almost single threaded: the main thread does most of the work, we create additional threads only if we need blocking calls for communicating with peripherals. This class serializes all incoming requests so they can be handled by the main thread.

Definition at line 74 of file Reactor.hh.

Member Typedef Documentation

◆ Board

using openmsx::Reactor::Board = std::shared_ptr<MSXMotherBoard>

Definition at line 124 of file Reactor.hh.

Constructor & Destructor Documentation

◆ Reactor()

openmsx::Reactor::Reactor ( )
default

◆ ~Reactor()

openmsx::Reactor::~Reactor ( )

Member Function Documentation

◆ block()

void openmsx::Reactor::block ( )

Definition at line 631 of file Reactor.cc.

References enterMainLoop(), getMixer(), and openmsx::Mixer::mute().

Referenced by openmsx::MSXCPUInterface::doBreak().

◆ createEmptyMotherBoard()

Reactor::Board openmsx::Reactor::createEmptyMotherBoard ( )

◆ enterMainLoop()

void openmsx::Reactor::enterMainLoop ( )

Definition at line 520 of file Reactor.cc.

References openmsx::Thread::isMainThread().

Referenced by block(), and openmsx::EventDistributor::distributeEvent().

◆ getCliComm()

CliComm & openmsx::Reactor::getCliComm ( )

◆ getCommandController()

CommandController & openmsx::Reactor::getCommandController ( )

Definition at line 333 of file Reactor.cc.

Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().

◆ getDiskFactory()

DiskFactory & openmsx::Reactor::getDiskFactory ( )
inline

Definition at line 95 of file Reactor.hh.

◆ getDiskManipulator()

DiskManipulator & openmsx::Reactor::getDiskManipulator ( )
inline

Definition at line 96 of file Reactor.hh.

Referenced by openmsx::DiskChanger::~DiskChanger().

◆ getDisplay()

Display & openmsx::Reactor::getDisplay ( )
inline

◆ getEventDistributor()

EventDistributor & openmsx::Reactor::getEventDistributor ( )
inline

◆ getFilePool()

FilePool & openmsx::Reactor::getFilePool ( )
inline

◆ getGlobalCliComm()

GlobalCliComm & openmsx::Reactor::getGlobalCliComm ( )
inline

◆ getGlobalCommandController()

GlobalCommandController & openmsx::Reactor::getGlobalCommandController ( )
inline

◆ getGlobalSettings()

GlobalSettings & openmsx::Reactor::getGlobalSettings ( )
inline

◆ getHotKey()

const HotKey & openmsx::Reactor::getHotKey ( ) const

Definition at line 343 of file Reactor.cc.

Referenced by openmsx::ImGuiMachine::showMenu().

◆ getHwConfigs()

vector< string > openmsx::Reactor::getHwConfigs ( std::string_view  type)
static

◆ getImGuiManager()

ImGuiManager & openmsx::Reactor::getImGuiManager ( )
inline

◆ getInputEventGenerator()

InputEventGenerator & openmsx::Reactor::getInputEventGenerator ( )
inline

◆ getInterpreter()

Interpreter & openmsx::Reactor::getInterpreter ( )

◆ getMachine()

Reactor::Board openmsx::Reactor::getMachine ( std::string_view  machineID) const

◆ getMachineID()

string_view openmsx::Reactor::getMachineID ( ) const

◆ getMachineIDs()

auto openmsx::Reactor::getMachineIDs ( ) const
inline

◆ getMachineSetting()

EnumSetting< int > & openmsx::Reactor::getMachineSetting ( )
inline

Definition at line 97 of file Reactor.hh.

Referenced by openmsx::CommandLineParser::parse().

◆ getMixer()

Mixer & openmsx::Reactor::getMixer ( )

Definition at line 307 of file Reactor.cc.

Referenced by block(), and unblock().

◆ getMotherBoard()

MSXMotherBoard * openmsx::Reactor::getMotherBoard ( ) const

◆ getMsxChar2Unicode()

const MsxChar2Unicode & openmsx::Reactor::getMsxChar2Unicode ( ) const

Definition at line 374 of file Reactor.cc.

References getMotherBoard().

◆ getOpenMSXInfoCommand()

InfoCommand & openmsx::Reactor::getOpenMSXInfoCommand ( )

Definition at line 338 of file Reactor.cc.

Referenced by init(), and openmsx::CommandLineParser::parse().

◆ getRecorder()

AviRecorder & openmsx::Reactor::getRecorder ( ) const
inline

Definition at line 102 of file Reactor.hh.

◆ getRTScheduler()

RTScheduler & openmsx::Reactor::getRTScheduler ( )
inline

◆ getShortcuts()

Shortcuts & openmsx::Reactor::getShortcuts ( )
inline

Definition at line 87 of file Reactor.hh.

Referenced by openmsx::ImGuiManager::getShortcuts().

◆ getSoftwareDatabase()

RomDatabase & openmsx::Reactor::getSoftwareDatabase ( )

◆ getSymbolManager()

SymbolManager & openmsx::Reactor::getSymbolManager ( ) const
inline

Definition at line 101 of file Reactor.hh.

◆ init()

void openmsx::Reactor::init ( )

◆ isFullyStarted()

bool openmsx::Reactor::isFullyStarted ( ) const
inline

Definition at line 129 of file Reactor.hh.

Referenced by openmsx::ImGuiTrainer::paint().

◆ powerOn()

void openmsx::Reactor::powerOn ( )

Definition at line 577 of file Reactor.cc.

◆ replaceBoard()

void openmsx::Reactor::replaceBoard ( MSXMotherBoard oldBoard,
Board  newBoard 
)

Definition at line 434 of file Reactor.cc.

References find_unguarded(), openmsx::Thread::isMainThread(), and move_pop_back().

◆ run()

void openmsx::Reactor::run ( )

Definition at line 590 of file Reactor.cc.

◆ runStartupScripts()

void openmsx::Reactor::runStartupScripts ( const CommandLineParser parser)

◆ switchMachine()

void openmsx::Reactor::switchMachine ( const std::string &  machine)

◆ unblock()

void openmsx::Reactor::unblock ( )

Definition at line 638 of file Reactor.cc.

References getMixer(), and openmsx::Mixer::unmute().

Referenced by openmsx::MSXCPUInterface::doContinue().

Friends And Related Symbol Documentation

◆ ActivateMachineCommand

friend class ActivateMachineCommand
friend

Definition at line 222 of file Reactor.hh.

◆ CreateMachineCommand

friend class CreateMachineCommand
friend

Definition at line 219 of file Reactor.hh.

◆ DeleteMachineCommand

friend class DeleteMachineCommand
friend

Definition at line 220 of file Reactor.hh.

◆ ListMachinesCommand

friend class ListMachinesCommand
friend

Definition at line 221 of file Reactor.hh.

◆ MachineCommand

friend class MachineCommand
friend

Definition at line 217 of file Reactor.hh.

◆ RestoreMachineCommand

friend class RestoreMachineCommand
friend

Definition at line 224 of file Reactor.hh.

◆ StoreMachineCommand

friend class StoreMachineCommand
friend

Definition at line 223 of file Reactor.hh.

◆ TestMachineCommand

friend class TestMachineCommand
friend

Definition at line 218 of file Reactor.hh.


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