Into

Modules

Documentation

classPiiNetworkOutputOperation

#include <PiiNetworkOutputOperation.h>

Inherits PiiNetworkOperation

Description

Inputs

server urithe URI to which data is to be sent (QString). This input is optional. If it is not connected, the serverUri property will be used.
inputXa configurable number of input sockets. X is a zero-based index. The number of input sockets and their alias names can be configured with the inputNames property.

Outputs

outputXa configurable number of input sockets. If the server responds with properly encoded values, they will be sent to the corresponding output sockets. The number of output sockets and their alias names can be configured with the outputNames property.

Properties

HTTP request method.

The URI of the server to send the data to, for example "tcp://localhost:8080/sum".

Public types

enum
{ PostRequest, GetRequest }

Supported HTTP request methods.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

void
( )
void
( )

Protected member functions

virtual void

Executes one round of processing.

Property details

  • RequestMethod requestMethod

    [read, write]

    HTTP request method.

    The default is PostRequest.

  • QString serverUri

    [read, write]

    The URI of the server to send the data to, for example "tcp://localhost:8080/sum".

    See PiiHttpServer for supported URI schemes. There is no default value.

Enumeration details

  • enum RequestMethod

    Supported HTTP request methods.

    • PostRequest - input objects are marshalled and sent as a sequence of HTTP POST requests.

    • GetRequest - input objects are encoded into the request URI. A HTTP GET request will be sent. This method works only if all input objects are primitive types or strings. It cannot be used with the body input connected.

Function details

  • PiiNetworkOutputOperation

    ()
  • ~PiiNetworkOutputOperation

    ()
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiNetworkOperation.

  • RequestMethod requestMethod

    ()
  • QString serverUri

    ()
  • void setRequestMethod

    ( )
  • void setServerUri

    ( )
  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.