plptools
Loading...
Searching...
No Matches
deviceconfiguration.h
Go to the documentation of this file.
1
/*
2
* This file is part of plptools.
3
*
4
* Copyright (c) 2026 Jason Morley <hello@jbmorley.co.uk>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program 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 General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* along with this program; if not, see <https://www.gnu.org/licenses/>.
18
*
19
*/
20
#pragma once
21
22
#include <memory>
23
#include <string>
24
#include <unordered_map>
25
34
class
DeviceConfiguration
{
35
public
:
36
37
DeviceConfiguration
();
38
39
DeviceConfiguration
(std::string
const
&
id
, std::string
const
&
name
);
40
41
static
std::unique_ptr<DeviceConfiguration>
deserialize
(
const
std::string &contents);
42
43
std::string
id
()
const
{
44
return
id_
;
45
}
46
47
std::string
name
()
const
{
48
return
name_
;
49
}
50
51
void
setName
(std::string
name
) {
52
name_
=
name
;
53
}
54
55
std::string
serialize
()
const
;
56
57
private
:
58
std::string
id_
;
59
std::string
name_
;
60
};
DeviceConfiguration
Class for managing and serializing device details.
Definition
deviceconfiguration.h:34
DeviceConfiguration::deserialize
static std::unique_ptr< DeviceConfiguration > deserialize(const std::string &contents)
Definition
deviceconfiguration.cc:31
DeviceConfiguration::setName
void setName(std::string name)
Definition
deviceconfiguration.h:51
DeviceConfiguration::DeviceConfiguration
DeviceConfiguration()
Definition
deviceconfiguration.cc:42
DeviceConfiguration::serialize
std::string serialize() const
Definition
deviceconfiguration.cc:52
DeviceConfiguration::id
std::string id() const
Definition
deviceconfiguration.h:43
DeviceConfiguration::name_
std::string name_
Definition
deviceconfiguration.h:59
DeviceConfiguration::name
std::string name() const
Definition
deviceconfiguration.h:47
DeviceConfiguration::id_
std::string id_
Definition
deviceconfiguration.h:58
lib
deviceconfiguration.h
Generated by
1.12.0