mentor/derived/UnionFindAlgClass.m3


 Copyright (C) 1995, Digital Equipment Corporation.       
 All rights reserved.                                     
 See the file COPYRIGHT for a full description.           
                                                          
 Last modified on Thu Feb  9 08:48:22 PST 1995 by kalsow  
      modified on Wed Feb 17 16:46:18 PST 1993 by johnh   
      modified on Thu Sep 24 10:59:20 PDT 1992 by mhb     

********************************************************************

      *  NOTE: This file is generated automatically from the event
      *        definition file UnionFind.evt.
      ********************************************************************


MODULE UnionFindAlgClass;

<*NOWARN*> IMPORT Rd, ZeusClass, Fmt, Algorithm, Wr, ZeusPanel;
<*NOWARN*> IMPORT FormsVBT, VBT, Text, ZeusUtil;

<* PRAGMA LL *>
Fix any FormsVBT errors; don't handle exceptions for them.
<* FATAL FormsVBT.Error, FormsVBT.Unimplemented *>

REVEAL
  T = Public BRANDED OBJECT
      OVERRIDES
        <* LL = VBT.mu *>
        init := UnionFindDefaultInit;
        snapshot := UnionFindDefaultSnapshot;
        restore := UnionFindDefaultRestore;
        updateEventCounts := UnionFindDefaultUpdateCts;
      END;

PROCEDURE UnionFindDefaultInit (v: T): Algorithm.T =
  <* LL = VBT.mu *>
  PROCEDURE Attach (id: TEXT; proc: FormsVBT.Proc) =
    BEGIN
      FormsVBT.AttachProc(v.eventData, id, proc, v);
    END Attach;
  BEGIN
    v.eventData := ZeusPanel.NewForm("UnionFindEventData.fv");
    Attach("stopatCodeEvents", UnionFindDoIt);
    Attach("waitatCodeEvents", UnionFindDoIt);
    Attach("eventCounts", UnionFindRefreshCts);
    Attach("stopAtSetup", UnionFindDoIt);
    Attach("waitAtSetup", UnionFindDoIt);
    Attach("stopAtNewSet", UnionFindDoIt);
    Attach("waitAtNewSet", UnionFindDoIt);
    Attach("stopAtFinishedSets", UnionFindDoIt);
    Attach("waitAtFinishedSets", UnionFindDoIt);
    Attach("stopAtStartFind", UnionFindDoIt);
    Attach("waitAtStartFind", UnionFindDoIt);
    Attach("stopAtEndFind", UnionFindDoIt);
    Attach("waitAtEndFind", UnionFindDoIt);
    Attach("stopAtStartDoFind", UnionFindDoIt);
    Attach("waitAtStartDoFind", UnionFindDoIt);
    Attach("stopAtStepUp", UnionFindDoIt);
    Attach("waitAtStepUp", UnionFindDoIt);
    Attach("stopAtFound", UnionFindDoIt);
    Attach("waitAtFound", UnionFindDoIt);
    Attach("stopAtStepDown", UnionFindDoIt);
    Attach("waitAtStepDown", UnionFindDoIt);
    Attach("stopAtChangeParent", UnionFindDoIt);
    Attach("waitAtChangeParent", UnionFindDoIt);
    Attach("stopAtEndDoFind", UnionFindDoIt);
    Attach("waitAtEndDoFind", UnionFindDoIt);
    Attach("stopAtStartUnion", UnionFindDoIt);
    Attach("waitAtStartUnion", UnionFindDoIt);
    Attach("stopAtFoundFirst", UnionFindDoIt);
    Attach("waitAtFoundFirst", UnionFindDoIt);
    Attach("stopAtCompareRanks", UnionFindDoIt);
    Attach("waitAtCompareRanks", UnionFindDoIt);
    Attach("stopAtUnite", UnionFindDoIt);
    Attach("waitAtUnite", UnionFindDoIt);
    Attach("stopAtEndUnion", UnionFindDoIt);
    Attach("waitAtEndUnion", UnionFindDoIt);
    FromFV (v.eventData, v);    (* Get FV and internal data in sync *)
    RETURN Algorithm.T.init(v);
  END UnionFindDefaultInit;

