Go to the documentation of this file.00001 #ifndef FWCore_Services_Sym_h
00002 #define FWCore_Services_Sym_h
00003
00004 #include <iosfwd>
00005 #include <string>
00006
00007 #include <dlfcn.h>
00008
00009 struct Sym {
00010 typedef void* address_type;
00011
00012 Sym(Dl_info const& , void* addr) :
00013 name_(),
00014 library_(),
00015 id_(),
00016 addr_(reinterpret_cast<address_type>(addr)) {
00017 }
00018
00019 Sym() :
00020 name_(),
00021 library_(),
00022 id_(),
00023 addr_()
00024 { }
00025
00026 explicit Sym(int id) :
00027 name_(),
00028 library_(),
00029 id_(id),
00030 addr_()
00031 { }
00032
00033 std::string name_;
00034 std::string library_;
00035 int id_;
00036 address_type addr_;
00037
00038 static int next_id_;
00039
00040 bool
00041 operator<(address_type b) const
00042 { return addr_ < b; }
00043
00044 bool
00045 operator<(const Sym& b) const
00046 { return addr_ < b.addr_; }
00047 };
00048
00049 std::ostream&
00050 operator<<(std::ostream& os, Sym const& s);
00051
00052 inline
00053 bool
00054 operator<(Sym::address_type a, const Sym& b)
00055 { return a < b.addr_; }
00056
00057 #endif