Into

Modules

Documentation

classPiiProxySocket

#include <PiiProxySocket.h>

An input-output socket.

Inherits PiiSocket, PiiAbstractOutputSocket, PiiAbstractInputSocket, PiiInputController

Description

This socket implements both PiiAbstractOutputSocket and PiiAbstractInputSocket, and works as a PiiInputController for itself. It merely passes all incoming objects to the output.

Constructors and destructor

Public member functions

Returns a pointer to this socket as PiiAbstractInputSocket, if this socket is either an Input or a Proxy.

Returns a pointer to this socket as PiiAbstractOutputSocket, if this socket is either an Output or a Proxy.

virtual PiiInputController *

Returns the input controller.

virtual void

Indicates this output socket that input is ready to receive new objects.

void
( )

Finds (backwards) the most distant output connected to this socket through proxies.

bool
(
  • bool connected
)
virtual PiiProxySocket *
( )

Returns a pointer to this socket as a PiiSocket.

virtual bool
( )

Activate any functionality that should be performed when a new object arrives into an input.

virtual Type
( )

Returns Proxy.

Protected member functions

virtual void

Called by connectInput() when an input has been connected.

virtual void

Called by disconnectInput() when an input has been disconnected.

Function details

  • PiiProxySocket

    ()
  • ~PiiProxySocket

    ()
  • virtual PiiAbstractInputSocket * asInput

    ()
    [virtual]

    Returns a pointer to this socket as PiiAbstractInputSocket, if this socket is either an Input or a Proxy.

    Otherwise returns zero.

    Reimplemented from PiiSocket.

  • virtual PiiAbstractOutputSocket * asOutput

    ()
    [virtual]

    Returns a pointer to this socket as PiiAbstractOutputSocket, if this socket is either an Output or a Proxy.

    Otherwise returns zero.

    Reimplemented from PiiSocket.

  • virtual PiiInputController * controller

    ()
    [virtual]

    Returns the input controller.

    Input controller is responsible for handling all incoming objects to this socket. Typically, a single controller is shared by all inputs within an operation. This allows the controller to synchronize inputs with respect to each other.

    Reimplemented from PiiAbstractInputSocket.

  • virtual void inputReady

    [virtual]

    Indicates this output socket that input is ready to receive new objects.

    Used in communications between socket pairs.

    Reimplemented from PiiAbstractOutputSocket.

  • void reset

    ()
  • PiiAbstractOutputSocket * rootOutput

    ()

    Finds (backwards) the most distant output connected to this socket through proxies.

    If the output is connected to an operation, this function returns this. Otherwise it goes recursively back through all proxies until it finds an output that is connected to an operation. If there is no such output, returns 0.

    Reimplemented from PiiAbstractOutputSocket.

  • bool setInputConnected

    (
    • bool connected
    )
  • virtual PiiProxySocket * socket

    ()
    [virtual]

    Returns a pointer to this socket as a PiiSocket.

    This is the preferred way of performing a cross-cast, even if dynamic_cast would work in most cases.

    Reimplemented from PiiAbstractSocket.

  • virtual bool tryToReceive

    ( )
    [virtual]

    Activate any functionality that should be performed when a new object arrives into an input.

    This method is called by an input socket whenever a new object is received on it.

    Note that the function may not throw exceptions. If your implementation passes the incoming objects right away, you must catch the exceptions thrown by PiiOutputSocket::emitObject(), for example.

    Parameters
    sender

    a pointer to the socket that received the object

    object

    the object that was received

    Returns

    true if the object was accepted, false otherwise. Typically, an object is accepted if there is no blocking object in sender by calling PiiInputSocket::receive(). Note that true should be returned whenever the object is accepted for processing, even if the processing itself will fail.

    Reimplemented from PiiInputController.

  • virtual Type type

    ()
    [virtual]

    Returns Proxy.

    Reimplemented from PiiSocket.

  • virtual void inputConnected

    [protected, virtual]

    Called by connectInput() when an input has been connected.

    The default implementation does nothing.

    Reimplemented from PiiAbstractOutputSocket.

  • virtual void inputDisconnected

    [protected, virtual]

    Called by disconnectInput() when an input has been disconnected.

    The default implementation does nothing.

    Reimplemented from PiiAbstractOutputSocket.

Notes (0)

Add a note

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