DABC (Data Acquisition Backbone Core)  2.9.9
ComplQueue.h
Go to the documentation of this file.
1 /************************************************************
2  * The Data Acquisition Backbone Core (DABC) *
3  ************************************************************
4  * Copyright (C) 2009 - *
5  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
6  * Planckstr. 1, 64291 Darmstadt, Germany *
7  * Contact: http://dabc.gsi.de *
8  ************************************************************
9  * This software can be used under the GPL license *
10  * agreements as stated in LICENSE.txt file *
11  * which is part of the distribution. *
12  ************************************************************/
13 
14 #ifndef VERBS_ComplQueue
15 #define VERBS_ComplQueue
16 
17 #ifndef VERBS_Context
18 #include "verbs/Context.h"
19 #endif
20 
21 namespace verbs {
22 
27  void* itself;
28  struct ibv_cq* own_cq;
29  };
30 
31  // __________________________________________________________________
32 
35  class ComplQueue {
36  protected:
37 
39 
40  struct ibv_cq *f_cq;
41  struct ibv_comp_channel *f_channel;
43 
45  // FIXME: for a moment put here, later should be removed
46  struct ibv_wc f_wc;
47 
48  public:
49 
50  ComplQueue(ContextRef ctx, int size,
51  struct ibv_comp_channel *channel, bool use_own_channel = false);
52 
53  virtual ~ComplQueue();
54 
55  struct ibv_comp_channel *channel() const { return f_channel; }
56  struct ibv_cq *cq() const { return f_cq; }
57  uint64_t arg() const { return f_wc.wr_id; }
58 
59  int Poll();
60  int Wait(double timeout, double fasttm = 0.);
61  void AcknoledgeEvents();
62 
63  static const char* GetStrError(int err);
64  };
65 }
66 
67 #endif
Wrapper for IB VERBS completion queue
Definition: ComplQueue.h:35
ComplQueueContext fCQContext
Definition: ComplQueue.h:44
struct ibv_wc f_wc
Definition: ComplQueue.h:46
struct ibv_cq * f_cq
Definition: ComplQueue.h:40
ComplQueue(ContextRef ctx, int size, struct ibv_comp_channel *channel, bool use_own_channel=false)
Definition: ComplQueue.cxx:23
int Wait(double timeout, double fasttm=0.)
Definition: ComplQueue.cxx:91
struct ibv_cq * cq() const
Definition: ComplQueue.h:56
struct ibv_comp_channel * f_channel
Definition: ComplQueue.h:41
static const char * GetStrError(int err)
Definition: ComplQueue.cxx:207
virtual ~ComplQueue()
Definition: ComplQueue.cxx:52
ContextRef fContext
Definition: ComplQueue.h:38
uint64_t arg() const
Definition: ComplQueue.h:57
struct ibv_comp_channel * channel() const
Definition: ComplQueue.h:55
Reference to verbs::Context
Definition: Context.h:74
Support of InfiniBand verbs.
Definition: Device.cxx:54
Context object for completion queue operations.
Definition: ComplQueue.h:25
struct ibv_cq * own_cq
Definition: ComplQueue.h:28