Methods (documented in current Doxygen)

For Validation: 

For UndoRedo:

Usage of the above methods (Responsibilities of  Params implementers):

Use cases:

  1. Issue a simple SetValue of a long value (e.g. resulting from the user clicking on a widget in the GUI).

The SetValue will call Params::CaptureSetLong(tag, description, value);

CaptureSetLong calls:

Command::captureStart(), creating a command with a clone of the Params that owns the value

ParamNode::SetValueLong() changing the associated value

Params::Validate(), correcting the value if it is not OK

Command::captureEnd, saving the final state of the Params, and inserting the change in the Undo/Redo queue.

 

2.  User changes one or more text values in the GUI and presses "enter"

  1. GUI issues Command::captureStart
  2. All of the text boxes in the gui are read, and a SetValue() is issued for each value.
  3. Each SetValue invokes Params::CaptureSet().
  4. Params::CaptureSet merely issues SetValue (captureStart(), captureEnd(), and Validate() are not invoked because captureStart is already active.
  5. Validate() is invoked, ensuring the Params is in a valid state
  6. Command::captureEnd() is invoked, saving the final state of the Params, inserting the Command into the Command queue.


3.  Two or more SetValue's (in the same Params instance) are combined because they are interdependent.

  1. Programmer creates a single method "SetMultipleValues(A,B,C)" that takes arguments for all the values that are to be set
  2. In SetMultipleValues() the following occurs:
    1. Command::CaptureStart captures the state of the Params before the values are set.
    2. Params::CaptureSet() is invoked for each of the values to be set (however the command will not be captured since it is already inside the CaptureStart()
    3. Params::Validate is invoked, ensuring the values are valid.
    4. Command::CaptureEnd() captures the final state of the Params after the changes.

Other Use Cases we may want to consider: