CMS 3D CMS Logo

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 
13 {
14 public:
15  static int const wildcard_ = INT_MIN;
16 
19  static int const min_fed_ = 0;
20  static int const max_fed_ = 65534;
21  static int const min_amcnumber_ = 0;
22  static int const max_amcnumber_ = 12;
23  static int const min_amcinput_ = 0;
24  static int const max_amcinput_ = 80;
27 protected:
30  static int const pos_fed_ = 16;
31  static std::uint32_t const mask_fed_ = 0xffff0000;
32  static int const pos_amcnumber_ = 12;
33  static std::uint32_t const mask_amcnumber_ = 0x0000f000;
34  static int const pos_amcinput_ = 0;
35  static std::uint32_t const mask_amcinput_ = 0x00000fff;
38 public:
39  RPCAMCLink();
40  RPCAMCLink(std::uint32_t const & id);
41  RPCAMCLink(int fed
42  , int amcnumber
43  , int amcinput = wildcard_);
44 
45  std::uint32_t getId() const;
46  operator std::uint32_t() const;
47  std::uint32_t getMask() const;
48 
49  bool matches(RPCAMCLink const & rhs) const;
50 
51  void setId(std::uint32_t const & id);
52  void reset();
53 
56  int getFED() const;
57  int getAMCNumber() const;
58  int getAMCInput() const;
65  RPCAMCLink & setFED(int fed = wildcard_);
66  RPCAMCLink & setAMCNumber(int amcnumber = wildcard_);
67  RPCAMCLink & setAMCInput(int amcinput = wildcard_);
70  std::string getName() const;
71 
72  bool operator<(RPCAMCLink const & rhs) const;
73  bool operator==(RPCAMCLink const & rhs) const;
74  bool operator!=(RPCAMCLink const & rhs) const;
75  bool operator<(std::uint32_t const & rhs) const;
76  bool operator==(std::uint32_t const & rhs) const;
77  bool operator!=(std::uint32_t const & rhs) const;
78 
83 
84 protected:
85  int bf_get(int const min, std::uint32_t const mask, int const pos) const;
86  RPCAMCLink & bf_set(int const min, int const max, std::uint32_t const mask, int const pos, int const value);
87  std::ostream & bf_stream(std::ostream & ostream, int const min, std::uint32_t const mask, int const pos) const;
88 
89 protected:
90  std::uint32_t id_;
91 
93 };
94 
95 std::ostream & operator<<(std::ostream & ostream, RPCAMCLink const & link);
96 
97 #include "CondFormats/RPCObjects/interface/RPCAMCLink.icc"
98 
99 #endif // CondFormats_RPCObjects_RPCAMCLink_h
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
#define COND_SERIALIZABLE
Definition: Serializable.h:38