Refactored the hardware code and added the visitor pattern for operations on the computer/hardware/sensor/parameter tree.

This commit is contained in:
Michael Möller
2010-05-09 16:22:13 +00:00
parent a49919717e
commit 4cd9cd9125
28 changed files with 372 additions and 89 deletions

View File

@@ -205,5 +205,14 @@ namespace OpenHardwareMonitor.Hardware {
public float Value { get { return value; } }
public DateTime Time { get { return time; } }
}
public void Accept(IVisitor visitor) {
visitor.VisitSensor(this);
}
public void Traverse(IVisitor visitor) {
foreach (IParameter parameter in parameters)
parameter.Accept(visitor);
}
}
}