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 <stdint.h>
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 ::uint32_t const mask_fed_ = 0xffff0000;
32  static int const pos_amcnumber_ = 12;
33  static ::uint32_t const mask_amcnumber_ = 0x0000f000;
34  static int const pos_amcinput_ = 0;
35  static ::uint32_t const mask_amcinput_ = 0x00000fff;
38 public:
39  RPCAMCLink();
40  RPCAMCLink(::uint32_t const & _id);
41  RPCAMCLink(int _fed
42  , int _amcnumber
43  , int _amcinput = wildcard_);
44 
45  ::uint32_t getId() const;
46  operator ::uint32_t() const;
47  ::uint32_t getMask() const;
48 
49  bool matches(RPCAMCLink const & _rhs) const;
50 
51  void setId(::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<(::uint32_t const & _rhs) const;
76  bool operator==(::uint32_t const & _rhs) const;
77  bool operator!=(::uint32_t const & _rhs) const;
78 
83 
84 protected:
85  int bf_get(int const _min, ::uint32_t const _mask, int const _pos) const;
86  RPCAMCLink & bf_set(int const _min, int const _max, ::uint32_t const _mask, int const _pos, int const _value);
87  std::ostream & bf_stream(std::ostream & _ostream, int const _min, ::uint32_t const _mask, int const _pos) const;
88 
89 protected:
90  ::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
#define COND_SERIALIZABLE
Definition: Serializable.h:38