• JsonReply
  • JsonReply Class

    (nymeaserver::JsonReply)

    This class represents a reply for the JSON-RPC API request. More...

    Header: #include <JsonReply>
    Inherits:

    Public Types

    enum Type { TypeSync, TypeAsync }

    Public Functions

    QUuid clientId() const
    int commandId() const
    QVariantMap data() const
    JsonHandler * handler() const
    QString method() const
    void setClientId(const QUuid & clientId)
    void setCommandId(int commandId)
    void setData(const QVariantMap & data)
    bool timedOut() const
    Type type() const

    Public Slots

    void startWait()

    Signals

    void finished()

    Static Public Members

    JsonReply * createAsyncReply(JsonHandler * handler, const QString & method)
    JsonReply * createReply(JsonHandler * handler, const QVariantMap & data)

    Detailed Description

    This class represents a reply for the JSON-RPC API request.

    See also JsonHandler and JsonRPCServer.

    Member Type Documentation

    enum JsonReply::Type

    This enum type specifies the type of a JsonReply.

    ConstantValueDescription
    nymeaserver::JsonReply::TypeSync0The response is synchronous.
    nymeaserver::JsonReply::TypeAsync1The response is asynchronous.

    Member Function Documentation

    QUuid JsonReply::clientId() const

    Returns the client ID of this JsonReply.

    See also setClientId().

    int JsonReply::commandId() const

    Returns the command ID of this JsonReply.

    See also setCommandId().

    [static] JsonReply * JsonReply::createAsyncReply(JsonHandler * handler, const QString & method)

    Returns the pointer to a new asynchronous JsonReply for the given handler and method.

    [static] JsonReply * JsonReply::createReply(JsonHandler * handler, const QVariantMap & data)

    Returns the pointer to a new JsonReply for the given handler and data.

    QVariantMap JsonReply::data() const

    Returns the data of this JsonReply.

    See also setData().

    [signal] void JsonReply::finished()

    This signal will be emitted when a JsonReply is finished. A JsonReply is finished when the response is ready or then the reply timed out.

    JsonHandler * JsonReply::handler() const

    Returns the handler of this JsonReply.

    QString JsonReply::method() const

    Returns the method of this JsonReply.

    void JsonReply::setClientId(const QUuid & clientId)

    Sets the clientId of this JsonReply.

    See also clientId().

    void JsonReply::setCommandId(int commandId)

    Returns the commandId of this JsonReply.

    See also commandId().

    void JsonReply::setData(const QVariantMap & data)

    Sets the data of this JsonReply.

    See also data().

    [slot] void JsonReply::startWait()

    Start the timeout timer for this JsonReply. The default timeout is 15 seconds.

    bool JsonReply::timedOut() const

    Returns true if this JsonReply timed out.

    Type JsonReply::type() const

    Returns the type of this JsonReply.