My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Channel.h
1 // $Id: Channel.h,v 1.2 2010/03/04 21:17:26 sjcm Exp $
2 
3 #ifndef GCP_GRABBER_CHANNEL_H
4 #define GCP_GRABBER_CHANNEL_H
5 
16 #include <iostream>
17 #include <vector>
18 
19 namespace gcp {
20  namespace grabber {
21 
22  class Channel {
23  public:
24 
25  enum FgChannel {
26  NONE = 0x0,
27  CHAN0 = 0x1,
28  CHAN1 = 0x2,
29  CHAN2 = 0x4,
30  CHAN3 = 0x8,
31  ALL = CHAN0 | CHAN1 | CHAN2 | CHAN3
32  };
33 
34  static const unsigned nChan_ = 4;
35 
36  friend std::ostream& operator<<(std::ostream& os, const FgChannel& chan);
37 
38  // Constructor.
39 
40  Channel();
41 
42  // Destructor.
43 
44  virtual ~Channel();
45 
46  // Convert from FgChannel to integer channel ID
47 
48  static unsigned channelToInt(FgChannel chanMask);
49 
50  // Convert from integer channel ID to FgChannel
51 
52  static FgChannel intToChannel(unsigned chanInt);
53 
54  static bool isSingleChannel(FgChannel chan);
55 
56  static std::vector<Channel::FgChannel> getChannels(Channel::FgChannel chanMask);
57 
58  }; // End class Channel
59 
60  std::ostream& operator<<(std::ostream& os, const Channel::FgChannel& chan);
61 
62  } // End namespace grabber
63 } // End namespace gcp
64 
65 
66 
67 #endif // End #ifndef GCP_GRABBER_CHANNEL_H
Channel()
Definition: Channel.cc:14
Definition: Channel.h:22
virtual ~Channel()
Definition: Channel.cc:20