neic-glass3  1.4.6
Public Member Functions | Protected Attributes | List of all members
glass3::util::BaseClass Class Reference

glass3::util::BaseClass class - encapsulates the most basic setup and configuration logic. More...

#include <baseclass.h>

Inheritance diagram for glass3::util::BaseClass:
Inheritance graph
Collaboration diagram for glass3::util::BaseClass:
Collaboration graph

Public Member Functions

 BaseClass ()
 BaseClass constructor. More...
 
virtual ~BaseClass ()
 BaseClass destructor. More...
 
virtual bool setup (std::shared_ptr< const json::Object > config)
 BaseClass configuration function. More...
 
virtual void clear ()
 BaseClass clear function. More...
 
const std::shared_ptr< const json::Object > getConfig ()
 
bool getSetup ()
 Retrieves the class member boolean flag indicating whether the class has been setup, set to true if setup was successful. More...
 
const std::string & getDefaultAgencyId ()
 Function to retrieve the name of the default agency id. More...
 
void setDefaultAgencyId (const std::string &id)
 Function to set the name of the default agency id. More...
 
const std::string & getDefaultAuthor ()
 Function to retrieve the name of the default author. More...
 
void setDefaultAuthor (const std::string &author)
 Function to set the name of the default author. More...
 

Protected Attributes

std::shared_ptr< const json::Object > m_Config
 A shared pointer to the json::Object that holds the configuration. More...
 
std::atomic< bool > m_bIsSetup
 the boolean flag indicating whether the class has been setup, set to true if setup was successful. More...
 
std::string m_DefaultAgencyID
 A std::string containing the default agency id to use in parsing if one is not provided. More...
 
std::string m_DefaultAuthor
 A std::string containing the default author to use in parsing if one is not provided. More...
 

Detailed Description

glass3::util::BaseClass class - encapsulates the most basic setup and configuration logic.

Class encapsulating the setup and configuration logic, which is common to most neic-glass3 classes outside of glasscore. The BaseClass is a simple, almost abstract class that provides setup and clear interfaces and keeps a pointer to the current configuration. The class also provides a mutex for thread safety

This class is intended to be extended by derived classes.

Constructor & Destructor Documentation

glass3::util::BaseClass::BaseClass ( )

BaseClass constructor.

The constructor for the BaseClass class. Initializes members to default values.

glass3::util::BaseClass::~BaseClass ( )
virtual

BaseClass destructor.

The destructor for the BaseClass class.

Member Function Documentation

void glass3::util::BaseClass::clear ( )
virtual

BaseClass clear function.

The clear function for the BaseClass class. Clears all configuration.

Warning
WARNING! Uses the base class mutex available via getMutex(), locking getMutex(), or any other method where the class mutex is obtained and locked, before calling setup will cause a deadlock.

Reimplemented in glasscore::CHypoList, glasscore::CWeb, glass3::input::Input, glass3::output::output, glasscore::CPickList, glass3::process::Associator, glass3::fileInput, glass3::fileOutput, glass3::brokerOutput, glass3::brokerInput, glasscore::CSiteList, glass3::util::Cache, and glass3::util::Queue.

const std::shared_ptr< const json::Object > glass3::util::BaseClass::getConfig ( )
const std::string & glass3::util::BaseClass::getDefaultAgencyId ( )

Function to retrieve the name of the default agency id.

This function retrieves the name of default agency id, this name is used by many of the derived classes

Returns
A std::string containing the agency id
const std::string & glass3::util::BaseClass::getDefaultAuthor ( )

Function to retrieve the name of the default author.

This function retrieves the name of the default author, this name is used by many of the derived classes

Returns
A std::string containing the author
bool glass3::util::BaseClass::getSetup ( )

Retrieves the class member boolean flag indicating whether the class has been setup, set to true if setup was successful.

void glass3::util::BaseClass::setDefaultAgencyId ( const std::string &  id)

Function to set the name of the default agency id.

This function sets the name of the default agency id, this name is used by many of the derived classes

Parameters
id= A std::string containing the default agency id to set
void glass3::util::BaseClass::setDefaultAuthor ( const std::string &  author)

Function to set the name of the default author.

This function sets the name of the default author, this name is used by many of the derived classes

Parameters
author= A std::string containing the default author to set
bool glass3::util::BaseClass::setup ( std::shared_ptr< const json::Object >  config)
virtual

BaseClass configuration function.

The this function configures the BaseClass class

Parameters
config- A shared_ptr to a json::Object containing to the configuration to use
Warning
WARNING! Uses the base class mutex available via getMutex(), locking getMutex(), or any other method where the class mutex is obtained and locked, before calling setup will cause a deadlock.
Returns
returns true if successful.

Reimplemented in glass3::input::Input, glass3::output::output, glass3::process::Associator, glass3::fileInput, glass3::fileOutput, glass3::brokerOutput, and glass3::brokerInput.

Member Data Documentation

std::atomic<bool> glass3::util::BaseClass::m_bIsSetup
protected

the boolean flag indicating whether the class has been setup, set to true if setup was successful.

std::shared_ptr<const json::Object> glass3::util::BaseClass::m_Config
protected

A shared pointer to the json::Object that holds the configuration.

std::string glass3::util::BaseClass::m_DefaultAgencyID
protected

A std::string containing the default agency id to use in parsing if one is not provided.

std::string glass3::util::BaseClass::m_DefaultAuthor
protected

A std::string containing the default author to use in parsing if one is not provided.


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