lintel 0.2.0
Loading...
Searching...
No Matches
GroupDto.h
Go to the documentation of this file.
1#ifndef LINTEL_GROUPDTO_H
2#define LINTEL_GROUPDTO_H
3
4#include <memory>
5
8
9namespace lintel {
10class GroupsDto;
11
14{
15private:
17 std::string m_groupName;
19 std::vector<GroupDto> m_groups;
21 bool m_isVirtual;
22
24 static const struct Shapes
25 {
26 const char *const GROUP_NAME = "group_name";
27 const char *const GROUPS = "groups";
28 const char *const VIRTUAL = "virtual";
29 } shape;
30
31public:
34 explicit GroupDto(const Group &group);
35
37 GroupDto() = default;
38
41 void serialize(rapidjson::Writer<rapidjson::StringBuffer> *writer) const override;
42
46 bool deserialize(const rapidjson::Value &obj) override;
47
50 [[nodiscard]] const std::string &getGroupName() const;
51
54 [[nodiscard]] bool isVirtual() const;
55
58 [[nodiscard]] const std::vector<GroupDto> &getSubGroups() const;
59};
60
63{
64private:
66 std::vector<GroupDto> m_groups;
67
71 static std::vector<GroupDto> init(const std::vector<Group> &groups);
72
73public:
76 explicit GroupsDto(const std::vector<Group> &groups);
77
80 explicit GroupsDto(std::vector<GroupDto> groups);
81
83 GroupsDto() = default;
84
87 void serialize(rapidjson::Writer<rapidjson::StringBuffer> *writer) const override;
88
92 bool deserialize(const rapidjson::Value &obj) override;
93
96 [[nodiscard]] const std::vector<GroupDto> &getGroups() const;
97};
98
99}// namespace lintel
100#endif// LINTEL_GROUPDTO_H
Definition GroupDto.h:14
bool deserialize(const rapidjson::Value &obj) override
GroupDto(const Group &group)
const std::string & getGroupName() const
const std::vector< GroupDto > & getSubGroups() const
bool isVirtual() const
void serialize(rapidjson::Writer< rapidjson::StringBuffer > *writer) const override
GroupDto()=default
Definition Group.h:35
Definition GroupDto.h:63
bool deserialize(const rapidjson::Value &obj) override
void serialize(rapidjson::Writer< rapidjson::StringBuffer > *writer) const override
GroupsDto(const std::vector< Group > &groups)
GroupsDto(std::vector< GroupDto > groups)
GroupsDto()=default
const std::vector< GroupDto > & getGroups() const
Definition JsonSerializable.h:17
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9