This is a generic base class module. It will implement some, but not all, generic module activities. Of course, any and all routines can be overridden as necessary. More...
#include "umps/modules/module.hpp"
Public Member Functions | |
IModule () | |
Constructor. | |
virtual void | start () |
Starts the threads handling the heartbeating and commands. | |
virtual void | stop () |
Stops the threads handling the heartbeating and commands. | |
bool | keepRunning () const noexcept |
void | disconnect () |
Disconnects from the status and. | |
virtual | ~IModule () |
Destructor. | |
IModule & | operator= (const IModule &)=delete |
IModule & | operator= (IModule &&) noexcept=delete |
IModule (const IModule &)=delete | |
IModule (IModule &&) noexcept=delete | |
Initialization | |
virtual void | parseInitializationFile (const std::string &initializationFile) |
Parses an initialization file and extracts the uOperator information from the uOperator section, standard general module information from the module General section, and the heartbeat broadcast, and command information. Typical general items are the module name, verbosity, and log directory. Typical heartbeat properties are the heartbeat interval and, if necessary, the heartbeat broadcast name. More... | |
virtual void | setName (const std::string &name) |
Sets the module's name. | |
virtual std::string | getName () const noexcept |
virtual void | setOperatorAddress (const std::string &address) |
Sets the operator address. More... | |
virtual std::string | getOperatorAddress () const |
virtual bool | haveOperatorAddress () const noexcept |
virtual void | setZAPOptions (const UMPS::Authentication::ZAPOptions &options) noexcept |
Sets the ZeroMQ authentication options. More... | |
virtual UMPS::Authentication::ZAPOptions | getZAPOptions () const noexcept |
virtual void | setHeartbeatBroadcastName (const std::string &name) |
Sets the name of the heartbeat broadcast. More... | |
virtual std::string | getHeartbeatBroadcastName () const noexcept |
virtual void | setHeartbeatInterval (const std::chrono::seconds &interval) |
Sets the interval between status messages in the heartbeat broadcast. More... | |
std::chrono::seconds | getHeartbeatInterval () const noexcept |
virtual void | setVerbosity (UMPS::Logging::Level verbosity) noexcept |
Sets the module verbosity. More... | |
virtual UMPS::Logging::Level | getVerbosity () const noexcept |
virtual void | setLogFileDirectory (const std::string &directory) |
Sets the log file directory. More... | |
virtual std::string | getLogFileDirectory () const noexcept |
virtual void | setLogger (std::shared_ptr< UMPS::Logging::ILog > &logger) |
Sets the application's logger. More... | |
virtual std::shared_ptr< UMPS::Logging::ILog > | getLogger () const noexcept |
Connect | |
virtual void | connect () |
This will establish a connection to the. More... | |
virtual bool | isConnected () const noexcept |
std::shared_ptr< UMPS::Services::ConnectionInformation::Requestor > | getConnectionInformationRequestor () const |
This is a generic base class module. It will implement some, but not all, generic module activities. Of course, any and all routines can be overridden as necessary.
|
virtual |
This will establish a connection to the.
std::runtime_error | if haveSetOperatorAddress() is false. |
std::runtime_error | if there are issues connecting to uOperator. |
std::shared_ptr<UMPS::Services::ConnectionInformation::Requestor> UMPS::Modules::IModule::getConnectionInformationRequestor | ( | ) | const |
std::runtime_error | if isConnected() is false. |
|
virtualnoexcept |
|
noexcept |
|
virtualnoexcept |
|
virtualnoexcept |
|
virtualnoexcept |
|
virtual |
std::runtime_error | if the operator address was not set. |
|
virtualnoexcept |
|
virtualnoexcept |
|
virtualnoexcept |
|
virtualnoexcept |
|
noexcept |
|
virtual |
Parses an initialization file and extracts the uOperator information from the uOperator section, standard general module information from the module General section, and the heartbeat broadcast, and command information. Typical general items are the module name, verbosity, and log directory. Typical heartbeat properties are the heartbeat interval and, if necessary, the heartbeat broadcast name.
[in] | initializationFile | The name of the initialization file. |
|
virtual |
Sets the name of the heartbeat broadcast.
[in] | name | The name of the heartbeat broadcast. |
std::invalid_argument | if the name is empty. |
|
virtual |
Sets the interval between status messages in the heartbeat broadcast.
[in] | interval | The interval in seconds. This must be positive. |
std::invalid_argument | if the interval is not positive. |
|
virtual |
Sets the log file directory.
[in] | directory | The file directory. |
std::runtime_error | if the log file directory cannot be created. |
|
virtual |
Sets the application's logger.
[in] | logger | A pointer to the application's logger. |
|
virtual |
Sets the operator address.
[in] | address | The uOperator address - e.g., tcp://127.0.0.1:8080 |
|
virtualnoexcept |
Sets the module verbosity.
[in] | verbosity | The logging leve. |
|
virtualnoexcept |
Sets the ZeroMQ authentication options.
[in] | options | The ZAP options. |