Leosac  0.8.0
Open Source Access Control
LEDBuzzerModule.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "LedBuzzerImpl.hpp"
23 #include "modules/BaseModule.hpp"
24 #include <memory>
25 #include <vector>
26 
27 namespace Leosac
28 {
29 namespace Module
30 {
31 
49 namespace LedBuzzer
50 {
51 class WSHelperThread;
52 
60 {
61  public:
62  LEDBuzzerModule(zmqpp::context &ctx, zmqpp::socket *pipe,
63  const boost::property_tree::ptree &cfg, CoreUtilsPtr utils);
64 
65  virtual ~LEDBuzzerModule();
66 
67  LEDBuzzerModule(const LEDBuzzerModule &) = delete;
68  LEDBuzzerModule(LEDBuzzerModule &&) = delete;
69  LEDBuzzerModule &operator=(const LEDBuzzerModule &) = delete;
71 
72  void run() override;
73 
74  private:
75  void process_config();
76 
77  void load_xml_config();
78  void load_db_config();
79 
80  std::vector<std::shared_ptr<LedBuzzerImpl>> leds_and_buzzers_;
81  std::unique_ptr<WSHelperThread> ws_helper_thread_;
82 };
83 }
84 }
85 }
Leosac::Module::LedBuzzer::LEDBuzzerModule::load_xml_config
void load_xml_config()
Definition: LEDBuzzerModule.cpp:94
Leosac::Module::BaseModule
Base class for module implementation.
Definition: BaseModule.hpp:110
Leosac::Module::LedBuzzer::LEDBuzzerModule::load_db_config
void load_db_config()
Definition: LEDBuzzerModule.cpp:148
Leosac::Module::LedBuzzer::LEDBuzzerModule::operator=
LEDBuzzerModule & operator=(const LEDBuzzerModule &)=delete
Leosac::Module::LedBuzzer::LEDBuzzerModule::leds_and_buzzers_
std::vector< std::shared_ptr< LedBuzzerImpl > > leds_and_buzzers_
Definition: LEDBuzzerModule.hpp:80
BaseModule.hpp
Leosac::Module::LedBuzzer::LEDBuzzerModule::process_config
void process_config()
Definition: LEDBuzzerModule.cpp:80
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Module::LedBuzzer::LEDBuzzerModule::ws_helper_thread_
std::unique_ptr< WSHelperThread > ws_helper_thread_
Definition: LEDBuzzerModule.hpp:81
Leosac::Module::LedBuzzer::LEDBuzzerModule::LEDBuzzerModule
LEDBuzzerModule(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
Definition: LEDBuzzerModule.cpp:37
Leosac::Module::LedBuzzer::LEDBuzzerModule
Main class for LED support.
Definition: LEDBuzzerModule.hpp:59
Leosac::CoreUtilsPtr
std::shared_ptr< CoreUtils > CoreUtilsPtr
Definition: LeosacFwd.hpp:35
Leosac::Module::LedBuzzer::LEDBuzzerModule::~LEDBuzzerModule
virtual ~LEDBuzzerModule()
Definition: LEDBuzzerModule.cpp:50
LedBuzzerImpl.hpp
Leosac::Module::LedBuzzer::LEDBuzzerModule::run
void run() override
This is the main loop of the module.
Definition: LEDBuzzerModule.cpp:54