ADTF  3.18.2
datamodel_streams.h
Go to the documentation of this file.
1 
15 #ifndef DD_DATA_MODEL_STREAMS_H_INCLUDED
16 #define DD_DATA_MODEL_STREAMS_H_INCLUDED
17 
20 #include <ddl/dd/dd_common_types.h>
24 
25 #include <string>
26 #include <unordered_map>
27 #include <vector>
28 
29 namespace ddl {
30 
31 namespace dd {
32 
33 namespace datamodel {
34 
39 class Stream : public ModelSubject<Stream>,
40  public utility::TypeAccessMapSubject<Stream>,
41  public InfoMap {
42 public:
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(const std::string& name, const 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(const std::string& name,
194  const std::string& stream_type_name,
195  const 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 
257 public:
264  friend Structs;
266 
272  const Structs& getStructs() const;
279 
280 private:
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_compatibility_type* getNamedItemList() const;
290  [[deprecated]]
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
Info Map for the datamodel to hold a set of optional IInfo instances.
DataDefinition object class of datamodel to hold a streamstruct.
const std::string & getTypeName() const
Get the Type Name.
void setTypeName(const std::string &type_name)
Set the Type Name.
bool operator==(const Struct &other) const
equality operator
OptionalSize getBytePos() const
Get the Byte Pos.
Struct(const Struct &)=default
copy CTOR
void setBytePos(OptionalSize byte_pos)
Set the Byte Pos.
Struct(Struct &&)=default
move CTOR
bool operator!=(const Struct &other) const
non-equality operator
const std::string & getName() const
Get the Name.
void setName(const std::string &name)
Set the Name.
Struct & operator=(const Struct &)=default
copy assignment operator.
Struct & operator=(Struct &&)=default
move assignment operator.
Struct(const std::string &name, const std::string &type_name, OptionalSize byte_pos={})
CTOR.
observable Stream DataDefinition object.
bool operator==(const Stream &other) const
equality operator.
Structs & getStructs()
Get the Structs object.
const std::string & getDescription() const
Get the Description.
bool operator!=(const Stream &other) const
non equality operator.
void setStreamTypeName(const std::string &stream_type_name)
Set the Stream Type Name.
void setDescription(const std::string &description)
Set the Description.
Stream & operator=(const Stream &other)
copy assignment operator
const Structs & getStructs() const
Get the Structs object.
const std::string & getName() const
Get the Name.
void setName(const std::string &name)
Set the Name.
Stream(const Stream &other)
copy CTOR
Stream(Stream &&)
move CTOR
Stream(const std::string &name, const std::string &stream_type_name, const std::string &description={}, const std::vector< Struct > &structs={})
CTOR.
Stream & operator=(Stream &&)
move assignment operator
virtual ~Stream()=default
DTOR.
utility::TypeAccessList< Struct, Stream > Structs
Definiton of the container containts the streamstructs of a stream.
Stream()=delete
no default CTOR.
const std::string & getStreamTypeName() const
Get the Stream Type Name.
Model Subject utility to define a Model Subject that notifies one or more observers.
Struct access_type
local definition of the access type
std::unordered_map< std::string, value_type > container_named_compatibility_type
local definition of the container type for getNamedItemList, which was had incompatible changes withi...
std::unordered_map< std::string, value_type > container_named_type
local definition of the container type for getNamedItemViewList
OO DataDefinition Redesign - Data model Observer - Subject pattern.
DataDefinition Utility class for observable items.
DataDefinition Utility class for observable items.
DataDefinition Model-Observer pattern utility.
OO DataDefinition Common Design.
OO DataDefinition Redesign - Data model info extension.
ModelEventCode
Model event code for the data model observer.
TypeAccessMapEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
Definition: dd_access_map.h:35
TypeAccessListEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.