FairMQ  1.4.14
C++ Message Queuing Library and Framework
Poller.h
1 /********************************************************************************
2  * Copyright (C) 2014 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 #ifndef FAIR_MQ_SHMEM_POLLER_H_
9 #define FAIR_MQ_SHMEM_POLLER_H_
10 
11 #include <zmq.h>
12 
13 #include <FairMQPoller.h>
14 #include <FairMQChannel.h>
15 
16 #include <vector>
17 #include <unordered_map>
18 
19 class FairMQChannel;
20 
21 namespace fair
22 {
23 namespace mq
24 {
25 namespace shmem
26 {
27 
28 class Poller final : public fair::mq::Poller
29 {
30  public:
31  Poller(const std::vector<FairMQChannel>& channels);
32  Poller(const std::vector<FairMQChannel*>& channels);
33  Poller(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList);
34 
35  Poller(const Poller&) = delete;
36  Poller operator=(const Poller&) = delete;
37 
38  void SetItemEvents(zmq_pollitem_t& item, const int type);
39 
40  void Poll(const int timeout) override;
41  bool CheckInput(const int index) override;
42  bool CheckOutput(const int index) override;
43  bool CheckInput(const std::string& channelKey, const int index) override;
44  bool CheckOutput(const std::string& channelKey, const int index) override;
45 
46  ~Poller() override;
47 
48  private:
49  zmq_pollitem_t* fItems;
50  int fNumItems;
51 
52  std::unordered_map<std::string, int> fOffsetMap;
53 };
54 
55 }
56 }
57 }
58 
59 #endif /* FAIR_MQ_SHMEM_POLLER_H_ */
Definition: Poller.h:28
Definition: FairMQChannel.h:30
Definition: FairMQPoller.h:15
Tools for interfacing containers to the transport via polymorphic allocators.
Definition: DeviceRunner.h:23

privacy