neic-glass3  1.4.6
WebList.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 WEBLIST_H
8 #define WEBLIST_H
9 
10 #include <json.h>
11 #include <vector>
12 #include <memory>
13 #include <mutex>
14 
15 namespace glasscore {
16 
17 // forward declarations
18 class CSite;
19 class CSiteList;
20 class CWeb;
21 
32 class CWebList {
33  public:
37  explicit CWebList(int numThreads = 0);
38 
42  ~CWebList();
43 
49  void clear();
50 
68  bool receiveExternalMessage(std::shared_ptr<json::Object> com);
69 
86  bool addWeb(std::shared_ptr<json::Object> com);
87 
103  bool removeWeb(std::shared_ptr<json::Object> com);
104 
112  void updateSite(std::shared_ptr<CSite> site);
113 
122  bool hasSite(std::shared_ptr<CSite> site);
123 
129  bool healthCheck();
130 
135  const CSiteList* getSiteList() const;
136 
141  void setSiteList(CSiteList* siteList);
142 
152  std::shared_ptr<CWeb> getControllingWeb(double dLat, double dLon);
153 
157  int size() const;
158 
159  private:
164  CSiteList * m_pSiteList;
165 
170  std::vector<std::shared_ptr<CWeb>> m_vWebs;
171 
175  int m_iNumThreads;
176 
184  mutable std::recursive_mutex m_WebListMutex;
185 };
186 } // namespace glasscore
187 #endif // WEBLIST_H
void clear()
CWebList clear function.
Definition: WebList.cpp:26
glasscore site list class
Definition: SiteList.h:40
int size() const
Get the current size of the web list.
Definition: WebList.cpp:254
bool healthCheck()
check to see if each web thread is still functional
Definition: WebList.cpp:218
bool receiveExternalMessage(std::shared_ptr< json::Object > com)
CWebList communication receiving function.
Definition: WebList.cpp:39
const CSiteList * getSiteList() const
Get the CSiteList pointer used by this web list for site lookups.
Definition: WebList.cpp:242
glasscore detection node class The detection fabric consists of a collection of nets which in turn co...
Definition: WebList.h:32
CWebList(int numThreads=0)
CWebList constructor.
Definition: WebList.cpp:16
void setSiteList(CSiteList *siteList)
Set the CSiteList pointer used by this web list for site lookups.
Definition: WebList.cpp:248
std::shared_ptr< CWeb > getControllingWeb(double dLat, double dLon)
Get controlling web for coordinates.
Definition: WebList.cpp:260
bool removeWeb(std::shared_ptr< json::Object > com)
Remove web (&#39;Grid&#39;, etc) from list by name.
Definition: WebList.cpp:121
~CWebList()
CWebList destructor.
Definition: WebList.cpp:22
bool addWeb(std::shared_ptr< json::Object > com)
Add web (&#39;Grid&#39;, etc) to list using provided configuration.
Definition: WebList.cpp:70
The namespace containing the core algorithm.
Definition: Correlation.h:17
bool hasSite(std::shared_ptr< CSite > site)
Check if the webs have a site This function checks to see if the given site is used in any web in the...
Definition: WebList.cpp:193
void updateSite(std::shared_ptr< CSite > site)
Update a site in the webs This function updates the given site in all appropriate webs in the list of...
Definition: WebList.cpp:165