ADTF  3.18.2
datamodel_header.h
Go to the documentation of this file.
1 
15 #ifndef DD_DATA_MODEL_HEADER_H_INCLUDED
16 #define DD_DATA_MODEL_HEADER_H_INCLUDED
17 
21 #include <ddl/dd/dd_common_types.h>
23 
24 #include <string>
25 #include <unordered_map>
26 #include <vector>
27 
28 namespace ddl {
29 
30 namespace dd {
31 
32 namespace datamodel {
37 class Header : public ModelSubject<Header>, public InfoMap {
38 public:
42  Header() = delete;
48  Header(const Header& other);
54  Header& operator=(const Header& other);
58  Header(Header&&) = default;
62  Header& operator=(Header&&) = default;
66  virtual ~Header() = default;
67 
78  friend ExtDeclarations;
80 
92  Header(const Version& ddl_version,
93  const std::string& author = {},
94  const std::string& date_creation = {},
95  const std::string& date_change = {},
96  const std::string& description = {},
97  const std::vector<ExtDeclaration>& ext_declarations = {});
98 
106  bool operator==(const Header& other) const;
114  bool operator!=(const Header& other) const;
115 
128  void setLanguageVersion(const Version& ddl_version);
129 
135  const std::string& getAuthor() const;
142  void setAuthor(const std::string& author);
143 
149  const std::string& getDateCreation() const;
156  void setDateCreation(const std::string& date_creation);
157 
163  const std::string& getDateChange() const;
170  void setDateChange(const std::string& date_change);
171 
177  const std::string& getDescription() const;
184  void setDescription(const std::string& description);
185 
198 
199 private:
200  bool validateContains(const ExtDeclarations::access_type& ext_declarations_name) const;
201  void notifyChangedMapContent(utility::TypeAccessMapEventCode code,
202  ExtDeclarations::access_type& ext_declaration,
203  const std::string& additional_info);
204 
205  Version _ddl_version = {};
206  std::string _author;
207  std::string _date_creation;
208  std::string _date_change;
209  std::string _description;
210  ExtDeclarations _ext_declarations;
211 };
212 
213 } // namespace datamodel
214 } // namespace dd
215 } // namespace ddl
216 
217 #endif // DD_DATA_MODEL_HEADER_H_INCLUDED
Data Definition datamodel for the Header.
bool operator!=(const Header &other) const
Non-Equality operator.
utility::TypeAccessMap< ExtDeclaration, Header > ExtDeclarations
map container for a set of ext declarations.
ExtDeclarations & getExtDeclarations()
Get the Ext Declarations object.
const ExtDeclarations & getExtDeclarations() const
Get the Ext Declarations object.
const std::string & getDescription() const
Get the Description.
Header & operator=(const Header &other)
copy assignment.
void setLanguageVersion(const Version &ddl_version)
Set the Language Version.
Header & operator=(Header &&)=default
move assignment.
void setDescription(const std::string &description)
Set the Description object.
const std::string & getAuthor() const
Get the Author.
void setAuthor(const std::string &author)
Set the Author.
void setDateCreation(const std::string &date_creation)
Set the Date of Creation.
Header(const Header &other)
copy CTOR.
bool operator==(const Header &other) const
Equality operator.
Header(Header &&)=default
move CTOR.
void setDateChange(const std::string &date_change)
Set the Date of last Change.
Header(const Version &ddl_version, const std::string &author={}, const std::string &date_creation={}, const std::string &date_change={}, const std::string &description={}, const std::vector< ExtDeclaration > &ext_declarations={})
Construct a new Header object.
Version getLanguageVersion() const
Get the Language Version.
virtual ~Header()=default
Destroys the Header.
const std::string & getDateCreation() const
Get the Date of Creation.
Header()=delete
no default CTOR.
const std::string & getDateChange() const
Get the Date of last Change.
Info Map for the datamodel to hold a set of optional IInfo instances.
Model Subject utility to define a Model Subject that notifies one or more observers.
ExtDeclaration access_type
local definition of the access type
Definition: dd_access_map.h:76
OO DataDefinition Redesign - Data model Observer - Subject pattern.
OO DataDefinition Redesign.
DataDefinition Utility class for observable items.
OO DataDefinition Common Design.
OO DataDefinition Redesign - Data model info extension.
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