neic-glass3  1.4.6
Public Member Functions | List of all members
glasscore::CWebList Class Reference

glasscore detection node class The detection fabric consists of a collection of nets which in turn contain a list of nodes, each of which is capable of detecting and nucleating a new event. The individual nets are added to the detection fabric (CWeb) by such commands as 'Grid' or 'Global'. More...

#include <WebList.h>

Collaboration diagram for glasscore::CWebList:
Collaboration graph

Public Member Functions

 CWebList (int numThreads=0)
 CWebList constructor. More...
 
 ~CWebList ()
 CWebList destructor. More...
 
void clear ()
 CWebList clear function. More...
 
bool receiveExternalMessage (std::shared_ptr< json::Object > com)
 CWebList communication receiving function. More...
 
bool addWeb (std::shared_ptr< json::Object > com)
 Add web ('Grid', etc) to list using provided configuration. More...
 
bool removeWeb (std::shared_ptr< json::Object > com)
 Remove web ('Grid', etc) from list by name. More...
 
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 webs. More...
 
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 list. More...
 
bool healthCheck ()
 check to see if each web thread is still functional More...
 
const CSiteListgetSiteList () const
 Get the CSiteList pointer used by this web list for site lookups. More...
 
void setSiteList (CSiteList *siteList)
 Set the CSiteList pointer used by this web list for site lookups. More...
 
std::shared_ptr< CWebgetControllingWeb (double dLat, double dLon)
 Get controlling web for coordinates. More...
 
int size () const
 Get the current size of the web list. More...
 

Detailed Description

glasscore detection node class The detection fabric consists of a collection of nets which in turn contain a list of nodes, each of which is capable of detecting and nucleating a new event. The individual nets are added to the detection fabric (CWeb) by such commands as 'Grid' or 'Global'.

CWebList uses smart pointers (std::shared_ptr).

Constructor & Destructor Documentation

glasscore::CWebList::CWebList ( int  numThreads = 0)
explicit

CWebList constructor.

glasscore::CWebList::~CWebList ( )

CWebList destructor.

Member Function Documentation

bool glasscore::CWebList::addWeb ( std::shared_ptr< json::Object >  com)

Add web ('Grid', etc) to list using provided configuration.

This method creates a web and then configures it by passing the configuration to the 'dispatch' message in the CWeb

This capability is to add a local aftershock (or induced seismicity) web quickly (and without restarting anything) after a main shock, and then to remove it (again without a restart) once the seismicity dies down, through some glass configuration control channel (i.e. kafka). The belief going forward is that this will be a relatively common occurrence.

Parameters
com- A pointer to a json::object containing the web configuration
Returns
Always returns true
void glasscore::CWebList::clear ( )

CWebList clear function.

The clear function for the CWebList class.

std::shared_ptr< CWeb > glasscore::CWebList::getControllingWeb ( double  dLat,
double  dLon 
)

Get controlling web for coordinates.

This function returns the controlling web based on the provided coordinates

Parameters
dLat- A double containing the latitude to use
dLon- A double containing the longitude to use
Returns
Returns shared pointer to the controlling web, or NULL if there is a tie.
const CSiteList * glasscore::CWebList::getSiteList ( ) const

Get the CSiteList pointer used by this web list for site lookups.

Returns
Return a pointer to the CSiteList class used by this web list
bool glasscore::CWebList::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 list.

Parameters
site- A shared pointer to a CSite object containing the site to check
bool glasscore::CWebList::healthCheck ( )

check to see if each web thread is still functional

Checks each web thread to see if it is still responsive.

bool glasscore::CWebList::receiveExternalMessage ( std::shared_ptr< json::Object >  com)

CWebList communication receiving function.

The function used by CWebList to receive communication (such as configuration or input data), from outside the glasscore library, or it's parent CGlass.

Supports Global (generate global grid) Shell (generate grid at single depth), Grid (generate local grid), Single (generate single node), GetWeb (generate output message detailing detection graph database) inputs.

Parameters
com- A pointer to a json::object containing the communication.
Returns
Returns true if the communication was handled by CWebList, false otherwise
bool glasscore::CWebList::removeWeb ( std::shared_ptr< json::Object >  com)

Remove web ('Grid', etc) from list by name.

This method removes a web from the list

This capability is to add a local aftershock (or induced seismicity) web quickly (and without restarting anything) after a main shock, and then to remove it (again without a restart) once the seismicity dies down, through some glass configuration control channel (i.e. kafka). The belief going forward is that this will be a relatively common occurrence.

Parameters
com- A pointer to a json::object containing name of the web to be removed.
Returns
Always returns true
void glasscore::CWebList::setSiteList ( CSiteList siteList)

Set the CSiteList pointer used by this web list for site lookups.

Parameters
siteList- a pointer to the CSiteList class used by this web list
int glasscore::CWebList::size ( ) const

Get the current size of the web list.

void glasscore::CWebList::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 webs.

Parameters
site- A shared_ptr to a CSite object containing the site to add

The documentation for this class was generated from the following files: