CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPCAMCLink.h
Go to the documentation of this file.
1 #ifndef CondFormats_RPCObjects_RPCAMCLink_h
2 #define CondFormats_RPCObjects_RPCAMCLink_h
3 
4 #include <cstdint>
5 #include <string>
6 #include <iosfwd>
7 #include <climits>
8 
10 
12 class RPCAMCLink {
13 public:
14  static int const wildcard_ = INT_MIN;
15 
18  static int const min_fed_ = 0;
19  static int const max_fed_ = 65534;
20  static int const min_amcnumber_ = 0;
21  static int const max_amcnumber_ = 12;
22  static int const min_amcinput_ = 0;
23  static int const max_amcinput_ = 80;
26 protected:
29  static int const pos_fed_ = 16;
30  static std::uint32_t const mask_fed_ = 0xffff0000;
31  static int const pos_amcnumber_ = 12;
32  static std::uint32_t const mask_amcnumber_ = 0x0000f000;
33  static int const pos_amcinput_ = 0;
34  static std::uint32_t const mask_amcinput_ = 0x00000fff;
37 public:
38  RPCAMCLink();
39  RPCAMCLink(std::uint32_t const& id);
40  RPCAMCLink(int fed, int amcnumber, int amcinput = wildcard_);
41 
42  std::uint32_t getId() const;
43  operator std::uint32_t() const;
44  std::uint32_t getMask() const;
45 
46  bool matches(RPCAMCLink const& rhs) const;
47 
48  void setId(std::uint32_t const& id);
49  void reset();
50 
53  int getFED() const;
54  int getAMCNumber() const;
55  int getAMCInput() const;
62  RPCAMCLink& setFED(int fed = wildcard_);
63  RPCAMCLink& setAMCNumber(int amcnumber = wildcard_);
64  RPCAMCLink& setAMCInput(int amcinput = wildcard_);
67  std::string getName() const;
68 
69  bool operator<(RPCAMCLink const& rhs) const;
70  bool operator==(RPCAMCLink const& rhs) const;
71  bool operator!=(RPCAMCLink const& rhs) const;
72  bool operator<(std::uint32_t const& rhs) const;
73  bool operator==(std::uint32_t const& rhs) const;
74  bool operator!=(std::uint32_t const& rhs) const;
75 
80 
81 protected:
82  int bf_get(int const min, std::uint32_t const mask, int const pos) const;
83  RPCAMCLink& bf_set(int const min, int const max, std::uint32_t const mask, int const pos, int const value);
84  std::ostream& bf_stream(std::ostream& ostream, int const min, std::uint32_t const mask, int const pos) const;
85 
86 protected:
87  std::uint32_t id_;
88 
90 };
91 
92 std::ostream& operator<<(std::ostream& ostream, RPCAMCLink const& link);
93 
94 #include "CondFormats/RPCObjects/interface/RPCAMCLink.icc"
95 
96 #endif // CondFormats_RPCObjects_RPCAMCLink_h
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
T min(T a, T b)
Definition: MathUtil.h:58
#define COND_SERIALIZABLE
Definition: Serializable.h:39