Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
openmsx::CliConnection Class Referenceabstract

#include <CliConnection.hh>

Inheritance diagram for openmsx::CliConnection:
Inheritance graph
Collaboration diagram for openmsx::CliConnection:
Collaboration graph

Public Member Functions

void setUpdateEnable (CliComm::UpdateType type, bool value)
bool getUpdateEnable (CliComm::UpdateType type) const
void start ()
 Starts the helper thread. More...
- Public Member Functions inherited from openmsx::CliListener
 CliListener (const CliListener &)=delete
CliListeneroperator= (const CliListener &)=delete
virtual ~CliListener ()=default
virtual void log (CliComm::LogLevel level, std::string_view message, float fraction) noexcept=0
virtual void update (CliComm::UpdateType type, std::string_view machine, std::string_view name, std::string_view value) noexcept=0

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...
- Protected Member Functions inherited from openmsx::CliListener
 CliListener ()=default

Protected Attributes

AdhocCliCommParser parser
Poller poller

Detailed Description

Definition at line 20 of file CliConnection.hh.

Constructor & Destructor Documentation

◆ CliConnection()

openmsx::CliConnection::CliConnection ( CommandController commandController,
EventDistributor eventDistributor 

Definition at line 32 of file

◆ ~CliConnection()

openmsx::CliConnection::~CliConnection ( )

Member Function Documentation

◆ close()

virtual void openmsx::CliConnection::close ( )
protectedpure virtual

Close the connection.

After this method is called, calls to output() should be ignored.

Referenced by end().

◆ end()

void openmsx::CliConnection::end ( )

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 87 of file

References openmsx::Poller::abort(), close(), output(), and poller.

Referenced by openmsx::SocketConnection::~SocketConnection(), and openmsx::StdioConnection::~StdioConnection().

◆ getUpdateEnable()

bool openmsx::CliConnection::getUpdateEnable ( CliComm::UpdateType  type) const

Definition at line 26 of file CliConnection.hh.

◆ output()

virtual void openmsx::CliConnection::output ( std::string_view  message)
protectedpure virtual

Implemented in openmsx::StdioConnection, and openmsx::SocketConnection.

Referenced by end(), and startOutput().

◆ setUpdateEnable()

void openmsx::CliConnection::setUpdateEnable ( CliComm::UpdateType  type,
bool  value 

Definition at line 23 of file CliConnection.hh.

◆ start()

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 82 of file

◆ startOutput()

void openmsx::CliConnection::startOutput ( )

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 77 of file

References output().

Referenced by openmsx::StdioConnection::StdioConnection().

Member Data Documentation

◆ parser

AdhocCliCommParser openmsx::CliConnection::parser

Definition at line 62 of file CliConnection.hh.

◆ poller

Poller openmsx::CliConnection::poller

Definition at line 63 of file CliConnection.hh.

Referenced by end(), and openmsx::SocketConnection::output().

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