blob: 47047cad34e569ecb21e76649b1e60052d93e887 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
#include "Circuit.h"
#include "Resistor.h"
#include "Capacitor.h"
#include "Inductor.h"
#include "ShowVisitor.h"
int main() {
Circuit circuit;
ShowVisitor visitor;
circuit.add(new Resistor(50,0.05));
circuit.add(new Capacitor(5.0e-6,false));
circuit.add(new Inductor(1.0e-6,true));
for (IComponent* component : circuit)
component->accept(visitor);
return 0;
}
|