neic-glass3  1.4.6
CorrelationList.h
Go to the documentation of this file.
1 /*****************************************
2  * This file is documented for Doxygen.
3  * If you modify this file please update
4  * the comments so that Doxygen will still
5  * be able to work.
6  ****************************************/
7 #ifndef CORRELATIONLIST_H
8 #define CORRELATIONLIST_H
9 
10 #include <json.h>
11 #include <memory>
12 #include <string>
13 #include <set>
14 #include <vector>
15 #include <utility>
16 #include <atomic>
17 #include "Correlation.h"
18 
19 namespace glasscore {
20 
21 // forward declarations
22 class CSite;
23 class CSiteList;
24 class CHypo;
25 
33  bool operator()(const std::shared_ptr<CCorrelation> &lhs,
34  const std::shared_ptr<CCorrelation> &rhs) const {
35  if (lhs->getTCorrelation() < rhs->getTCorrelation()) {
36  return (true);
37  }
38  return (false);
39  }
40 };
41 
55  public:
60 
65 
69  void clear();
70 
85  bool receiveExternalMessage(std::shared_ptr<json::Object> com);
86 
108  bool addCorrelationFromJSON(std::shared_ptr<json::Object> com);
109 
124  bool checkDuplicate(CCorrelation * newCorrelation, double tWindow,
125  double xWindow);
126 
141  bool scavenge(std::shared_ptr<CHypo> hyp, double tWindow = 2.5);
142 
149  const CSiteList* getSiteList() const;
150 
157  void setSiteList(CSiteList* siteList);
158 
164  int getMaxAllowableCorrelationCount() const;
165 
171  void setMaxAllowableCorrelationCount(int correlationMax);
172 
178  int getCountOfTotalCorrelationsProcessed() const;
179 
185  int length() const;
186 
200  std::vector<std::weak_ptr<CCorrelation>> getCorrelations(double t1,
201  double t2);
202 
203  private:
208  CSiteList * m_pSiteList;
209 
215  std::atomic<int> m_iMaxAllowableCorrelationCount;
216 
221  std::atomic<int> m_iCountOfTotalCorrelationsProcessed;
222 
227  std::multiset<std::shared_ptr<CCorrelation>, CorrelationCompare> m_msCorrelationList; // NOLINT
228 
236  mutable std::recursive_mutex m_CorrelationListMutex;
237 
241  static const int k_nMaxAllowableCorrelationCountDefault = 10000;
242 };
243 } // namespace glasscore
244 #endif // CORRELATIONLIST_H
CCorrelationList comparison function.
Definition: CorrelationList.h:32
glasscore site list class
Definition: SiteList.h:40
glasscore correlation class
Definition: Correlation.h:45
bool operator()(const std::shared_ptr< CCorrelation > &lhs, const std::shared_ptr< CCorrelation > &rhs) const
Definition: CorrelationList.h:33
glasscore correlation list class
Definition: CorrelationList.h:54
The namespace containing the core algorithm.
Definition: Correlation.h:17