Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
ModelTreeLogicComponents.hpp
Go to the documentation of this file.
1#ifndef IV_PANELS_EDITOR_LOGIC_MODELTREELOGICCOMPONENTS_HPP
2#define IV_PANELS_EDITOR_LOGIC_MODELTREELOGICCOMPONENTS_HPP
3
5#include "logic/enums.hpp"
6#include "logic/types.hpp"
8
9#include <optional>
10
12{
13
24{
25public:
26 typedef std::pair<std::string, uint32_t> TPairIDLogicComp;// <treePath, id>. Example: <"0:0:2", 2>
27 typedef std::map<std::string, uint32_t> TMapTreeOrganization;
28
29 explicit ModelTreeLogicComponents(CLogicsAllowed &logicsAllowed, bool isLibrary,
30 std::optional<iv::types::unitId> currentLibraryId);
31
32 [[nodiscard]] uint64_t numRows() const override;
33 [[nodiscard]] std::shared_ptr<CDataList> getDataCell(uint64_t indRow, uint64_t indColumn) const override;
34 [[nodiscard]] uint64_t getParentRow(uint64_t indRow) const override;
35 void addColumns(CTree *tree) override;
36
37 [[nodiscard]] std::string getStringRow(uint64_t indRow) const;
38
39 [[nodiscard]] iv::logic::eGeneralType getLogicComponentGeneralType(uint64_t indRow) const;
40 [[nodiscard]] iv::types::logic::componentType getLogicComponentType(uint64_t indRow) const;
41 [[nodiscard]] iv::types::logic::componentFinalType getLogicComponentFinalType(uint64_t indRow) const;
42 [[nodiscard]] CLogicsAllowed &getAllowedLogics() const;
43 [[nodiscard]] bool isRoot(uint64_t indRow) const;
44 [[nodiscard]] bool isLeaf(uint64_t indRow) const;
45
46private:
47 static constexpr std::string_view kPrvPathSeparator = ":";
48 static constexpr int32_t kPrvZerosToFillInIdToString = 5;
49
50 static std::string prvIdToString(uint32_t id);
51
52 void prvBuildTreeOrganization(bool isLibrary, std::optional<iv::types::unitId> currentLibraryId);
53 void prvBuildBasicBlocksTypeNodes(const std::string &strParentPath) const;
54 void prvBuildBasicBlocksSubTypeNodes(const std::string &strParentPath, uint32_t parentType) const;
55 void prvBuildLibraryTypeNodes(const std::string &strParentPath, bool isLibrary,
56 std::optional<iv::types::unitId> currentLibraryId) const;
57 void prvBuildOthersNodes(const std::string &strParentPath, bool isLibrary) const;
58 void prvBuildUINodes(const std::string &strParentPath) const;
59
60 [[nodiscard]] TPairIDLogicComp prvGetPairRow(uint64_t indRow) const;
61 [[nodiscard]] bool prvHasChildren(uint64_t indRow) const;
62
63 static std::string prvStrGeneralType(iv::logic::eGeneralType lCGeneralType);
64 static std::string prvStrOthersType(iv::logic::eOthers otherBlock);
65 static std::string prvStrUIType(iv::logic::eLogicsElementType leType);
66
69};
70
71}// namespace iv::panels::editor::logic
72
73#endif//MODELTREELOGICCOMPONENTS_HPP
Definition CLogicsAllowed.hpp:22
Definition CTree.hpp:10
Definition IModelTree.hpp:14
Definition ModelTreeLogicComponents.hpp:24
ModelTreeLogicComponents(CLogicsAllowed &logicsAllowed, bool isLibrary, std::optional< iv::types::unitId > currentLibraryId)
Definition ModelTreeLogicComponents.cpp:42
uint64_t getParentRow(uint64_t indRow) const override
Definition ModelTreeLogicComponents.cpp:68
static constexpr std::string_view kPrvPathSeparator
Definition ModelTreeLogicComponents.hpp:47
void prvBuildTreeOrganization(bool isLibrary, std::optional< iv::types::unitId > currentLibraryId)
Definition ModelTreeLogicComponents.cpp:265
bool isRoot(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:246
std::shared_ptr< CDataList > getDataCell(uint64_t indRow, uint64_t indColumn) const override
Definition ModelTreeLogicComponents.cpp:55
void prvBuildUINodes(const std::string &strParentPath) const
Definition ModelTreeLogicComponents.cpp:395
TMapTreeOrganization * m_treeOrganization
Definition ModelTreeLogicComponents.hpp:68
static std::string prvIdToString(uint32_t id)
Definition ModelTreeLogicComponents.cpp:260
static std::string prvStrOthersType(iv::logic::eOthers otherBlock)
Definition ModelTreeLogicComponents.cpp:458
std::map< std::string, uint32_t > TMapTreeOrganization
Definition ModelTreeLogicComponents.hpp:27
CLogicsAllowed & m_logicsAllowed
Definition ModelTreeLogicComponents.hpp:67
TPairIDLogicComp prvGetPairRow(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:407
iv::logic::eGeneralType getLogicComponentGeneralType(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:201
static std::string prvStrGeneralType(iv::logic::eGeneralType lCGeneralType)
Definition ModelTreeLogicComponents.cpp:445
std::string getStringRow(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:117
bool isLeaf(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:255
std::pair< std::string, uint32_t > TPairIDLogicComp
Definition ModelTreeLogicComponents.hpp:26
CLogicsAllowed & getAllowedLogics() const
Definition ModelTreeLogicComponents.cpp:241
void addColumns(CTree *tree) override
Definition ModelTreeLogicComponents.cpp:111
void prvBuildLibraryTypeNodes(const std::string &strParentPath, bool isLibrary, std::optional< iv::types::unitId > currentLibraryId) const
Definition ModelTreeLogicComponents.cpp:350
void prvBuildBasicBlocksSubTypeNodes(const std::string &strParentPath, uint32_t parentType) const
Definition ModelTreeLogicComponents.cpp:328
uint64_t numRows() const override
Definition ModelTreeLogicComponents.cpp:50
bool prvHasChildren(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:418
static std::string prvStrUIType(iv::logic::eLogicsElementType leType)
Definition ModelTreeLogicComponents.cpp:472
void prvBuildBasicBlocksTypeNodes(const std::string &strParentPath) const
Definition ModelTreeLogicComponents.cpp:308
void prvBuildOthersNodes(const std::string &strParentPath, bool isLibrary) const
Definition ModelTreeLogicComponents.cpp:376
static constexpr int32_t kPrvZerosToFillInIdToString
Definition ModelTreeLogicComponents.hpp:48
iv::types::logic::componentFinalType getLogicComponentFinalType(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:234
iv::types::logic::componentType getLogicComponentType(uint64_t indRow) const
Definition ModelTreeLogicComponents.cpp:218
eOthers
Definition enums.hpp:30
eGeneralType
Definition enums.hpp:19
eLogicsElementType
Definition enums.hpp:8
Definition ModelTreeLogicComponents.cpp:32
uint32_t componentType
Definition types.hpp:11
uint32_t componentFinalType
Definition types.hpp:12