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 run (CommandLineParser &parser)
 Main loop. More...
 
void enterMainLoop ()
 
RTSchedulergetRTScheduler ()
 
EventDistributorgetEventDistributor ()
 
GlobalCliCommgetGlobalCliComm ()
 
GlobalCommandControllergetGlobalCommandController ()
 
InputEventGeneratorgetInputEventGenerator ()
 
DisplaygetDisplay ()
 
MixergetMixer ()
 
DiskFactorygetDiskFactory ()
 
DiskManipulatorgetDiskManipulator ()
 
EnumSetting< int > & getMachineSetting ()
 
FilePoolgetFilePool ()
 
RomDatabasegetSoftwareDatabase ()
 
void switchMachine (const std::string &machine)
 
MSXMotherBoardgetMotherBoard () const
 
void block ()
 
void unblock ()
 
GlobalSettingsgetGlobalSettings ()
 
InfoCommandgetOpenMSXInfoCommand ()
 
CommandControllergetCommandController ()
 
CliCommgetCliComm ()
 
InterpretergetInterpreter ()
 
std::string_view getMachineID () const
 
Board createEmptyMotherBoard ()
 
void replaceBoard (MSXMotherBoard &oldBoard, Board newBoard)
 
bool isFullyStarted () 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 67 of file Reactor.hh.

Member Typedef Documentation

◆ Board

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

Definition at line 111 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 601 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 487 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 323 of file Reactor.cc.

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

◆ getDiskFactory()

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

Definition at line 88 of file Reactor.hh.

◆ getDiskManipulator()

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

Definition at line 89 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

◆ getHwConfigs()

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

◆ getInputEventGenerator()

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

Definition at line 85 of file Reactor.hh.

Referenced by openmsx::EventDistributor::deliverEvents().

◆ getInterpreter()

Interpreter & openmsx::Reactor::getInterpreter ( )

◆ getMachineID()

string_view openmsx::Reactor::getMachineID ( ) const

◆ getMachineSetting()

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

Definition at line 90 of file Reactor.hh.

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

◆ getMixer()

Mixer & openmsx::Reactor::getMixer ( )

Definition at line 297 of file Reactor.cc.

Referenced by block(), and unblock().

◆ getMotherBoard()

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

◆ getOpenMSXInfoCommand()

InfoCommand & openmsx::Reactor::getOpenMSXInfoCommand ( )

Definition at line 328 of file Reactor.cc.

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

◆ getRTScheduler()

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

◆ getSoftwareDatabase()

RomDatabase & openmsx::Reactor::getSoftwareDatabase ( )

Definition at line 305 of file Reactor.cc.

Referenced by openmsx::RomFactory::create(), and openmsx::SoftwareInfoTopic::execute().

◆ init()

void openmsx::Reactor::init ( )

◆ isFullyStarted()

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

Definition at line 115 of file Reactor.hh.

◆ replaceBoard()

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

Definition at line 400 of file Reactor.cc.

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

◆ run()

void openmsx::Reactor::run ( CommandLineParser parser)

◆ switchMachine()

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

◆ unblock()

void openmsx::Reactor::unblock ( )

Definition at line 608 of file Reactor.cc.

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

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

Friends And Related Function Documentation

◆ ActivateMachineCommand

friend class ActivateMachineCommand
friend

Definition at line 212 of file Reactor.hh.

◆ CreateMachineCommand

friend class CreateMachineCommand
friend

Definition at line 209 of file Reactor.hh.

◆ DeleteMachineCommand

friend class DeleteMachineCommand
friend

Definition at line 210 of file Reactor.hh.

◆ ListMachinesCommand

friend class ListMachinesCommand
friend

Definition at line 211 of file Reactor.hh.

◆ MachineCommand

friend class MachineCommand
friend

Definition at line 207 of file Reactor.hh.

◆ RestoreMachineCommand

friend class RestoreMachineCommand
friend

Definition at line 214 of file Reactor.hh.

◆ StoreMachineCommand

friend class StoreMachineCommand
friend

Definition at line 213 of file Reactor.hh.

◆ TestMachineCommand

friend class TestMachineCommand
friend

Definition at line 208 of file Reactor.hh.


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