CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Sym.h
Go to the documentation of this file.
1 #ifndef FWCore_Services_Sym_h
2 #define FWCore_Services_Sym_h
3 
4 #include <atomic>
5 #include <iosfwd>
6 #include <string>
7 
8 #include <dlfcn.h>
9 
10 struct Sym {
11  typedef void* address_type;
12 
13  Sym(Dl_info const& /*info*/, void* addr) :
14  name_(),
15  library_(),
16  id_(),
17  addr_(reinterpret_cast<address_type>(addr)) {
18  }
19 
20  Sym() :
21  name_(),
22  library_(),
23  id_(),
24  addr_()
25  { }
26 
27  explicit Sym(int id) :
28  name_(),
29  library_(),
30  id_(id),
31  addr_()
32  { }
33 
36  int id_;
38 
39  static std::atomic<int> next_id_;
40 
41  bool
43  { return addr_ < b; }
44 
45  bool
46  operator<(const Sym& b) const
47  { return addr_ < b.addr_; }
48 };
49 
50 std::ostream&
51 operator<<(std::ostream& os, Sym const& s);
52 
53 inline
54 bool
56 { return a < b.addr_; }
57 
58 #endif
Definition: Sym.h:10
Sym()
Definition: Sym.h:20
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void * address_type
Definition: Sym.h:11
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
static std::atomic< int > next_id_
Definition: Sym.h:39
std::string library_
Definition: Sym.h:35
Sym(Dl_info const &, void *addr)
Definition: Sym.h:13
std::string name_
Definition: Sym.h:34
double b
Definition: hdecay.h:120
address_type addr_
Definition: Sym.h:37
double a
Definition: hdecay.h:121
bool operator<(address_type b) const
Definition: Sym.h:42
Sym(int id)
Definition: Sym.h:27
int id_
Definition: Sym.h:36