FairMQ  1.2.0
C++ Message Passing Framework
FairMQPollerSHM.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 FAIRMQPOLLERSHM_H_
9 #define FAIRMQPOLLERSHM_H_
10 
11 #include <vector>
12 #include <unordered_map>
13 
14 #include <zmq.h>
15 
16 #include "FairMQPoller.h"
17 #include "FairMQChannel.h"
18 #include "FairMQTransportFactorySHM.h"
19 
20 class FairMQChannel;
21 
23 {
24  friend class FairMQChannel;
25  friend class FairMQTransportFactorySHM;
26 
27  public:
28  FairMQPollerSHM(const std::vector<FairMQChannel>& channels);
29  FairMQPollerSHM(const std::vector<const FairMQChannel*>& channels);
30  FairMQPollerSHM(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList);
31 
32  FairMQPollerSHM(const FairMQPollerSHM&) = delete;
33  FairMQPollerSHM operator=(const FairMQPollerSHM&) = delete;
34 
35  void SetItemEvents(zmq_pollitem_t& item, const int type);
36 
37  void Poll(const int timeout) override;
38  bool CheckInput(const int index) override;
39  bool CheckOutput(const int index) override;
40  bool CheckInput(const std::string channelKey, const int index) override;
41  bool CheckOutput(const std::string channelKey, const int index) override;
42 
43  ~FairMQPollerSHM() override;
44 
45  private:
46  FairMQPollerSHM(const FairMQSocket& cmdSocket, const FairMQSocket& dataSocket);
47 
48  zmq_pollitem_t* fItems;
49  int fNumItems;
50 
51  std::unordered_map<std::string, int> fOffsetMap;
52 };
53 
54 #endif /* FAIRMQPOLLERSHM_H_ */
Definition: FairMQTransportFactorySHM.h:29
Definition: FairMQChannel.h:24
Definition: FairMQPoller.h:15
Definition: FairMQSocket.h:18
Definition: FairMQPollerSHM.h:22