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
35public:
36
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
57private:
58 std::string id_;
59 std::string name_;
60};
Class for managing and serializing device details.
static std::unique_ptr< DeviceConfiguration > deserialize(const std::string &contents)
void setName(std::string name)
std::string serialize() const
std::string id() const
std::string name() const