protected SensorReadout(DateTime time, Car car, string description) { _time = time; _car = car; _description = description; _next = null; }
public void Append(SensorReadout sensorReadout) { if (_next == null) { _next = sensorReadout; } else { _next.Append(sensorReadout); } }
private void AppendToHistory(SensorReadout readout) { if (_history == null) { _history = readout; } else { _history.Append(readout); } }
public static void RetrieveSnapshotsSequentially(IObjectContainer db) { IObjectSet result = db.QueryByExample(typeof(Car)); Car car = (Car)result.Next(); SensorReadout readout = car.GetHistory(); while (readout != null) { Console.WriteLine(readout); readout = readout.Next; } }
public static void RetrieveSnapshotsSequentiallyCascade() { IEmbeddedConfiguration config = Db4oEmbedded.NewConfiguration(); config.Common.ObjectClass(typeof(TemperatureSensorReadout)) .CascadeOnActivate(true); using (IObjectContainer db = Db4oEmbedded.OpenFile(config, YapFileName)) { IObjectSet result = db.QueryByExample(typeof(Car)); Car car = (Car)result.Next(); SensorReadout readout = car.GetHistory(); while (readout != null) { Console.WriteLine(readout); readout = readout.Next; } } }
public Car(string model) { _model = model; _pilot = null; _history = null; }