OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphHandler.h
Go to the documentation of this file.
1#pragma once
4#include "EntityBlock.h"
6#include "Graph.h"
7
8#include<map>
9
11{
12public:
13 bool blockDiagramIsValid(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID);
14
15 const std::map<ot::UID, std::shared_ptr<GraphNode>>& getgraphNodesByBlockID() const { return m_graphNodeByBlockID; };
16 const std::list < std::shared_ptr<GraphNode>>& getRootNodes() const { return m_rootNodes; }
17
18private:
19 std::string m_blockFolder = ot::FolderNames::BlockFolder;
20 std::map<ot::UID, std::shared_ptr<GraphNode>> m_graphNodeByBlockID;
21 std::map<std::shared_ptr<GraphNode>, std::shared_ptr<EntityBlock>> m_entityByGraphNode;
22 std::list < std::shared_ptr<GraphNode>> m_rootNodes;
23
24 const std::string getNameWithoutRoot(EntityBase* _entity);
25
26 bool allRequiredConnectionsSet(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID, std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID);
27 std::map<ot::UID, std::shared_ptr<EntityBlockConnection>> loadAllConnections(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID);
28 void sortOutUnusedBlocks(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID);
29 void sortOutDanglingConnections(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID, std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID);
30
31 bool allConnectionsAreValid(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID, std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID);
32 bool entityHasIncommingConnectionsSet(std::shared_ptr<EntityBlock>& blockEntity, std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID, std::string& uiMessage);
33 bool hasNoCycle(std::map<ot::UID, std::shared_ptr<EntityBlock>>& allBlockEntitiesByBlockID,std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID);
34 Graph buildGraph(std::map<ot::UID, std::shared_ptr<EntityBlock>>& _allBlockEntitiesByBlockID, std::map<ot::UID, std::shared_ptr<EntityBlockConnection>>& _allConnectionsByID);
35};
Common methods for all central service handler classes.
Definition BusinessLogicHandler.h:16
Definition GraphHandler.h:11
bool blockDiagramIsValid(std::map< ot::UID, std::shared_ptr< EntityBlock > > &_allBlockEntitiesByBlockID)
Definition GraphHandler.cpp:8
const std::map< ot::UID, std::shared_ptr< GraphNode > > & getgraphNodesByBlockID() const
Definition GraphHandler.h:15
const std::list< std::shared_ptr< GraphNode > > & getRootNodes() const
Definition GraphHandler.h:16
Definition Graph.h:9
const std::string BlockFolder
Definition FolderNames.h:11
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27