wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ServerInfoHandler Class Reference

Handler for server information commands. More...

#include <ServerInfoHandler.h>

Inheritance diagram for ServerInfoHandler:
[legend]

Public Member Functions

QJsonObject handleCommand (const QString &command, const QJsonObject &params, const QJsonValue &requestId) override
 ServerInfoHandler (MainWindow *mainWindow, const MCPValidator *validator)
Public Member Functions inherited from BaseHandler
QString availableInputPorts (GraphicElement *element) const
QString availableOutputPorts (GraphicElement *element) const
 BaseHandler (MainWindow *mainWindow, const MCPValidator *validator)
QJsonObject createErrorResponse (const QString &error, const QJsonValue &requestId=QJsonValue(), int code=JsonRpcError::InternalError) const
QJsonObject createSuccessResponse (const QJsonObject &result={}, const QJsonValue &requestId=QJsonValue()) const
ScenecurrentScene ()
const ScenecurrentScene () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool inputPortByLabel (GraphicElement *element, const QString &label, int &portIndex, QString &errorMsg) const
bool outputPortByLabel (GraphicElement *element, const QString &label, int &portIndex, QString &errorMsg) const
template<typename Fn>
QJsonObject tryCommand (Fn &&fn, const QString &action, const QJsonValue &requestId=QJsonValue())
 Wraps fn in a try/catch, returning an error response on exception.
GraphicElementvalidatedElement (const QJsonObject &params, const QString &paramName, QString &errorMsg)
 Validates paramName in params, looks up the element, and returns it.
bool validateElementId (int elementId, const QString &paramName, QString &errorMsg) const
bool validateNonEmptyString (const QJsonValue &value, const QString &paramName, QString &errorMsg) const
bool validateNonNegativeInteger (const QJsonValue &value, const QString &paramName, QString &errorMsg) const
bool validateNumeric (const QJsonValue &value, const QString &paramName, QString &errorMsg) const
bool validateParameters (const QJsonObject &params, const QStringList &required) const
bool validatePortRange (GraphicElement *element, int portIndex, bool isOutput, const QString &paramName, QString &errorMsg) const
bool validatePositiveInteger (const QJsonValue &value, const QString &paramName, QString &errorMsg) const
virtual ~BaseHandler ()=default

Additional Inherited Members

Protected Member Functions inherited from BaseHandler
QString availablePorts (GraphicElement *element, bool isOutput) const
Protected Attributes inherited from BaseHandler
MainWindowm_mainWindow
const MCPValidatorm_validator

Detailed Description

Handler for server information commands.

Handles server information requests providing server capabilities, version information, and status.

Definition at line 15 of file ServerInfoHandler.h.

Constructor & Destructor Documentation

◆ ServerInfoHandler()

ServerInfoHandler::ServerInfoHandler ( MainWindow * mainWindow,
const MCPValidator * validator )
explicit

Definition at line 85 of file ServerInfoHandler.cpp.

References BaseHandler::BaseHandler().

Member Function Documentation

◆ handleCommand()

QJsonObject ServerInfoHandler::handleCommand ( const QString & command,
const QJsonObject & params,
const QJsonValue & requestId )
overridevirtual

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