Leosac  0.8.0
Open Source Access Control
Leosac::Module::LedBuzzer::LEDBuzzerModule Class Reference

Main class for LED support. More...

#include <LEDBuzzerModule.hpp>

+ Inheritance diagram for Leosac::Module::LedBuzzer::LEDBuzzerModule:
+ Collaboration diagram for Leosac::Module::LedBuzzer::LEDBuzzerModule:

Public Member Functions

 LEDBuzzerModule (zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
 
virtual ~LEDBuzzerModule ()
 
 LEDBuzzerModule (const LEDBuzzerModule &)=delete
 
 LEDBuzzerModule (LEDBuzzerModule &&)=delete
 
LEDBuzzerModuleoperator= (const LEDBuzzerModule &)=delete
 
LEDBuzzerModuleoperator= (LEDBuzzerModule &&)=delete
 
void run () override
 This is the main loop of the module. 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 ()
 
void load_xml_config ()
 
void load_db_config ()
 

Private Attributes

std::vector< std::shared_ptr< LedBuzzerImpl > > leds_and_buzzers_
 
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

Main class for LED support.

See also
FLED documentation for LED devices API.
mod_led_user_config for end-user documentation.

Definition at line 59 of file LEDBuzzerModule.hpp.

Constructor & Destructor Documentation

◆ LEDBuzzerModule() [1/3]

Leosac::Module::LedBuzzer::LEDBuzzerModule::LEDBuzzerModule ( zmqpp::context &  ctx,
zmqpp::socket *  pipe,
const boost::property_tree::ptree &  cfg,
CoreUtilsPtr  utils 
)

Definition at line 37 of file LEDBuzzerModule.cpp.

◆ ~LEDBuzzerModule()

Leosac::Module::LedBuzzer::LEDBuzzerModule::~LEDBuzzerModule ( )
virtual

Definition at line 50 of file LEDBuzzerModule.cpp.

◆ LEDBuzzerModule() [2/3]

Leosac::Module::LedBuzzer::LEDBuzzerModule::LEDBuzzerModule ( const LEDBuzzerModule )
delete

◆ LEDBuzzerModule() [3/3]

Leosac::Module::LedBuzzer::LEDBuzzerModule::LEDBuzzerModule ( LEDBuzzerModule &&  )
delete

Member Function Documentation

◆ load_db_config()

void Leosac::Module::LedBuzzer::LEDBuzzerModule::load_db_config ( )
private

Definition at line 148 of file LEDBuzzerModule.cpp.

◆ load_xml_config()

void Leosac::Module::LedBuzzer::LEDBuzzerModule::load_xml_config ( )
private

Definition at line 94 of file LEDBuzzerModule.cpp.

◆ operator=() [1/2]

LEDBuzzerModule& Leosac::Module::LedBuzzer::LEDBuzzerModule::operator= ( const LEDBuzzerModule )
delete

◆ operator=() [2/2]

LEDBuzzerModule& Leosac::Module::LedBuzzer::LEDBuzzerModule::operator= ( LEDBuzzerModule &&  )
delete

◆ process_config()

void Leosac::Module::LedBuzzer::LEDBuzzerModule::process_config ( )
private

Definition at line 80 of file LEDBuzzerModule.cpp.

◆ run()

void Leosac::Module::LedBuzzer::LEDBuzzerModule::run ( )
overridevirtual

This is the main loop of the module.

It should only exit when receiving signal::stop on its pipe_ socket. This is completely handled by this base class. In case you override this, make sure you watch the pipe_ socket.

Reimplemented from Leosac::Module::BaseModule.

Definition at line 54 of file LEDBuzzerModule.cpp.

Member Data Documentation

◆ leds_and_buzzers_

std::vector<std::shared_ptr<LedBuzzerImpl> > Leosac::Module::LedBuzzer::LEDBuzzerModule::leds_and_buzzers_
private

Definition at line 80 of file LEDBuzzerModule.hpp.

◆ ws_helper_thread_

std::unique_ptr<WSHelperThread> Leosac::Module::LedBuzzer::LEDBuzzerModule::ws_helper_thread_
private

Definition at line 81 of file LEDBuzzerModule.hpp.


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