Leosac  0.8.0
Open Source Access Control
DoormanDoor.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2022 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 "core/auth/Auth.hpp"
23 #include "core/auth/AuthFwd.hpp"
24 #include <map>
25 #include <zmqpp/zmqpp.hpp>
26 
27 namespace Leosac
28 {
29 namespace Module
30 {
31 namespace Doorman
32 {
38 {
39  public:
47  DoormanDoor(const Auth::AuthTargetPtr &door, zmqpp::context &ctx);
48 
49  DoormanDoor(const DoormanDoor &) = delete;
50 
51  DoormanDoor &operator=(const DoormanDoor &) = delete;
52 
53  zmqpp::socket &bus_sub();
54 
58  void handle_bus_msg();
59 
61 
62  private:
63 
65 
66  zmqpp::socket bus_sub_;
67 
68  std::string topic_exitreq_;
69 
70  std::string topic_contact_;
71 
73 
74  std::chrono::system_clock::time_point contact_lastupdate;
75 };
76 }
77 }
78 }
Leosac::Module::Doorman::DoormanDoor::contact_lastupdate
std::chrono::system_clock::time_point contact_lastupdate
Definition: DoormanDoor.hpp:74
Leosac::Module::Doorman::DoormanDoor::contact_triggered
bool contact_triggered
Definition: DoormanDoor.hpp:72
Leosac::Module::Doorman::DoormanDoor::operator=
DoormanDoor & operator=(const DoormanDoor &)=delete
Auth.hpp
AuthFwd.hpp
Leosac::Auth::AuthTargetPtr
std::shared_ptr< AuthTarget > AuthTargetPtr
Definition: AuthFwd.hpp:93
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Module::Doorman::DoormanDoor::topic_exitreq_
std::string topic_exitreq_
Definition: DoormanDoor.hpp:68
Leosac::Module::Doorman::DoormanDoor::DoormanDoor
DoormanDoor(const Auth::AuthTargetPtr &door, zmqpp::context &ctx)
Create a new doorman door.
Definition: DoormanDoor.cpp:27
Leosac::Module::Doorman::DoormanDoor::door
Leosac::Auth::AuthTargetPtr door() const
Definition: DoormanDoor.cpp:46
Leosac::Module::Doorman::DoormanDoor
Implements a Doorman Door, that is, a component that will listen to door specific event unrelated to ...
Definition: DoormanDoor.hpp:37
Leosac::Module::Doorman::DoormanDoor::door_
Leosac::Auth::AuthTargetPtr door_
Definition: DoormanDoor.hpp:64
Leosac::Module::Doorman::DoormanDoor::handle_bus_msg
void handle_bus_msg()
Activity we care about happened on the bus.
Definition: DoormanDoor.cpp:56
Leosac::Module::Doorman::DoormanDoor::bus_sub
zmqpp::socket & bus_sub()
Definition: DoormanDoor.cpp:51
Leosac::Module::Doorman::DoormanDoor::bus_sub_
zmqpp::socket bus_sub_
Definition: DoormanDoor.hpp:66
Leosac::Module::Doorman::DoormanDoor::topic_contact_
std::string topic_contact_
Definition: DoormanDoor.hpp:70