Leosac  0.8.0
Open Source Access Control
Leosac::Module::Wiegand::WiegandReaderModule Class Reference

This simply is the main class for the Wiegand module. More...

#include <wiegand.hpp>

+ Inheritance diagram for Leosac::Module::Wiegand::WiegandReaderModule:
+ Collaboration diagram for Leosac::Module::Wiegand::WiegandReaderModule:

Public Member Functions

 WiegandReaderModule (zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
 
 ~WiegandReaderModule () override
 
virtual void run () override
 Module's main loop. More...
 
- Public Member Functions inherited from Leosac::Module::BaseModule
 BaseModule (zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
 Constructor of BaseModule. More...
 
virtual ~BaseModule ()=default
 

Private Member Functions

void process_config ()
 Create wiegand reader instances based on configuration. More...
 
void load_db_config ()
 Load the module configuration from the database. More...
 
void load_xml_config (const boost::property_tree::ptree &module_config)
 Load the module configuration from the XML configuration object. More...
 
Strategy::WiegandStrategyUPtr create_strategy (const WiegandReaderConfig &reader_config, WiegandReaderImpl *reader)
 Internal factory that build a strategy object based upon a reader configuration. More...
 

Private Attributes

std::vector< WiegandReaderImplreaders_
 Vector of wiegand reader managed by this module. More...
 
std::unique_ptr< WiegandConfigwiegand_config_
 Configuration object for the module. More...
 
std::unique_ptr< WSHelperThreadws_helper_thread_
 

Additional Inherited Members

- Protected Member Functions inherited from Leosac::Module::BaseModule
virtual void handle_pipe ()
 The base class register the pipe_ socket to its reactor_ so that this function is called when the pipe_ is available from reading. More...
 
virtual void handle_control ()
 Handle called when a message on the module's control socket arrives. More...
 
virtual void dump_additional_config (zmqpp::message *out) const
 Dump additional configuration (for example module specific config file). More...
 
void dump_config (ConfigManager::ConfigFormat fmt, zmqpp::message *out_msg) const
 Fills a message with the module's configuration information. More...
 
void config_check (const std::string &obj_name, Leosac::Hardware::DeviceClass type)
 An helper that checks configuration the existence of some objects. More...
 
void config_check (const std::string &obj_name)
 An helper that checks configuration the existence of some objects. More...
 
- Protected Attributes inherited from Leosac::Module::BaseModule
zmqpp::context & ctx_
 A reference to the ZeroMQ context in case you need it to create additional socket. More...
 
zmqpp::socket & pipe_
 A reference to the pair socket that link back to the module manager. More...
 
boost::property_tree::ptree config_
 The configuration tree passed to the start_module function. More...
 
CoreUtilsPtr utils_
 Pointer to the core utils, which gives access to scheduler and others. More...
 
bool is_running_
 Boolean indicating whether the main loop should run or not. More...
 
zmqpp::socket control_
 Control REP socket. More...
 
zmqpp::reactor reactor_
 The reactor object we poll() on in the main loop. More...
 
std::string name_
 

Detailed Description

This simply is the main class for the Wiegand module.

Definition at line 47 of file wiegand.hpp.

Constructor & Destructor Documentation

◆ WiegandReaderModule()

WiegandReaderModule::WiegandReaderModule ( zmqpp::context &  ctx,
zmqpp::socket *  pipe,
const boost::property_tree::ptree &  cfg,
CoreUtilsPtr  utils 
)

Definition at line 57 of file wiegand.cpp.

◆ ~WiegandReaderModule()

WiegandReaderModule::~WiegandReaderModule ( )
override

Definition at line 73 of file wiegand.cpp.

Member Function Documentation

◆ create_strategy()

Strategy::WiegandStrategyUPtr WiegandReaderModule::create_strategy ( const WiegandReaderConfig reader_config,
WiegandReaderImpl reader 
)
private

Internal factory that build a strategy object based upon a reader configuration.

Definition at line 143 of file wiegand.cpp.

◆ load_db_config()

void WiegandReaderModule::load_db_config ( )
private

Load the module configuration from the database.

Definition at line 197 of file wiegand.cpp.

◆ load_xml_config()

void WiegandReaderModule::load_xml_config ( const boost::property_tree::ptree &  module_config)
private

Load the module configuration from the XML configuration object.

Definition at line 241 of file wiegand.cpp.

◆ process_config()

void WiegandReaderModule::process_config ( )
private

Create wiegand reader instances based on configuration.

Definition at line 81 of file wiegand.cpp.

◆ run()

void WiegandReaderModule::run ( )
overridevirtual

Module's main loop.

Will exit upon reception of signal::stop from module manager

Reimplemented from Leosac::Module::BaseModule.

Definition at line 122 of file wiegand.cpp.

Member Data Documentation

◆ readers_

std::vector<WiegandReaderImpl> Leosac::Module::Wiegand::WiegandReaderModule::readers_
private

Vector of wiegand reader managed by this module.

Definition at line 89 of file wiegand.hpp.

◆ wiegand_config_

std::unique_ptr<WiegandConfig> Leosac::Module::Wiegand::WiegandReaderModule::wiegand_config_
private

Configuration object for the module.

Definition at line 94 of file wiegand.hpp.

◆ ws_helper_thread_

std::unique_ptr<WSHelperThread> Leosac::Module::Wiegand::WiegandReaderModule::ws_helper_thread_
private

Definition at line 96 of file wiegand.hpp.


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