DABC (Data Acquisition Backbone Core)  2.9.9
Device.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_Device
15 #define VERBS_Device
16 
17 #ifndef DABC_Device
18 #include "dabc/Device.h"
19 #endif
20 
21 #ifndef VERBS_Context
22 #include "verbs/Context.h"
23 #endif
24 
25 namespace verbs {
26 
27  class OpenSM;
28  class QueuePair;
29  class ComplQueue;
30  class Device;
31 
32  class Transport;
33  class Thread;
34  class ProtocolAddon;
35 
36  extern const char* xmlMcastAddr;
37 
38  // ____________________________________________________________________
39 
42  class Device : public dabc::Device {
43  friend class Transport;
44  friend class Thread;
45  friend class ProtocolAddon;
46 
47  protected:
48 
50 
51  virtual int ExecuteCommand(dabc::Command cmd);
52 
53  QueuePair* CreatePortQP(const std::string &thrd_name, dabc::Reference port, int conn_type,
54  dabc::ThreadRef &thrd);
55 
57 
58  virtual double ProcessTimeout(double last_diff);
59 
61 
62  bool fAllocateIndividualCQ; // for connections individual CQ will be used
63 
64  static bool fThreadSafeVerbs; // identifies if verbs is thread safe
65 
66  public:
67 
68  Device(const std::string &name);
69  virtual ~Device();
70 
72 
73  dabc::ThreadRef MakeThread(const char* name, bool force = false);
74 
77 
78  virtual const char* ClassName() const { return verbs::typeDevice; }
79 
80  static bool IsThreadSafeVerbs() { return fThreadSafeVerbs; }
81 
82 
83  };
84 
85  // _________________________________________________________
86 
89  class DeviceRef : public dabc::DeviceRef {
90 
92 
93  };
94 
95  extern bool ConvertStrToGid(const std::string &s, ibv_gid &gid);
96  extern std::string ConvertGidToStr(ibv_gid &gid);
97 }
98 
99 #endif
#define DABC_REFERENCE(RefClass, ParentClass, T)
Definition: Reference.h:222
Represents command with its arguments.
Definition: Command.h:99
Reference on dabc::Device class
Definition: Device.h:79
Base class for device implementation.
Definition: Device.h:43
Reference on the arbitrary object
Definition: Reference.h:73
Reference on the dabc::Thread class
Definition: Thread.h:482
Base class for transport implementations.
Definition: Transport.h:37
Reference to verbs::Context
Definition: Context.h:74
Refernce on verbs::Device
Definition: Device.h:89
Device for VERBS
Definition: Device.h:42
virtual double ProcessTimeout(double last_diff)
Definition: Device.cxx:478
static bool IsThreadSafeVerbs()
Definition: Device.h:80
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
Definition: Device.cxx:460
virtual const char * ClassName() const
Returns class name of the object instance.
Definition: Device.h:78
bool IsAllocateIndividualCQ() const
Definition: Device.h:75
friend class Transport
Definition: Device.h:43
virtual dabc::Transport * CreateTransport(dabc::Command cmd, const dabc::Reference &port)
Definition: Device.cxx:304
ContextRef fIbContext
Definition: Device.h:49
QueuePair * CreatePortQP(const std::string &thrd_name, dabc::Reference port, int conn_type, dabc::ThreadRef &thrd)
Definition: Device.cxx:261
virtual ~Device()
Definition: Device.cxx:256
dabc::ThreadRef MakeThread(const char *name, bool force=false)
Definition: Device.cxx:295
ContextRef IbContext()
Definition: Device.h:71
int HandleManagerConnectionRequest(dabc::Command cmd)
Definition: Device.cxx:348
static bool fThreadSafeVerbs
Definition: Device.h:64
void SetAllocateIndividualCQ(bool on)
Definition: Device.h:76
Device(const std::string &name)
Definition: Device.cxx:237
bool fAllocateIndividualCQ
Definition: Device.h:62
Addon to establish and verify QP connection with remote node
Definition: Device.cxx:58
Represent VERBS queue pair functionality.
Definition: QueuePair.h:37
VERBS thread.
Definition: Thread.h:46
Support of InfiniBand verbs.
Definition: Device.cxx:54
const char * xmlMcastAddr
Definition: Device.cxx:25
std::string ConvertGidToStr(ibv_gid &gid)
Definition: Device.cxx:496
bool ConvertStrToGid(const std::string &s, ibv_gid &gid)
Definition: Device.cxx:483
const char * typeDevice
Definition: Context.cxx:37