| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Qore::AbstractPollOperation Class Reference

Abstract poll operation objects provide the polling interface for pollable objects. More...

`#include <QC_AbstractPollOperation.dox.h>`

Inheritance diagram for Qore::AbstractPollOperation:
[legend]

## Public Member Functions
nothing | abort ()
| Aborts any asynchroous operation in progress and closes the connected object.
abstract *hash< SocketPollInfo > | continuePoll ()
| Returns a socket poll hash if polling should continue or NOTHING if complete.
abstract string | getGoal ()
| Returns the goal.
auto | getOutput ()
| Returns any output generated by any completed poll action.
abstract string | getState ()
| Returns the current state.
abstract bool | goalReached ()
| Returns True when the goal as been reached.

## Detailed Description

Abstract poll operation objects provide the polling interface for pollable objects.

This class implements polling logic for pollable operations and the state machine behind it

## Member Function Documentation

## ◆ abort()

nothing Qore::AbstractPollOperation::abort | ( |  | ) |

Aborts any asynchroous operation in progress and closes the connected object.

Reimplement in child classes to abort the operation

## ◆ continuePoll()

abstract *hash< SocketPollInfo > Qore::AbstractPollOperation::continuePoll | ( |  | ) |

Returns a socket poll hash if polling should continue or NOTHING if complete.

Returns
  NOTHING if there is no more to poll and the poll operation was successful (i.e. the goal was reached), otherwise this method must return a new socket poll hash to continue the polling operation with another operation, after which this method will be called again if a matching event is received for the socket. If a socket poll hash is returned, then the internal state is also updated.

## ◆ getGoal()

abstract string Qore::AbstractPollOperation::getGoal | ( |  | ) |

Returns the goal.

Returns
  the goal set in the constructor

## ◆ getOutput()

auto Qore::AbstractPollOperation::getOutput | ( |  | ) |

Returns any output generated by any completed poll action.

Code Flags:
  RET_VALUE_ONLY

Returns
  this base class method always returns NOTHING, reimplement in subclasses to change this behavior

## ◆ getState()

abstract string Qore::AbstractPollOperation::getState | ( |  | ) |

Returns the current state.

Returns
  the current state

## ◆ goalReached()

abstract bool Qore::AbstractPollOperation::goalReached | ( |  | ) |

Returns True when the goal as been reached.

Returns
  True when the goal as been reached