OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Circuit.h
Go to the documentation of this file.
1#pragma once
2
3//Service Header
4#include "CircuitElement.h"
5#include "EntityBlock.h"
6//C++ Header
7#include <map>
8
9
10
12{
13public:
14
15 // Existing move constructor
16 Circuit(Circuit&& other) noexcept = default;
17
18 // Copy constructor
19 Circuit(const Circuit& other) = default;
20
21 // Copy assignment operator
22 Circuit& operator=(const Circuit& other) = default;
23
24 // Move assignment operator
25 Circuit& operator=(Circuit&& other) noexcept = default;
26
27
28 Circuit();
29 ~Circuit();
30
31 //Getter
32 std::string getEditorName();
33 std::string getId();
34 std::map<ot::UID, CircuitElement*>& getMapOfElements();
35 std::map <std::string, std::vector<std::shared_ptr<EntityBlock>>>& getMapOfEntityBlcks();
36
37 //Setter
38 void addElement(ot::UID key, CircuitElement* obj);
39 void addBlockEntity(std::string block, const std::shared_ptr<EntityBlock> obj);
40 void setEditorName(std::string name);
41 void setId(const std::string id);
42
43 //additionalFunctions
44/* bool*/ void addConnection(std::string connactable,const ot::UID& key, const Connection& obj);
45 std::string findElement(const ot::UID& key);
46
47private:
48
49 std::map <ot::UID, CircuitElement*> mapOfElements;
50 std::map <std::string, std::vector<std::shared_ptr<EntityBlock>>> mapOfEntityBlocks;
51 std::string editorName;
52 std::string id;
53
54
55};
Definition CircuitElement.h:26
Definition Circuit.h:12
Circuit & operator=(Circuit &&other) noexcept=default
std::map< ot::UID, CircuitElement * > & getMapOfElements()
Definition Circuit.cpp:36
~Circuit()
Definition Circuit.cpp:16
std::string getId()
Definition Circuit.cpp:32
Circuit(const Circuit &other)=default
std::string findElement(const ot::UID &key)
Definition Circuit.cpp:76
void addConnection(std::string connactable, const ot::UID &key, const Connection &obj)
Definition Circuit.cpp:62
std::string getEditorName()
Definition Circuit.cpp:26
std::map< std::string, std::vector< std::shared_ptr< EntityBlock > > > & getMapOfEntityBlcks()
Definition Circuit.cpp:40
Circuit()
Definition Circuit.cpp:11
Circuit(Circuit &&other) noexcept=default
void addBlockEntity(std::string block, const std::shared_ptr< EntityBlock > obj)
Definition Circuit.cpp:48
Circuit & operator=(const Circuit &other)=default
void setId(const std::string id)
Definition Circuit.cpp:58
void setEditorName(std::string name)
Definition Circuit.cpp:54
void addElement(ot::UID key, CircuitElement *obj)
Definition Circuit.cpp:44
Definition Connection.h:12
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27