LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ChData.h
Go to the documentation of this file.
1 
14 #ifndef IOVDATA_CHDATA_H
15 #define IOVDATA_CHDATA_H
16 
17 #include <functional>
18 
19 namespace lariov {
23  class ChData {
24 
25  public:
27  ChData(unsigned int ch) : fChannel(ch) {}
28 
30  virtual ~ChData() {}
31 
32  unsigned int Channel() const { return fChannel; }
33  void SetChannel(unsigned int ch) { fChannel = ch; }
34 
35  inline bool operator<(unsigned int rhs) const { return fChannel < rhs; }
36 
37  inline bool operator<(const ChData& ch) const { return fChannel < ch.Channel(); }
38 
39  protected:
40  unsigned int fChannel;
41  };
42 }
43 
44 namespace std {
45  template <>
46  class less<lariov::ChData*> {
47  public:
48  bool operator()(const lariov::ChData* lhs, const lariov::ChData* rhs)
49  {
50  return (*lhs) < (*rhs);
51  }
52  };
53 }
54 
55 #endif
56  // end of doxygen group
unsigned int fChannel
Definition: ChData.h:40
bool operator()(const lariov::ChData *lhs, const lariov::ChData *rhs)
Definition: ChData.h:48
unsigned int Channel() const
Definition: ChData.h:32
STL namespace.
bool operator<(const ChData &ch) const
Definition: ChData.h:37
ChData(unsigned int ch)
Constructor.
Definition: ChData.h:27
void SetChannel(unsigned int ch)
Definition: ChData.h:33
Filters for channels, events, etc.
virtual ~ChData()
Default destructor.
Definition: ChData.h:30
bool operator<(unsigned int rhs) const
Definition: ChData.h:35