Graybat  1.1
Graph Approach for Highly Generic Communication Schemes Based on Adaptive Topologies
Event.hpp
1 #pragma once
2 
3 #include <graybat/communicationPolicy/Traits.hpp>
4 
5 namespace graybat {
6 
7  namespace communicationPolicy {
8 
9  namespace zmq {
10 
19  template <typename T_CP>
20  class Event {
21  public:
22 
23  using ContextID = typename graybat::communicationPolicy::ContextID<T_CP>;
24  using VAddr = typename graybat::communicationPolicy::VAddr<T_CP>;
25  using Tag = typename graybat::communicationPolicy::Tag<T_CP>;
26  using MsgType = typename graybat::communicationPolicy::MsgType<T_CP>;
27  using MsgID = typename graybat::communicationPolicy::MsgID<T_CP>;
28  using Context = typename graybat::communicationPolicy::Context<T_CP>;
29 
30  Event(MsgID msgID, Context context, VAddr vAddr, Tag tag, T_CP& comm) :
31  msgID(msgID),
32  context(context),
33  vAddr(vAddr),
34  tag(tag),
35  comm(comm){
36  }
37 
38  void wait(){
39  comm.wait(msgID, context, vAddr, tag);
40 
41  }
42 
43  bool ready(){
44  comm.ready(msgID, context, vAddr, tag);
45  return true;
46  }
47 
48  VAddr source(){
49  return vAddr;
50  }
51 
52  Tag getTag(){
53  return tag;
54 
55  }
56 
57  MsgID msgID;
58  Context context;
59  VAddr vAddr;
60  Tag tag;
61  T_CP& comm;
62 
63 
64  };
65 
66  } // zmq
67 
68  } // namespace communicationPolicy
69 
70 } // namespace graybat
Definition: chain.cpp:31
An event is returned by non-blocking communication operations and can be asked whether an operation h...
Definition: Event.hpp:20
Definition: BiStar.hpp:8