PROCEDURE UnionFindDoIt (           fv : FormsVBT.T;
                           e  : TEXT;
                           arg: REFANY;
                <*UNUSED*> t  : VBT.TimeStamp) =
  <* LL = VBT.mu *>
  BEGIN
    IF Text.Equal(e, "stopatCodeEvents") THEN
      NARROW(arg, T).stopatCodeEvents :=
          FormsVBT.GetBoolean(fv, "stopatCodeEvents");
    END;
    IF Text.Equal(e, "waitatCodeEvents") THEN
      NARROW(arg, T).waitatCodeEvents :=
          FormsVBT.GetInteger(fv, "waitatCodeEvents");
    END;
    IF Text.Equal(e, "stopAtSetup") THEN
      NARROW(arg, T).eventDataRec.stopAtSetup :=
          FormsVBT.GetBoolean(fv, "stopAtSetup");
    END;
    IF Text.Equal(e, "waitAtSetup") THEN
      NARROW(arg, T).eventDataRec.waitAtSetup :=
          FormsVBT.GetInteger(fv, "waitAtSetup");
    END;
    IF Text.Equal(e, "stopAtNewSet") THEN
      NARROW(arg, T).eventDataRec.stopAtNewSet :=
          FormsVBT.GetBoolean(fv, "stopAtNewSet");
    END;
    IF Text.Equal(e, "waitAtNewSet") THEN
      NARROW(arg, T).eventDataRec.waitAtNewSet :=
          FormsVBT.GetInteger(fv, "waitAtNewSet");
    END;
    IF Text.Equal(e, "stopAtFinishedSets") THEN
      NARROW(arg, T).eventDataRec.stopAtFinishedSets :=
          FormsVBT.GetBoolean(fv, "stopAtFinishedSets");
    END;
    IF Text.Equal(e, "waitAtFinishedSets") THEN
      NARROW(arg, T).eventDataRec.waitAtFinishedSets :=
          FormsVBT.GetInteger(fv, "waitAtFinishedSets");
    END;
    IF Text.Equal(e, "stopAtStartFind") THEN
      NARROW(arg, T).eventDataRec.stopAtStartFind :=
          FormsVBT.GetBoolean(fv, "stopAtStartFind");
    END;
    IF Text.Equal(e, "waitAtStartFind") THEN
      NARROW(arg, T).eventDataRec.waitAtStartFind :=
          FormsVBT.GetInteger(fv, "waitAtStartFind");
    END;
    IF Text.Equal(e, "stopAtEndFind") THEN
      NARROW(arg, T).eventDataRec.stopAtEndFind :=
          FormsVBT.GetBoolean(fv, "stopAtEndFind");
    END;
    IF Text.Equal(e, "waitAtEndFind") THEN
      NARROW(arg, T).eventDataRec.waitAtEndFind :=
          FormsVBT.GetInteger(fv, "waitAtEndFind");
    END;
    IF Text.Equal(e, "stopAtStartDoFind") THEN
      NARROW(arg, T).eventDataRec.stopAtStartDoFind :=
          FormsVBT.GetBoolean(fv, "stopAtStartDoFind");
    END;
    IF Text.Equal(e, "waitAtStartDoFind") THEN
      NARROW(arg, T).eventDataRec.waitAtStartDoFind :=
          FormsVBT.GetInteger(fv, "waitAtStartDoFind");
    END;
    IF Text.Equal(e, "stopAtStepUp") THEN
      NARROW(arg, T).eventDataRec.stopAtStepUp :=
          FormsVBT.GetBoolean(fv, "stopAtStepUp");
    END;
    IF Text.Equal(e, "waitAtStepUp") THEN
      NARROW(arg, T).eventDataRec.waitAtStepUp :=
          FormsVBT.GetInteger(fv, "waitAtStepUp");
    END;
    IF Text.Equal(e, "stopAtFound") THEN
      NARROW(arg, T).eventDataRec.stopAtFound :=
          FormsVBT.GetBoolean(fv, "stopAtFound");
    END;
    IF Text.Equal(e, "waitAtFound") THEN
      NARROW(arg, T).eventDataRec.waitAtFound :=
          FormsVBT.GetInteger(fv, "waitAtFound");
    END;
    IF Text.Equal(e, "stopAtStepDown") THEN
      NARROW(arg, T).eventDataRec.stopAtStepDown :=
          FormsVBT.GetBoolean(fv, "stopAtStepDown");
    END;
    IF Text.Equal(e, "waitAtStepDown") THEN
      NARROW(arg, T).eventDataRec.waitAtStepDown :=
          FormsVBT.GetInteger(fv, "waitAtStepDown");
    END;
    IF Text.Equal(e, "stopAtChangeParent") THEN
      NARROW(arg, T).eventDataRec.stopAtChangeParent :=
          FormsVBT.GetBoolean(fv, "stopAtChangeParent");
    END;
    IF Text.Equal(e, "waitAtChangeParent") THEN
      NARROW(arg, T).eventDataRec.waitAtChangeParent :=
          FormsVBT.GetInteger(fv, "waitAtChangeParent");
    END;
    IF Text.Equal(e, "stopAtEndDoFind") THEN
      NARROW(arg, T).eventDataRec.stopAtEndDoFind :=
          FormsVBT.GetBoolean(fv, "stopAtEndDoFind");
    END;
    IF Text.Equal(e, "waitAtEndDoFind") THEN
      NARROW(arg, T).eventDataRec.waitAtEndDoFind :=
          FormsVBT.GetInteger(fv, "waitAtEndDoFind");
    END;
    IF Text.Equal(e, "stopAtStartUnion") THEN
      NARROW(arg, T).eventDataRec.stopAtStartUnion :=
          FormsVBT.GetBoolean(fv, "stopAtStartUnion");
    END;
    IF Text.Equal(e, "waitAtStartUnion") THEN
      NARROW(arg, T).eventDataRec.waitAtStartUnion :=
          FormsVBT.GetInteger(fv, "waitAtStartUnion");
    END;
    IF Text.Equal(e, "stopAtFoundFirst") THEN
      NARROW(arg, T).eventDataRec.stopAtFoundFirst :=
          FormsVBT.GetBoolean(fv, "stopAtFoundFirst");
    END;
    IF Text.Equal(e, "waitAtFoundFirst") THEN
      NARROW(arg, T).eventDataRec.waitAtFoundFirst :=
          FormsVBT.GetInteger(fv, "waitAtFoundFirst");
    END;
    IF Text.Equal(e, "stopAtCompareRanks") THEN
      NARROW(arg, T).eventDataRec.stopAtCompareRanks :=
          FormsVBT.GetBoolean(fv, "stopAtCompareRanks");
    END;
    IF Text.Equal(e, "waitAtCompareRanks") THEN
      NARROW(arg, T).eventDataRec.waitAtCompareRanks :=
          FormsVBT.GetInteger(fv, "waitAtCompareRanks");
    END;
    IF Text.Equal(e, "stopAtUnite") THEN
      NARROW(arg, T).eventDataRec.stopAtUnite :=
          FormsVBT.GetBoolean(fv, "stopAtUnite");
    END;
    IF Text.Equal(e, "waitAtUnite") THEN
      NARROW(arg, T).eventDataRec.waitAtUnite :=
          FormsVBT.GetInteger(fv, "waitAtUnite");
    END;
    IF Text.Equal(e, "stopAtEndUnion") THEN
      NARROW(arg, T).eventDataRec.stopAtEndUnion :=
          FormsVBT.GetBoolean(fv, "stopAtEndUnion");
    END;
    IF Text.Equal(e, "waitAtEndUnion") THEN
      NARROW(arg, T).eventDataRec.waitAtEndUnion :=
          FormsVBT.GetInteger(fv, "waitAtEndUnion");
    END;
  END UnionFindDoIt;

