Dev Essential  1.6.3
Loading...
Searching...
No Matches
datamodel_streams.h
Go to the documentation of this file.
1
14
15#ifndef DD_DATA_MODEL_STREAMS_H_INCLUDED
16#define DD_DATA_MODEL_STREAMS_H_INCLUDED
17
24
25#include <string>
26#include <unordered_map>
27#include <vector>
28
29namespace ddl {
30
31namespace dd {
32
33namespace datamodel {
34
39class Stream : public ModelSubject<Stream>,
40 public utility::TypeAccessMapSubject<Stream>,
41 public InfoMap {
42public:
46 Stream() = delete;
62 Stream(const Stream& other);
69 Stream& operator=(const Stream& other);
74 virtual ~Stream() = default;
75
80 class Struct : public utility::TypeAccessListSubject<Struct>, public InfoMap {
81 public:
86 Struct(){};
91 Struct(const Struct&) = default;
96 Struct(Struct&&) = default;
102 Struct& operator=(const Struct&) = default;
108 Struct& operator=(Struct&&) = default;
116 Struct(std::string name, std::string type_name, OptionalSize byte_pos = {});
117
125 bool operator==(const Struct& other) const;
133 bool operator!=(const Struct& other) const;
134
140 const std::string& getName() const;
148 void setName(const std::string& name);
149
155 const std::string& getTypeName() const;
162 void setTypeName(const std::string& type_name);
163
176 void setBytePos(OptionalSize byte_pos);
177
178 private:
179 std::string _name;
180 std::string _type_name;
181 OptionalSize _byte_pos;
182 };
183
193 Stream(std::string name,
194 std::string stream_type_name,
195 std::string description = {},
196 const std::vector<Struct>& structs = {});
204 bool operator==(const Stream& other) const;
212 bool operator!=(const Stream& other) const;
213
222 void setName(const std::string& name);
228 const std::string& getName() const;
235 void setStreamTypeName(const std::string& stream_type_name);
241 const std::string& getStreamTypeName() const;
242
248 const std::string& getDescription() const;
255 void setDescription(const std::string& description);
256
257public:
264 friend Structs;
266
272 const Structs& getStructs() const;
279
280private:
281 void notify(ModelEventCode code,
283 const std::string& additional_info);
284 bool validateContains(const Structs::access_type& stream_struct) const;
285 void notifyChangedListContent(utility::TypeAccessListEventCode code,
286 Structs::access_type& stream_struct,
287 const std::string& additional_info);
288 [[deprecated]]
289 const Structs::container_named_type* getNamedItemList() const;
290 [[deprecated]]
291 Structs::container_named_type* getNamedItemList();
292
293 const Structs::container_named_type* getNamedItemViewList() const;
294 Structs::container_named_type* getNamedItemViewList();
295
296 std::string _name;
297 std::string _stream_type_name;
298 std::string _description;
299 Structs _structs;
300};
301
302} // namespace datamodel
303} // namespace dd
304} // namespace ddl
305
306#endif // DD_DATA_MODEL_STREAMS_H_INCLUDED
Struct(Struct &&)=default
move CTOR
Struct & operator=(Struct &&)=default
move assignment operator.
Struct & operator=(const Struct &)=default
copy assignment operator.
OptionalSize getBytePos() const
Get the Byte Pos.
Struct()
default CTOR
Definition datamodel_streams.h:86
Struct(const Struct &)=default
copy CTOR
Struct(std::string name, std::string type_name, OptionalSize byte_pos={})
CTOR.
void setName(const std::string &name)
Set the Name.
bool operator==(const Struct &other) const
equality operator
const std::string & getName() const
Get the Name.
const std::string & getTypeName() const
Get the Type Name.
void setBytePos(OptionalSize byte_pos)
Set the Byte Pos.
bool operator!=(const Struct &other) const
non-equality operator
void setTypeName(const std::string &type_name)
Set the Type Name.
utility::TypeAccessList< Struct, Stream > Structs
Definiton of the container containts the streamstructs of a stream.
Definition datamodel_streams.h:262
Stream(Stream &&)
move CTOR
void setName(const std::string &name)
Set the Name.
Stream & operator=(Stream &&)
move assignment operator
void setStreamTypeName(const std::string &stream_type_name)
Set the Stream Type Name.
void setDescription(const std::string &description)
Set the Description.
virtual ~Stream()=default
DTOR.
const std::string & getDescription() const
Get the Description.
const Structs & getStructs() const
Get the Structs object.
Stream()=delete
no default CTOR.
Stream & operator=(const Stream &other)
copy assignment operator
const std::string & getName() const
Get the Name.
Stream(const Stream &other)
copy CTOR
Stream(std::string name, std::string stream_type_name, std::string description={}, const std::vector< Struct > &structs={})
CTOR.
bool operator==(const Stream &other) const
equality operator.
const std::string & getStreamTypeName() const
Get the Stream Type Name.
bool operator!=(const Stream &other) const
non equality operator.
Structs & getStructs()
Get the Structs object.
Utility class for observable named items where the order is important.
Definition access_list.h:87
Struct access_type
Definition access_list.h:90
std::unordered_map< std::string_view, value_type > container_named_type
Definition access_list.h:96
definition of the datamodel namespace
Definition datamodel_base.h:28
utility::ModelSubjectUtility< TYPE, ModelEventCode > ModelSubject
Subject template class that is observable.
Definition datamodel_base.h:187
ModelEventCode
Model event code for the data model observer.
Definition datamodel_base.h:34
ModelSubjectUtility< T, TypeAccessMapEventCode > TypeAccessMapSubject
helper template to observe map content.
Definition access_map.h:61
ModelSubjectUtility< T, TypeAccessListEventCode > TypeAccessListSubject
helper template to observe list content.
Definition access_list.h:69
TypeAccessListEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
Definition access_list.h:43
TypeAccessMapEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
Definition access_map.h:37
definition of the dd namespace
Definition datamodel_base.h:26
utility::Optional< size_t > OptionalSize
Optional Size Type.
Definition dd_common_types.h:38
definition of the ddl namespace
Definition codec.h:21