@startuml

' Base class
class SystemElement {
    - string name
    + SystemElement(string name)
}

' Template container class
class SystemElementContainer<T> {
    - unsigned int iter_count
    - unordered_map<string, T*> content
    + SystemElementContainer(string name)
    + SystemElementContainer(string name, vector<T*> elements)
    + bool exists(string name)
    + void add(T* element)
    + void add(SystemElementContainer<T>* elements)
    + void add(vector<T*> elements)
    + T* get(string name)
    + T* merge(string name)
    + iterator begin()
    + iterator end()
    + const_iterator begin() const
    + const_iterator end() const
}

SystemElementContainer --|> SystemElement

' Part and Pin classes
class Part {
    + Part(string name)
    + void add(Pin* pin)
}

class Pin {
    + Pin(string name)
    + void connect(Signal* signal)
}

Part --* Pin

' Signal class
class Signal {
    + Signal(string name)
    + void connect(Pin* pin)
}

Pin --> Signal

' Module and Modules classes
class Module {
    + Signals* signals
    + Modules* prnt
    + Module(string name)
    + ~Module()
}

class Modules {
    + Modules()
    + Modules(vector<Module*> parts)
    + void add(Module* module)
    + ~Modules()
}

Module --|> SystemElementContainer
Modules --|> SystemElementContainer
Module --> Modules
Module --> Signals

@enduml
