Leosac  0.8.0
Open Source Access Control
HardwareService.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2017 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 "GPIO.hpp"
23 #include "LeosacFwd.hpp"
24 #include "tools/JSONUtils.hpp"
25 #include "tools/db/db_fwd.hpp"
27 
28 namespace Leosac
29 {
30 namespace Hardware
31 {
40  : public ExtensibleSerializer<json, Hardware::Device, const SecurityContext &>
41 {
42  public:
43  explicit HardwareService(const Leosac::DBServicePtr &dbservice);
44 
45  DevicePtr find_device_by_name(const std::string &dev_name) const;
46 
50  std::string hardware_device_type(const Hardware::Device &device) const;
51 
60 
61  private:
63 };
64 }
65 }
Leosac::json
nlohmann::json json
Definition: AuditSerializer.hpp:29
Leosac::Hardware::HardwareService
Database aware Hardware Service.
Definition: HardwareService.hpp:39
Leosac::Hardware::HardwareService::dbservice_
DBServicePtr dbservice_
Definition: HardwareService.hpp:62
LeosacFwd.hpp
Leosac::Hardware::Device
Base class for hardware devices.
Definition: Device.hpp:44
Leosac::Hardware::HardwareService::hardware_device_type
std::string hardware_device_type(const Hardware::Device &device) const
Return the name of real type of a device.
Definition: HardwareService.cpp:41
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::DBServicePtr
std::shared_ptr< DBService > DBServicePtr
Definition: db_fwd.hpp:34
JSONUtils.hpp
Leosac::Hardware::HardwareService::serialize_device_metadata
json serialize_device_metadata(const Hardware::DevicePtr &device) const
Serialize as json the metadata of a device.
Definition: HardwareService.cpp:50
Leosac::Hardware::DevicePtr
std::shared_ptr< Device > DevicePtr
Definition: HardwareFwd.hpp:55
Leosac::Hardware::HardwareService::find_device_by_name
DevicePtr find_device_by_name(const std::string &dev_name) const
Definition: HardwareService.cpp:61
GPIO.hpp
Leosac::Hardware::HardwareService::HardwareService
HardwareService(const Leosac::DBServicePtr &dbservice)
Definition: HardwareService.cpp:33
Leosac::ExtensibleSerializer
Provides dynamic serializers management for a given object's hierarchy.
Definition: ExtensibleSerializer.hpp:53
db_fwd.hpp
ExtensibleSerializer.hpp