Leosac
0.8.0
Open Source Access Control
ExternalServer.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
20
#include "
hardware/ExternalServer.hpp
"
21
22
namespace
Leosac
23
{
24
namespace
Hardware
25
{
26
27
ExternalServer::ExternalServer
()
28
:
Device
(
DeviceClass
::
EXTERNAL_SERVER
),
29
port_(80)
30
{
31
}
32
33
ExternalServer::ExternalServer
(
const
std::string& host, uint16_t port)
34
:
Device
(
DeviceClass
::
EXTERNAL_SERVER
),
35
host_(host),
36
port_(port)
37
{
38
}
39
40
std::string
ExternalServer::host
()
const
41
{
42
return
host_
;
43
}
44
45
void
ExternalServer::host
(std::string host)
46
{
47
host_
=
host
;
48
}
49
50
uint16_t
ExternalServer::port
()
const
51
{
52
return
port_
;
53
}
54
55
void
ExternalServer::port
(uint16_t port)
56
{
57
port_
=
port
;
58
}
59
60
void
ExternalServer::validation_callback
(odb::callback_event e, odb::database &db)
const
61
{
62
Device::validation_callback
(e, db);
63
}
64
}
65
}
Leosac::Hardware::DeviceClass
DeviceClass
An enumeration describing the class of the device.
Definition:
HardwareFwd.hpp:42
Leosac::Hardware::Device::validation_callback
virtual void validation_callback(odb::callback_event e, odb::database &) const
Definition:
Device.cpp:85
ExternalServer.hpp
Leosac::Hardware::Device
Base class for hardware devices.
Definition:
Device.hpp:44
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition:
APIStatusCode.hpp:22
Leosac::Hardware::ExternalServer::host
std::string host() const
Definition:
ExternalServer.cpp:40
Leosac::Hardware::DeviceClass::EXTERNAL_SERVER
@ EXTERNAL_SERVER
Leosac::Hardware::ExternalServer::port_
uint16_t port_
Definition:
ExternalServer.hpp:58
Leosac::Hardware::ExternalServer::port
uint16_t port() const
Definition:
ExternalServer.cpp:50
Leosac::Hardware::ExternalServer::validation_callback
void validation_callback(odb::callback_event, odb::database &) const override
Definition:
ExternalServer.cpp:60
Leosac::Hardware::ExternalServer::host_
std::string host_
Definition:
ExternalServer.hpp:57
Leosac::Hardware::ExternalServer::ExternalServer
ExternalServer()
Definition:
ExternalServer.cpp:27
src
hardware
ExternalServer.cpp
Generated on Tue Mar 22 2022 10:48:22 for Leosac by
1.8.17