Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Cabinets.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MODEL_DIAMAR_CABINETS_HPP_
2#define IV_SRC_MODEL_DIAMAR_CABINETS_HPP_
3
4#include "core/types.hpp"
6
7#include <map>
8
9namespace iv::model::diamar
10{
11
12struct Cabinet
13{
15 Cabinet(iv::types::cabinetId id_, std::string_view serialNumber_, std::string_view location_,
16 std::string_view internalDescription_);
17 Cabinet(const Cabinet &other);
18 Cabinet(Cabinet &&other) noexcept;
20
21 Cabinet &operator=(const Cabinet &other);
22 Cabinet &operator=(Cabinet &&other) noexcept;
23
24 bool load(const iv::file::xml::node &nodeCabinet);
25 bool save(iv::file::xml::node &nodeCabinet) const;
26
28 std::string serialNumber;
29 std::string location;
31
32private:
33 struct Keys
34 {
35 static constexpr std::string_view id {"Id"};
36 static constexpr std::string_view serialNumber {"SerialNumber"};
37 static constexpr std::string_view location {"Location"};
38 static constexpr std::string_view internalDescription {"InternalDescription"};
39 };
40
42 {
43 static constexpr std::string string {};
44 static constexpr iv::types::cabinetId cabinetId {};
45 };
46};
47
48struct Cabinets : std::map<iv::types::cabinetId, iv::model::diamar::Cabinet>
49{
51 Cabinets(const Cabinets &other);
52 Cabinets(Cabinets &&other) noexcept;
54
55 Cabinets &operator=(const Cabinets &other);
56 Cabinets &operator=(Cabinets &&other) noexcept;
57
58 bool load(const iv::file::xml::node &rootNode);
59 bool save(iv::file::xml::node &rootNode) const;
60
62
63private:
64 struct Sections
65 {
66 static constexpr std::string_view cabinets {"Cabinets"};
67 static constexpr std::string_view cabinet {"Cabinet"};
68 };
69};
70
71}// namespace iv::model::diamar
72
73#endif//IV_SRC_MODEL_DIAMAR_CABINETS_HPP_
Definition xmlFile.hpp:15
Definition DiamarModel.cpp:14
std::string cabinetId
Definition types.hpp:65
static constexpr iv::types::cabinetId cabinetId
Definition Cabinets.hpp:44
Definition Cabinets.hpp:34
static constexpr std::string_view serialNumber
Definition Cabinets.hpp:36
static constexpr std::string_view location
Definition Cabinets.hpp:37
static constexpr std::string_view internalDescription
Definition Cabinets.hpp:38
Definition Cabinets.hpp:13
bool save(iv::file::xml::node &nodeCabinet) const
Definition Cabinets.cpp:63
std::string internalDescription
Definition Cabinets.hpp:30
std::string location
Definition Cabinets.hpp:29
Cabinet(const Cabinet &other)
iv::types::cabinetId id
Definition Cabinets.hpp:27
bool load(const iv::file::xml::node &nodeCabinet)
Definition Cabinets.cpp:53
Cabinet & operator=(const Cabinet &other)
Definition Cabinets.cpp:27
std::string serialNumber
Definition Cabinets.hpp:28
Definition Cabinets.hpp:65
static constexpr std::string_view cabinets
Definition Cabinets.hpp:66
static constexpr std::string_view cabinet
Definition Cabinets.hpp:67
Definition Cabinets.hpp:49
Cabinets(const Cabinets &other)
Cabinets & operator=(const Cabinets &other)
Definition Cabinets.cpp:86
bool load(const iv::file::xml::node &rootNode)
Definition Cabinets.cpp:116
bool save(iv::file::xml::node &rootNode) const
Definition Cabinets.cpp:138
Cabinets(Cabinets &&other) noexcept
iv::model::diamar::Cabinet & getCabinetAt(uint32_t index)
Definition Cabinets.cpp:73