obliqlibemb/derived/ObEmbBundle.m3


MODULE ObEmbBundle;
Generated by m3bundle; see its manpage.

IMPORT Bundle, BundleRep, Text;

TYPE T = Bundle.T OBJECT OVERRIDES
           get      := LookUp;
           getNames := GetNames;
         END;

TYPE Texts = REF ARRAY OF TEXT;

VAR
  bundle: T     := NIL;
  names : Texts := NIL;

PROCEDURE Get(): Bundle.T =
  BEGIN
    IF (bundle = NIL) THEN bundle := NEW (T) END;
    RETURN bundle;
  END Get;

PROCEDURE GetNames (<*UNUSED*> self: T): Texts =
  BEGIN
    IF names = NIL THEN
      names := NEW (Texts, NUMBER (Names));
      names^ := Names;
    END;
    RETURN names;
  END GetNames;

PROCEDURE LookUp (<*UNUSED*> self: T;  element: TEXT): TEXT =
  BEGIN
    FOR i := 0 TO LAST (Names)-1 DO
      IF Text.Equal (Names[i], element) THEN
        RETURN Elements[i];
      END;
    END;
    RETURN NIL;
  END LookUp;

CONST Names = ARRAY [0..4] OF TEXT {
  "EmbProxiedObj.obl",
  "SharedObj.obl",
  "EmbProxiedObj.hlp",
  "SharedObj.hlp",
  NIL
};

CONST Elements = ARRAY [0..4] OF TEXT {
  E0,
  E1,
  E2,
  E3,
  NIL
};

CONST E0 =
   "(* Copyright (C) 1994, Digital Equipment Corporation                   "
 & "      *)\n(* Digital Internal Use Only                                 "
 & "                *)\n(* All rights reserved.                            "
 & "                          *)\n(*                                       "
 & "                                    *)\n(* Last modified on Wed Jul 20 "
 & "17:43:23 PDT 1994 by najork                   *)\n(*       Created on W"
 & "ed Jul 20 09:39:54 PDT 1994 by najork                   *)\n\n\nmodule "
 & "EmbProxiedObjWrap for EmbProxiedObj;\n\n(* extend is used to create sub"
 & "types, and should only be used by \n   machine generated protos.  As lo"
 & "ng as raw is \"ok\", it can be used.  When \n   raw is actually assigne"
 & "d to, it just returns self. *)\n\nlet TProto = {\n  protected, \n  raw "
 & "   => ok,\n  extend => meth (self, o, r) \n\tvar new = ok;\n\tif self.r"
 & "aw is ok then \n\t\tself.raw := r;\n\t\tif o is ok then \n\t\t\tnew := "
 & "clone(self);\n\t\telse\n\t\t\tnew := clone(self, o);\n\t\tend;\n\t\tsel"
 & "f.raw := ok;\n\telse\n\t\traise(EmbProxiedObj_Error);\n\tend;\n\tnew\n\t"
 & "end,\n};\n\nend module;\n";

CONST E1 =
   "module SharedObjWrap for SharedObj;\n\n(* location is can be used to fi"
 & "nd the name of the host the shared object is \n   on.  Could use it to "
 & "decide whether or not to Pull and object, or just\n   for testing and d"
 & "ebugging. *)\nlet TProto = EmbProxiedObj_TProto.extend({\n  location =>"
 & " meth(self) sys_getEnvVar(\"HOSTNAME\") end\n}, ok);\n\nend module;\n";

CONST E2 =
   "  EmbProxiedObj_Error: Exception       \nWHERE\n  EmbProxiedObj <: { ex"
 & "tend: Self(X) All(Y<:{}) (Y) => X & Y }\n       Objects of this type al"
 & "so contain a field \"raw\", \n       which is for internal use.  \n";

CONST E3 =
   "  SharedObj_AcquireGlobalLock(obj: T): Ok ! SharedObj_Error Thread_aler"
 & "ted\n  SharedObj_ReleaseGlobalLock(obj: T): Ok ! SharedObj_Error Thread"
 & "_alerted\n  SharedObj_Own(obj: T, t: Timeliness): Ok ! SharedObj_Error "
 & "Thread_alerted\n  SharedObj_Disown(obj: T): Ok ! SharedObj_Error Thread"
 & "_alerted\n  SharedObj_SetTimeliness(obj: T, t: Timeliness): Ok \n\t\t\t"
 & "\t! SharedObj_Error Thread_alerted  \n  SharedObj_SetNodeName(name: Tex"
 & "t): Text ! SharedObj_Error Thread_alerted  \n  SharedObj_SetDefaultSequ"
 & "encer(host: Text, name: Text): Ok \n\t\t\t\t! SharedObj_Error Thread_al"
 & "erted  \n  SharedObj_SetDebugLevel(level: Int): Ok\n  SharedObj_PullObj"
 & "ect(obj: T): T;\n  SharedObj_Error: Exception       \n  SharedObj_Fatal"
 & ": Exception        \nWHERE\n  T <: EmbProxiedObj              \n  Timel"
 & "iness = -8...7\n";

BEGIN
END ObEmbBundle.