Hi,
I am working on some software that should be used for a special type of experiment.
The experiments are performed using:
1) A "Chip" (basically an XY grid of known dimensions). 2) Each Chip contains "Electrodes", identified by their X and Y coordinate on the chip and by a unique ID. Each electrode can also hold or not hold a sample, indicated by a simple bool (it's a biosensing chip).
I have objects that represent this hardware in C#.
I now need to use the hardware in an experiment;
1) I have an "Experiment" which exposes an IEnumerable holding "ExperimentStep" objects. 2) An "ExperimentStep" holds a name, and a limited list of "Electrodes" involved among other things.
Some experiment steps could run concurrently and could change the "HasSample" property of an electrode. Therefore, when I perform an "ExperimentStep" it might be good to know what the initial "HasSample" property is at any one time.
This is where my problem lies;
If I just pass "Electrode" objects to my "ExpermentStep" they will probably be passed by Value... Is it possible to create an IEnumerable that holds references to the unique electrodes so that each time I want to run an "ExperimentStep" the list of "Electrodes" used in that step holds the most recent value for "HasSample"? Should I use pointers for this?? From my limited knowledge of C++ I would expect that this would be trivial in that language (since you work with pointers most of the time). But in C# I really have no clue (and I am not experienced enough).