PROCEDURE UnionFindRefreshCts (
                <*UNUSED*> fv  : FormsVBT.T;
                <*UNUSED*> e   : TEXT;
                           arg : REFANY;
                <*UNUSED*> t   : VBT.TimeStamp) =
  <* LL = VBT.mu *>
  BEGIN
    NARROW(arg, T).updateEventCounts(FALSE);
  END UnionFindRefreshCts;

PROCEDURE FromFV (fv : FormsVBT.T; alg: T) =
  <* LL = VBT.mu *>
  BEGIN
    alg.stopatCodeEvents :=
        FormsVBT.GetBoolean(fv, "stopatCodeEvents");
    alg.waitatCodeEvents :=
        FormsVBT.GetInteger(fv, "waitatCodeEvents");
    alg.eventDataRec.stopAtSetup :=
        FormsVBT.GetBoolean(fv, "stopAtSetup");
    alg.eventDataRec.waitAtSetup :=
        FormsVBT.GetInteger(fv, "waitAtSetup");
    alg.eventDataRec.stopAtNewSet :=
        FormsVBT.GetBoolean(fv, "stopAtNewSet");
    alg.eventDataRec.waitAtNewSet :=
        FormsVBT.GetInteger(fv, "waitAtNewSet");
    alg.eventDataRec.stopAtFinishedSets :=
        FormsVBT.GetBoolean(fv, "stopAtFinishedSets");
    alg.eventDataRec.waitAtFinishedSets :=
        FormsVBT.GetInteger(fv, "waitAtFinishedSets");
    alg.eventDataRec.stopAtStartFind :=
        FormsVBT.GetBoolean(fv, "stopAtStartFind");
    alg.eventDataRec.waitAtStartFind :=
        FormsVBT.GetInteger(fv, "waitAtStartFind");
    alg.eventDataRec.stopAtEndFind :=
        FormsVBT.GetBoolean(fv, "stopAtEndFind");
    alg.eventDataRec.waitAtEndFind :=
        FormsVBT.GetInteger(fv, "waitAtEndFind");
    alg.eventDataRec.stopAtStartDoFind :=
        FormsVBT.GetBoolean(fv, "stopAtStartDoFind");
    alg.eventDataRec.waitAtStartDoFind :=
        FormsVBT.GetInteger(fv, "waitAtStartDoFind");
    alg.eventDataRec.stopAtStepUp :=
        FormsVBT.GetBoolean(fv, "stopAtStepUp");
    alg.eventDataRec.waitAtStepUp :=
        FormsVBT.GetInteger(fv, "waitAtStepUp");
    alg.eventDataRec.stopAtFound :=
        FormsVBT.GetBoolean(fv, "stopAtFound");
    alg.eventDataRec.waitAtFound :=
        FormsVBT.GetInteger(fv, "waitAtFound");
    alg.eventDataRec.stopAtStepDown :=
        FormsVBT.GetBoolean(fv, "stopAtStepDown");
    alg.eventDataRec.waitAtStepDown :=
        FormsVBT.GetInteger(fv, "waitAtStepDown");
    alg.eventDataRec.stopAtChangeParent :=
        FormsVBT.GetBoolean(fv, "stopAtChangeParent");
    alg.eventDataRec.waitAtChangeParent :=
        FormsVBT.GetInteger(fv, "waitAtChangeParent");
    alg.eventDataRec.stopAtEndDoFind :=
        FormsVBT.GetBoolean(fv, "stopAtEndDoFind");
    alg.eventDataRec.waitAtEndDoFind :=
        FormsVBT.GetInteger(fv, "waitAtEndDoFind");
    alg.eventDataRec.stopAtStartUnion :=
        FormsVBT.GetBoolean(fv, "stopAtStartUnion");
    alg.eventDataRec.waitAtStartUnion :=
        FormsVBT.GetInteger(fv, "waitAtStartUnion");
    alg.eventDataRec.stopAtFoundFirst :=
        FormsVBT.GetBoolean(fv, "stopAtFoundFirst");
    alg.eventDataRec.waitAtFoundFirst :=
        FormsVBT.GetInteger(fv, "waitAtFoundFirst");
    alg.eventDataRec.stopAtCompareRanks :=
        FormsVBT.GetBoolean(fv, "stopAtCompareRanks");
    alg.eventDataRec.waitAtCompareRanks :=
        FormsVBT.GetInteger(fv, "waitAtCompareRanks");
    alg.eventDataRec.stopAtUnite :=
        FormsVBT.GetBoolean(fv, "stopAtUnite");
    alg.eventDataRec.waitAtUnite :=
        FormsVBT.GetInteger(fv, "waitAtUnite");
    alg.eventDataRec.stopAtEndUnion :=
        FormsVBT.GetBoolean(fv, "stopAtEndUnion");
    alg.eventDataRec.waitAtEndUnion :=
        FormsVBT.GetInteger(fv, "waitAtEndUnion");
  END FromFV;

<*UNUSED*>
PROCEDURE ToFV (fv : FormsVBT.T; alg: T) =
  <* LL = VBT.mu *>
  BEGIN
    FormsVBT.PutBoolean(fv, "stopatCodeEvents", alg.stopatCodeEvents);
    FormsVBT.PutInteger(fv, "waitatCodeEvents", alg.waitatCodeEvents);
    FormsVBT.PutBoolean(fv, "stopAtSetup",
                        alg.eventDataRec.stopAtSetup);
    FormsVBT.PutInteger(fv, "waitAtSetup",
                        alg.eventDataRec.waitAtSetup);
    FormsVBT.PutBoolean(fv, "stopAtNewSet",
                        alg.eventDataRec.stopAtNewSet);
    FormsVBT.PutInteger(fv, "waitAtNewSet",
                        alg.eventDataRec.waitAtNewSet);
    FormsVBT.PutBoolean(fv, "stopAtFinishedSets",
                        alg.eventDataRec.stopAtFinishedSets);
    FormsVBT.PutInteger(fv, "waitAtFinishedSets",
                        alg.eventDataRec.waitAtFinishedSets);
    FormsVBT.PutBoolean(fv, "stopAtStartFind",
                        alg.eventDataRec.stopAtStartFind);
    FormsVBT.PutInteger(fv, "waitAtStartFind",
                        alg.eventDataRec.waitAtStartFind);
    FormsVBT.PutBoolean(fv, "stopAtEndFind",
                        alg.eventDataRec.stopAtEndFind);
    FormsVBT.PutInteger(fv, "waitAtEndFind",
                        alg.eventDataRec.waitAtEndFind);
    FormsVBT.PutBoolean(fv, "stopAtStartDoFind",
                        alg.eventDataRec.stopAtStartDoFind);
    FormsVBT.PutInteger(fv, "waitAtStartDoFind",
                        alg.eventDataRec.waitAtStartDoFind);
    FormsVBT.PutBoolean(fv, "stopAtStepUp",
                        alg.eventDataRec.stopAtStepUp);
    FormsVBT.PutInteger(fv, "waitAtStepUp",
                        alg.eventDataRec.waitAtStepUp);
    FormsVBT.PutBoolean(fv, "stopAtFound",
                        alg.eventDataRec.stopAtFound);
    FormsVBT.PutInteger(fv, "waitAtFound",
                        alg.eventDataRec.waitAtFound);
    FormsVBT.PutBoolean(fv, "stopAtStepDown",
                        alg.eventDataRec.stopAtStepDown);
    FormsVBT.PutInteger(fv, "waitAtStepDown",
                        alg.eventDataRec.waitAtStepDown);
    FormsVBT.PutBoolean(fv, "stopAtChangeParent",
                        alg.eventDataRec.stopAtChangeParent);
    FormsVBT.PutInteger(fv, "waitAtChangeParent",
                        alg.eventDataRec.waitAtChangeParent);
    FormsVBT.PutBoolean(fv, "stopAtEndDoFind",
                        alg.eventDataRec.stopAtEndDoFind);
    FormsVBT.PutInteger(fv, "waitAtEndDoFind",
                        alg.eventDataRec.waitAtEndDoFind);
    FormsVBT.PutBoolean(fv, "stopAtStartUnion",
                        alg.eventDataRec.stopAtStartUnion);
    FormsVBT.PutInteger(fv, "waitAtStartUnion",
                        alg.eventDataRec.waitAtStartUnion);
    FormsVBT.PutBoolean(fv, "stopAtFoundFirst",
                        alg.eventDataRec.stopAtFoundFirst);
    FormsVBT.PutInteger(fv, "waitAtFoundFirst",
                        alg.eventDataRec.waitAtFoundFirst);
    FormsVBT.PutBoolean(fv, "stopAtCompareRanks",
                        alg.eventDataRec.stopAtCompareRanks);
    FormsVBT.PutInteger(fv, "waitAtCompareRanks",
                        alg.eventDataRec.waitAtCompareRanks);
    FormsVBT.PutBoolean(fv, "stopAtUnite",
                        alg.eventDataRec.stopAtUnite);
    FormsVBT.PutInteger(fv, "waitAtUnite",
                        alg.eventDataRec.waitAtUnite);
    FormsVBT.PutBoolean(fv, "stopAtEndUnion",
                        alg.eventDataRec.stopAtEndUnion);
    FormsVBT.PutInteger(fv, "waitAtEndUnion",
                        alg.eventDataRec.waitAtEndUnion);
    CountsToFV (fv, alg);
  END ToFV;

PROCEDURE CountsToFV (fv : FormsVBT.T; alg: T) =
  <* LL = VBT.mu *>
  BEGIN
    FormsVBT.PutText(fv, "ctOfSetup",
                        Fmt.Int(alg.eventDataRec.ctOfSetup));
    FormsVBT.PutText(fv, "ctOfNewSet",
                        Fmt.Int(alg.eventDataRec.ctOfNewSet));
    FormsVBT.PutText(fv, "ctOfFinishedSets",
                        Fmt.Int(alg.eventDataRec.ctOfFinishedSets));
    FormsVBT.PutText(fv, "ctOfStartFind",
                        Fmt.Int(alg.eventDataRec.ctOfStartFind));
    FormsVBT.PutText(fv, "ctOfEndFind",
                        Fmt.Int(alg.eventDataRec.ctOfEndFind));
    FormsVBT.PutText(fv, "ctOfStartDoFind",
                        Fmt.Int(alg.eventDataRec.ctOfStartDoFind));
    FormsVBT.PutText(fv, "ctOfStepUp",
                        Fmt.Int(alg.eventDataRec.ctOfStepUp));
    FormsVBT.PutText(fv, "ctOfFound",
                        Fmt.Int(alg.eventDataRec.ctOfFound));
    FormsVBT.PutText(fv, "ctOfStepDown",
                        Fmt.Int(alg.eventDataRec.ctOfStepDown));
    FormsVBT.PutText(fv, "ctOfChangeParent",
                        Fmt.Int(alg.eventDataRec.ctOfChangeParent));
    FormsVBT.PutText(fv, "ctOfEndDoFind",
                        Fmt.Int(alg.eventDataRec.ctOfEndDoFind));
    FormsVBT.PutText(fv, "ctOfStartUnion",
                        Fmt.Int(alg.eventDataRec.ctOfStartUnion));
    FormsVBT.PutText(fv, "ctOfFoundFirst",
                        Fmt.Int(alg.eventDataRec.ctOfFoundFirst));
    FormsVBT.PutText(fv, "ctOfCompareRanks",
                        Fmt.Int(alg.eventDataRec.ctOfCompareRanks));
    FormsVBT.PutText(fv, "ctOfUnite",
                        Fmt.Int(alg.eventDataRec.ctOfUnite));
    FormsVBT.PutText(fv, "ctOfEndUnion",
                        Fmt.Int(alg.eventDataRec.ctOfEndUnion));
  END CountsToFV;

PROCEDURE UnionFindDefaultUpdateCts ( v: T; reset: BOOLEAN) =
  <* LL = VBT.mu *>
  BEGIN
    IF reset THEN
      v.eventDataRec.ctOfSetup := 0;
      v.eventDataRec.ctOfNewSet := 0;
      v.eventDataRec.ctOfFinishedSets := 0;
      v.eventDataRec.ctOfStartFind := 0;
      v.eventDataRec.ctOfEndFind := 0;
      v.eventDataRec.ctOfStartDoFind := 0;
      v.eventDataRec.ctOfStepUp := 0;
      v.eventDataRec.ctOfFound := 0;
      v.eventDataRec.ctOfStepDown := 0;
      v.eventDataRec.ctOfChangeParent := 0;
      v.eventDataRec.ctOfEndDoFind := 0;
      v.eventDataRec.ctOfStartUnion := 0;
      v.eventDataRec.ctOfFoundFirst := 0;
      v.eventDataRec.ctOfCompareRanks := 0;
      v.eventDataRec.ctOfUnite := 0;
      v.eventDataRec.ctOfEndUnion := 0;
    END;
    CountsToFV (v.eventData, v);
  END UnionFindDefaultUpdateCts;

PROCEDURE UnionFindDefaultSnapshot (v: T; wr: Wr.T)
  RAISES {ZeusClass.Error} =
  <* LL = VBT.mu *>
  BEGIN
    TRY
      Wr.PutChar(wr, '(')
    EXCEPT
    ELSE
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultSnapshot write error");
    END;
    IF v.eventData = NIL THEN
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultSnapshot: " &
          "eventData not set!");
    END;
    TRY
      v.eventData.snapshot(wr)
    EXCEPT
      FormsVBT.Error (msg) =>
        RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultSnapshot FV error: "
          & msg);
    ELSE
      RAISE ZeusClass.Error(
        "UnionFindAlgClass.UnionFindDefaultSnapshot error");
    END;
    Algorithm.T.snapshot(v, wr);
    TRY
      Wr.PutChar(wr, ')')
    EXCEPT
    ELSE
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultSnapshot write error");
    END;
  END UnionFindDefaultSnapshot;

PROCEDURE UnionFindDefaultRestore (v: T; rd: Rd.T)
  RAISES {ZeusClass.Error} =
  <* LL = VBT.mu *>
  BEGIN
    IF rd = NIL THEN RETURN END;
    IF NOT ZeusUtil.EatChar(rd, '(') THEN
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultRestore read error");
    END;
    IF v.eventData = NIL THEN
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultRestore: " &
          "eventData not set!");
    END;
    TRY
      v.eventData.restore(rd);
      v.updateEventCounts(FALSE);
      FromFV(v.eventData, v);
    EXCEPT
    ELSE
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultRestore error");
    END;
    Algorithm.T.restore(v, rd);
    IF NOT ZeusUtil.EatChar(rd, ')') THEN
      RAISE ZeusClass.Error(
          "UnionFindAlgClass.UnionFindDefaultRestore read error");
    END;
  END UnionFindDefaultRestore;

BEGIN
END UnionFindAlgClass.