CARMA C++
CorrelatorSet.h
Go to the documentation of this file.
1 // $Id: CorrelatorSet.h,v 1.6 2014/06/04 17:09:52 mpound Exp $
2 
3 #ifndef CARMA_UTIL_CORRELATORSET_H
4 #define CARMA_UTIL_CORRELATORSET_H
5 
16 #include <string>
17 #include <sstream>
18 #include <vector>
19 #include "carma/util/CorrelatorType.h"
20 
21 namespace carma {
22  namespace util {
23 
33  class CorrelatorSet {
34  public:
35 
39  CorrelatorSet();
40 
45  CorrelatorSet(carma::util::CorrelatorType corr);
46 
56  virtual ~CorrelatorSet();
57 
58 
62  void initialize(carma::util::CorrelatorType corr);
63 
72  void addCorrelator(carma::util::CorrelatorType corr);
73 
77  void removeCorrelator(carma::util::CorrelatorType corr);
78 
79 
84  std::string corrTypeString() const;
85 
89  CorrelatorType corrType() const;
90 
94  std::string mpString() const;
95 
99  bool isSingleCorrelator() const;
100 
104  bool isEmpty() const;
105 
109  bool isAll() const;
110 
111  // Return true if this set represents any of the following
112  // single correlators
113 
117  bool isSpectral() const;
118 
122  bool isWideband() const;
123 
127  bool isC3gMax8() const;
128 
132  bool isC3gMax23() const;
133 
137  bool isC3g() const;
138 
139  // Return true if this set includes any of the following single
140  // correlators
141 
145  bool includesSpectral() const;
146 
150  bool includesWideband() const;
151 
155  bool includesC3gMax8() const;
156 
160  bool includesC3gMax23() const;
161 
163  void addSpectral();
164 
166  void addWideband();
167 
169  void addC3gMax8();
170 
172  void addC3gMax23();
173 
178  bool includes(const carma::util::CorrelatorType corr) const;
179 
184  bool includes(const CorrelatorSet& set) const;
185 
186 
192  bool firstCorrelatorIs(carma::util::CorrelatorType corr) const;
193 
194 
196  unsigned nCorrelator() const;
197 
198 
200  std::vector<carma::util::CorrelatorType> getControlCorrelatorDesignations() const;
201 
203  carma::util::CorrelatorType getControlCorrelatorDesignation() const;
204 
208  carma::util::CorrelatorType getFirstControlCorrelatorDesignation() const;
209 
213  void operator=(carma::util::CorrelatorType corr);
214 
218  bool operator==(carma::util::CorrelatorType corr);
219 
223  bool operator==(const CorrelatorSet & set) const; // Strict equality
224 
225  // Print operators
226 
228  friend std::ostream& operator<<(std::ostream& os, const CorrelatorSet& set);
229 
230 
231 
232 
233  private:
234 
235  carma::util::CorrelatorType corrSet_;
236 
237  }; // End class CorrelatorSet
238 
239  std::ostream& operator<<(std::ostream& os, const CorrelatorSet& set);
240 
241  } // End namespace util
242 } // End namespace carma
243 
244 
245 
246 #endif // End #ifndef CARMA_UTIL_CORRELATORSET_H
bool firstCorrelatorIs(carma::util::CorrelatorType corr) const
void removeCorrelator(carma::util::CorrelatorType corr)
Remove a correlator from this set.
carma::util::CorrelatorType getControlCorrelatorDesignation() const
virtual ~CorrelatorSet()
Constructor.
CorrelatorSet()
Constructor.
bool includesWideband() const
bool operator==(carma::util::CorrelatorType corr)
Equality operator.
unsigned nCorrelator() const
void addCorrelator(carma::util::CorrelatorType corr)
Initialize this correlator set.
void initialize(carma::util::CorrelatorType corr)
Initialize this correlator set.
void operator=(carma::util::CorrelatorType corr)
Assignment operator.
bool includesC3gMax23() const
bool isSingleCorrelator() const
friend std::ostream & operator<<(std::ostream &os, const CorrelatorSet &set)
output stream operator
carma::util::CorrelatorType getFirstControlCorrelatorDesignation() const
void addC3gMax23()
Add the C3GMAX23 correlator to this set.
bool includes(const carma::util::CorrelatorType corr) const
bool includesSpectral() const
void addC3gMax8()
Add the C3GMAX8 correlator to this set.
std::vector< carma::util::CorrelatorType > getControlCorrelatorDesignations() const
std::string corrTypeString() const
void addSpectral()
Add the spectral correlator to this set.
CorrelatorSet encapsulates a set of correlators to facilitate management of addition and removal of c...
Definition: CorrelatorSet.h:33
std::string mpString() const
bool includesC3gMax8() const
CorrelatorType corrType() const
void addWideband()
Add the wideband correlator to this set.