public byte Read(DataLocation dataLocation)
        {
            Change change = _workspace.GetDataLocation(dataLocation);
            byte   value;

            if (change == null) // the DataLocation is not in the workspace
            {
                TransactionManager tm = TransactionManager.GetInstance();
                value = tm.Read(dataLocation);
                _workspace.AddChange(new Change(dataLocation, value, false));
            }
            else // the DataLocation is in the workspace
            {
                value = change.Value;
            }
            return(value);
        }
Example #2
0
        public byte Read(DataLocation location)
        {
            Change change = _workspace.FirstOrDefault(c => c.Location == location);
            byte   value;

            if (change == null) // the DataLocation is not in the workspace
            {
                _workspace.AddChange(new Change {
                    IsWrite = false, Location = location
                });
            }
            else // the DataLocatoin is in the workspace
            {
                value = change.Value;
            }
        }
 public void StageChange(Change change)
 {
     AssertDMLocationIsMe(change.Location.DmLocation);
     _workspace.AddChange(change);
 }