Created
December 3, 2019 07:04
-
-
Save Nick0412/0b9a0ba8848cb5225d5bd663dad8fd77 to your computer and use it in GitHub Desktop.
Architecture of Circuit Solver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.h | |
class Component; | |
class Node | |
{ | |
private: | |
std::unordered_set<Component*> m_components; | |
}; | |
// Component.h | |
class Node; | |
/* Classes like resistor, inductor, capacitor, ect. | |
* inherit from this (at the moment no virtual functions) | |
*/ | |
class Component | |
{ | |
private: | |
std::unordered_set<Node*> m_nodes; | |
}; | |
// Circuit.h | |
class Component; | |
class Node; | |
class Circuit | |
{ | |
public: | |
std::unordered_set<Node*> m_nodes; | |
std::unordered_set<Component*> m_components; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment