Source · fairmq/
Poller.hpublic header
Defines struct fair::mq::Poller, struct fair::mq::PollerError.
Described in multiple-channels: data and broadcast, Poll several channels.
1/********************************************************************************2 * Copyright (C) 2021-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *3 * *4 * This software is distributed under the terms of the *5 * GNU Lesser General Public Licence (LGPL) version 3, *6 * copied verbatim in the file "LICENSE" *7 ********************************************************************************/8 9#ifndef FAIR_MQ_POLLER_H10#define FAIR_MQ_POLLER_H11 12#include <memory>13#include <stdexcept>14#include <string>15 16namespace fair::mq {17 18struct Poller19{20 Poller() = default;21 Poller(const Poller&) = delete;22 Poller(Poller&&) = delete;23 Poller& operator=(const Poller&) = delete;24 Poller& operator=(Poller&&) = delete;25 26 virtual void Poll(int timeout) = 0;27 virtual bool CheckInput(int index) = 0;28 virtual bool CheckOutput(int index) = 0;29 virtual bool CheckInput(const std::string& channelKey, int index) = 0;30 virtual bool CheckOutput(const std::string& channelKey, int index) = 0;31 32 virtual ~Poller() = default;33};34 35using PollerPtr = std::unique_ptr<Poller>;36 37struct PollerError : std::runtime_error38{39 using std::runtime_error::runtime_error;40};41 42} // namespace fair::mq43 44using FairMQPoller [[deprecated("Use fair::mq::Poller")]] = fair::mq::Poller;45using FairMQPollerPtr [[deprecated("Use fair::mq::PollerPtr")]] = fair::mq::PollerPtr;46 47#endif // FAIR_MQ_POLLER_H