Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CLogicsComponentLabel.hpp
Go to the documentation of this file.
1#ifndef LIBS_LOGIC_CLOGICSCOMPONENTLABEL_HPP_
2#define LIBS_LOGIC_CLOGICSCOMPONENTLABEL_HPP_
3
5
6#include <bits/stdint-uintn.h>
7#include <string>
8
16{
17public:
18 enum class ELabelIOType
19 {
20 Input,
21 Output,
23 };// type of connection point the label is connected to
24
25 typedef uint16_t
26 TUniqueLabelDefaultIdNumber;// default names for labels will be assigned a number, like "LB_1", "LB_2", etc.
28 static inline const std::string kDefaultUniqueLabelName = "LB_";
29 static inline const std::string kUnsetLabel = "???";
30
31 static ELabelIOType enumLabelIOType(const std::string &strType);
32 static std::string strLabelIOType(ELabelIOType labelIOType);
33
34 explicit CLogicsComponentLabel(const iv::types::logic::ComponentType &componentType);
36 const std::string &name);
38 ~CLogicsComponentLabel() override = default;
43
44 iv::file::xml::node read(const iv::file::xml::node &node) override;
45 iv::file::xml::node save(iv::file::xml::node &node) const override;
46
47 [[nodiscard]] std::string maxText() const override;
48 [[nodiscard]] std::string getDescriptiveText() const override;
49
50 void setLabelDescription(const std::string &description);
51 void setLabelIOTYpe(ELabelIOType labelIOType);
52 void setLabelName(const std::string &labelName);
53
54 [[nodiscard]] ELabelIOType getLabelIOType() const;
55 [[nodiscard]] const std::string &getLabelDescription() const;
56 [[nodiscard]] const std::string &getLabelName() const;
57
58private:
60 std::string m_labelName;// name of label, which will also be its identifier
61 std::string m_labelDescription;
62};
63
64#endif /* LIBS_LOGIC_CLOGICSCOMPONENTLABEL_HPP_ */
uint32_t TId
Definition AbstractCanvasItem.hpp:47
Definition CLogicsComponentLabel.hpp:16
std::string maxText() const override
Definition CLogicsComponentLabel.cpp:83
CLogicsComponentLabel(CLogicsComponentLabel &&other)=delete
CLogicsComponentLabel(const CLogicsComponentLabel &other)=delete
CLogicsComponentLabel & operator=(CLogicsComponentLabel &&other)=delete
static const std::string kUnsetLabel
Definition CLogicsComponentLabel.hpp:29
std::string getDescriptiveText() const override
Definition CLogicsComponentLabel.cpp:88
void setLabelDescription(const std::string &description)
Definition CLogicsComponentLabel.cpp:98
iv::file::xml::node save(iv::file::xml::node &node) const override
Definition CLogicsComponentLabel.cpp:68
const std::string & getLabelName() const
Definition CLogicsComponentLabel.cpp:123
static const TUniqueLabelDefaultIdNumber kInitialUniqueLabelIdNumber
Definition CLogicsComponentLabel.hpp:27
std::string m_labelName
Definition CLogicsComponentLabel.hpp:60
~CLogicsComponentLabel() override=default
void setLabelIOTYpe(ELabelIOType labelIOType)
Definition CLogicsComponentLabel.cpp:103
void setLabelName(const std::string &labelName)
Definition CLogicsComponentLabel.cpp:108
std::string m_labelDescription
Definition CLogicsComponentLabel.hpp:61
CLogicsComponentLabel & operator=(const CLogicsComponentLabel &other)=delete
ELabelIOType
Definition CLogicsComponentLabel.hpp:19
iv::file::xml::node read(const iv::file::xml::node &node) override
Definition CLogicsComponentLabel.cpp:53
CLogicsComponentLabel()=delete
ELabelIOType m_labelIOType
Definition CLogicsComponentLabel.hpp:59
ELabelIOType getLabelIOType() const
Definition CLogicsComponentLabel.cpp:113
uint16_t TUniqueLabelDefaultIdNumber
Definition CLogicsComponentLabel.hpp:26
static ELabelIOType enumLabelIOType(const std::string &strType)
Definition CLogicsComponentLabel.cpp:16
static const std::string kDefaultUniqueLabelName
Definition CLogicsComponentLabel.hpp:28
static std::string strLabelIOType(ELabelIOType labelIOType)
Definition CLogicsComponentLabel.cpp:26
const std::string & getLabelDescription() const
Definition CLogicsComponentLabel.cpp:118
Definition CLogicsComponentOthers.hpp:12
Definition xmlFile.hpp:15
Tuple containing the type of logic component (logic blocks, library blocks & others blocks).
Definition types.hpp:22