Leosac  0.8.0
Open Source Access Control
EventPublish.h
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 <zmqpp/zmqpp.hpp>
23 #include <boost/property_tree/ptree.hpp>
24 #include <vector>
25 #include <memory>
26 #include "modules/BaseModule.hpp"
29 #include "core/auth/AuthTarget.hpp"
30 
31 namespace Leosac
32 {
33  namespace Module
34  {
40  namespace EventPublish
41  {
42 
48  class EventPublish : public BaseModule
49  {
50  public:
51  EventPublish(zmqpp::context &ctx,
52  zmqpp::socket *pipe,
53  const boost::property_tree::ptree &cfg,
54  CoreUtilsPtr utils);
55 
56  EventPublish(const EventPublish &) = delete;
57 
58  EventPublish &operator=(const EventPublish &) = delete;
59 
60  ~EventPublish() = default;
61 
62  private:
63  void handle_msg_bus();
64 
69  void process_config();
70 
74  zmqpp::socket bus_sub_;
75 
79  zmqpp::socket network_pub_;
80 
82  };
83 
84  }
85  }
86 }
FGPIO.hpp
Leosac::Module::BaseModule
Base class for module implementation.
Definition: BaseModule.hpp:110
Leosac::Module::EventPublish::EventPublish::process_config
void process_config()
Processing the configuration tree, spawning AuthFileInstance object as described in the configuration...
Definition: EventPublish.cpp:94
AuthTarget.hpp
Leosac::Module::EventPublish::EventPublish::bus_sub_
zmqpp::socket bus_sub_
Read internal message bus.
Definition: EventPublish.h:74
Leosac::Module::EventPublish::EventPublish::publish_source_
bool publish_source_
Definition: EventPublish.h:81
BaseModule.hpp
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
XmlScheduleLoader.hpp
Leosac::Module::EventPublish::EventPublish::~EventPublish
~EventPublish()=default
Leosac::Module::EventPublish::EventPublish::handle_msg_bus
void handle_msg_bus()
Definition: EventPublish.cpp:37
Leosac::Module::EventPublish::EventPublish::network_pub_
zmqpp::socket network_pub_
Publish to the internet.
Definition: EventPublish.h:79
Leosac::Module::EventPublish::EventPublish
Run the Event publication module.
Definition: EventPublish.h:48
Leosac::Module::EventPublish::EventPublish::operator=
EventPublish & operator=(const EventPublish &)=delete
Leosac::Module::EventPublish::EventPublish::EventPublish
EventPublish(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
Definition: EventPublish.cpp:25
Leosac::CoreUtilsPtr
std::shared_ptr< CoreUtils > CoreUtilsPtr
Definition: LeosacFwd.hpp:35