Leosac  0.8.0
Open Source Access Control
ExternalMessage.cpp
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 
21 
22 namespace Leosac
23 {
24 namespace Hardware
25 {
26 
29  subject_(""),
30  direction_(Hardware::ExternalMessage::Direction::Subscribe),
31  virtualtype_(Hardware::DeviceClass::GPIO)
32 {
33 }
34 
35 std::string ExternalMessage::subject() const
36 {
37  return subject_;
38 }
39 
40 void ExternalMessage::subject(const std::string& subject)
41 {
42  subject_ = subject;
43 }
44 
46 {
47  return direction_;
48 }
49 
51 {
53 }
54 
56 {
57  return virtualtype_;
58 }
59 
61 {
63 }
64 
65 std::string ExternalMessage::payload() const
66 {
67  return payload_;
68 }
69 
70 void ExternalMessage::payload(const std::string& payload)
71 {
72  payload_ = payload;
73 }
74 
75 void ExternalMessage::validation_callback(odb::callback_event e, odb::database &db) const
76 {
78 }
79 }
80 }
Leosac::Hardware::ExternalMessage::direction_
Direction direction_
Definition: ExternalMessage.hpp:72
Leosac::Hardware::DeviceClass
DeviceClass
An enumeration describing the class of the device.
Definition: HardwareFwd.hpp:42
ExternalMessage.hpp
Leosac::Hardware::ExternalMessage::payload
std::string payload() const
Definition: ExternalMessage.cpp:65
Leosac::Hardware::ExternalMessage::subject
std::string subject() const
Definition: ExternalMessage.cpp:35
Leosac::Hardware::ExternalMessage::ExternalMessage
ExternalMessage()
Definition: ExternalMessage.cpp:27
Leosac::Hardware::ExternalMessage::payload_
std::string payload_
Definition: ExternalMessage.hpp:74
Leosac::Hardware::Device::validation_callback
virtual void validation_callback(odb::callback_event e, odb::database &) const
Definition: Device.cpp:85
Leosac::Hardware::DeviceClass::EXTERNAL_MESSAGE
@ EXTERNAL_MESSAGE
Leosac::Hardware::Device
Base class for hardware devices.
Definition: Device.hpp:44
Leosac::Hardware::ExternalMessage::direction
Direction direction() const
Definition: ExternalMessage.cpp:45
Leosac::Hardware::ExternalMessage::validation_callback
void validation_callback(odb::callback_event, odb::database &) const override
Definition: ExternalMessage.cpp:75
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Hardware::ExternalMessage
Abstraction of an External Messaging device.
Definition: ExternalMessage.hpp:41
Leosac::Hardware::ExternalMessage::virtualtype_
DeviceClass virtualtype_
Definition: ExternalMessage.hpp:73
Leosac::Hardware::ExternalMessage::virtualtype
DeviceClass virtualtype() const
Definition: ExternalMessage.cpp:55
Leosac::Hardware::ExternalMessage::Direction
Direction
Definition: ExternalMessage.hpp:44
Leosac::Hardware::ExternalMessage::subject_
std::string subject_
Definition: ExternalMessage.hpp:71
Leosac::Hardware::GPIO
Abstraction of a GPIO device attributes.
Definition: GPIO.hpp:41