openMSX
|
#include <CliConnection.hh>
Public Member Functions | |
void | setUpdateEnable (CliComm::UpdateType type, bool value) |
bool | getUpdateEnable (CliComm::UpdateType type) const |
void | start () |
Starts the helper thread. More... | |
![]() | |
virtual | ~CliListener ()=default |
Protected Member Functions | |
CliConnection (CommandController &commandController, EventDistributor &eventDistributor) | |
~CliConnection () override | |
virtual void | output (std::string_view message)=0 |
void | end () |
End this connection by sending the closing tag and then closing the stream. More... | |
virtual void | close ()=0 |
Close the connection. More... | |
void | startOutput () |
Send opening XML tag, should be called exactly once by a subclass shortly after opening a connection. More... | |
![]() | |
CliListener ()=default | |
Protected Attributes | |
AdhocCliCommParser | parser |
Poller | poller |
Definition at line 19 of file CliConnection.hh.
|
protected |
Definition at line 67 of file CliConnection.cc.
References ranges::fill(), openmsx::OPENMSX_CLICOMMAND_EVENT, and openmsx::EventDistributor::registerEventListener().
Referenced by getUpdateEnable(), and openmsx::StdioConnection::output().
|
overrideprotected |
Definition at line 78 of file CliConnection.cc.
References openmsx::CliComm::getLevelStrings(), getUpdateEnable(), openmsx::CliComm::getUpdateStrings(), openmsx::OPENMSX_CLICOMMAND_EVENT, output(), strAppend(), strCat(), openmsx::EventDistributor::unregisterEventListener(), and openmsx::XMLElement::XMLEscape().
Referenced by getUpdateEnable().
|
protectedpure virtual |
Close the connection.
After this method is called, calls to output() should be ignored.
Referenced by end(), and getUpdateEnable().
|
protected |
End this connection by sending the closing tag and then closing the stream.
Subclasses should call this method at the start of their destructor.
Definition at line 118 of file CliConnection.cc.
References openmsx::Poller::abort(), close(), openmsx::EventDistributor::distributeEvent(), output(), poller, strCat(), and openmsx::XMLElement::XMLEscape().
Referenced by getUpdateEnable(), openmsx::StdioConnection::output(), openmsx::SocketConnection::~SocketConnection(), and openmsx::StdioConnection::~StdioConnection().
|
inline |
Definition at line 25 of file CliConnection.hh.
References CliConnection(), close(), end(), output(), start(), startOutput(), and ~CliConnection().
Referenced by ~CliConnection().
|
protectedpure virtual |
Implemented in openmsx::SocketConnection, and openmsx::StdioConnection.
Referenced by end(), getUpdateEnable(), startOutput(), and ~CliConnection().
|
inline |
Definition at line 22 of file CliConnection.hh.
Referenced by openmsx::GlobalCommandController::source().
void openmsx::CliConnection::start | ( | ) |
Starts the helper thread.
Called when this CliConnection is added to GlobalCliComm (and after it's allowed to respond to external commands). Subclasses should themself send the opening tag (startOutput()).
Definition at line 113 of file CliConnection.cc.
Referenced by getUpdateEnable().
|
protected |
Send opening XML tag, should be called exactly once by a subclass shortly after opening a connection.
Cannot be implemented in the base class because some subclasses (want to send data before this tag).
Definition at line 108 of file CliConnection.cc.
References output().
Referenced by getUpdateEnable(), openmsx::StdioConnection::output(), openmsx::StdioConnection::StdioConnection(), and openmsx::SocketConnection::~SocketConnection().
|
protected |
Definition at line 61 of file CliConnection.hh.
Referenced by openmsx::StdioConnection::output(), and openmsx::SocketConnection::~SocketConnection().
|
protected |
Definition at line 62 of file CliConnection.hh.
Referenced by end(), openmsx::SocketConnection::output(), openmsx::SocketConnection::~SocketConnection(), and openmsx::StdioConnection::~StdioConnection().