FairMQ  1.4.14
C++ Message Queuing Library and Framework
FairMQPollerNN.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  ********************************************************************************/
15 #ifndef FAIRMQPOLLERNN_H_
16 #define FAIRMQPOLLERNN_H_
17 
18 #include <vector>
19 #include <unordered_map>
20 
21 #include "FairMQPoller.h"
22 #include "FairMQChannel.h"
23 #include "FairMQTransportFactoryNN.h"
24 
25 class FairMQChannel;
26 struct nn_pollfd;
27 
28 class FairMQPollerNN final : public FairMQPoller
29 {
30  friend class FairMQChannel;
31  friend class FairMQTransportFactoryNN;
32 
33  public:
34  FairMQPollerNN(const std::vector<FairMQChannel>& channels);
35  FairMQPollerNN(const std::vector<FairMQChannel*>& channels);
36  FairMQPollerNN(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList);
37 
38  FairMQPollerNN(const FairMQPollerNN&) = delete;
39  FairMQPollerNN operator=(const FairMQPollerNN&) = delete;
40 
41  void SetItemEvents(nn_pollfd& item, const int type);
42 
43  void Poll(const int timeout) override;
44  bool CheckInput(const int index) override;
45  bool CheckOutput(const int index) override;
46  bool CheckInput(const std::string& channelKey, const int index) override;
47  bool CheckOutput(const std::string& channelKey, const int index) override;
48 
49  ~FairMQPollerNN() override;
50 
51  private:
52  nn_pollfd* fItems;
53  int fNumItems;
54 
55  std::unordered_map<std::string, int> fOffsetMap;
56 };
57 
58 #endif /* FAIRMQPOLLERNN_H_ */
Definition: FairMQChannel.h:30
Definition: FairMQPoller.h:15
Definition: FairMQTransportFactoryNN.h:22
Definition: FairMQPollerNN.h:28

privacy