      *>---------------------------------------------------------------
      *> Base is the superclass of all other classes. It handles the
      *> default behavior for methods which deal with hashing, error
      *> handling and persistence.
      *>
      *> Copyright (C) 1991-1996 Micro Focus International Ltd.
      *>
      *>----------------------------------------------------------------
       class-id. base is external.

       special-names.
          call-convention 0 is paramcountcheck
          .
       object section.
       class-control.
           Base is class "base".

       working-storage section.

       class-object.
       object-storage section.
       end class-object.

       Object.

       object-storage section.
      *>----------------------------------------------------------------
      *> Report an error for this instance using ErrNumber. This may
      *> actually end up calling a user defined exception handler if one
      *> has been registered.
      *>----------------------------------------------------------------
       method-id. "raiseException".
       linkage section.
       01 result               usage object reference.
       01 errnumber            pic x(4) comp-5.

       procedure division paramcountcheck
                   using errnumber returning result

       INVOKED AS == RAISE [EXCEPTION] [<self>] <errnumber>
           [[GIVING] <result>] ==
       .
       end method "raiseException".
      *>------------------------------------------------------------
      *> Generate a Callback instance for a method with the required
      *> parameter and add it to the IdentityDictionary for
      *> the socket.
      *>------------------------------------------------------------
       Method-id. "defineInSignal".
       local-storage section.

       linkage section.
       01  lnkSignalId             pic x.
       01  lnkSocketId             pic x.
       01  lnkMethodName           pic x.

       procedure division using lnkSignalId delimited,
                                lnkSocketId delimited,
                                lnkMethodName delimited

       INVOKED AS
       ==
           MAP SIGNAL <lnkSignalId> FROM [SOCKET] <lnkSocketId>
           TO [METHOD] <lnkMethodName> [UPON <SELF>]
       == or
       ==
           DEFINE-IN-SIGNAL [<self>] <lnkSignalId> [FROM] <lnkSocketId>
           [IS] <lnkMethodName>
       == .

       end method "defineInSignal".
      *>------------------------------------------------------------
      *> Create an empty OrderedCollection and insert it at the event
      *> index in the output IdentityDictionary.
      *>------------------------------------------------------------
       Method-id. "defineOutSignal".
       linkage section.
       01 lnkSignalId           pic x.

       procedure division using lnkSignalId delimited

       INVOKED AS == DEFINE SIGNAL
               <lnkSignalId> [FOR <self>] == OR
       == DEFINE-OUT-SIGNAL [<self>] <lnkSignalId> == .

       end method "defineOutSignal".
      *>------------------------------------------------------------
      *> Adds an entry into the Dictionary of sockets
      *> for this component.
      *>------------------------------------------------------------
       Method-id. "defineInSocket".
       linkage section.
       01  lnkSocketId           pic x.

       procedure division using lnkSocketId delimited

       INVOKED AS == DECLARE SOCKET <lnkSocketId> [UPON <self>] ==
       OR == DEFINE-IN-SOCKET [<self>] <lnkSocketId> == .

       end method "defineInSocket".
      *>------------------------------------------------------------
      *> Set up a handler to translate a physical event on an object
      *> to a logical signal.
      *>------------------------------------------------------------
       Method-id. "translateEventToSignal".

       local-storage section.

       linkage section.
       01  lnkEventId           pic s9(9) comp-5.
       01  lnksignalObject      object reference.
       01  lnkSignalId          pic x.
       01  lnkParameter         object reference.

       procedure division using lnkEventId
                                lnkSignalObject
                                lnkSignalId DELIMITED
                                lnkParameter

       INVOKED AS
       ==  MAP EVENT <lnkEventId> FROM <SELF>
           TO SIGNAL <lnkSignalId> UPON <lnkSignalObject>
           [ [WITH] <lnkParameter>]
       ==
       OR
       ==
           TRANSLATE-EVENT-TO-SIGNAL <self> <lnkEventId> [IS]
           <lnkSignalObject> <lnkSignalId>
           [ [WITH] <lnkParameter>]
       ==.
           exit method.
       end method "translateEventToSignal".
      *>------------------------------------------------------------
      *> Make the receiver a component
      *>------------------------------------------------------------
       Method-id. "makeComponent".
       procedure division
           INVOKED AS == MAKE [<SELF>] [A] COMPONENT ==.
           exit method.
       end method "makeComponent".
      *>------------------------------------------------------------
      *> Connects the outputs of the receiver to socket socketID
      *> of inputComponent.
      *>------------------------------------------------------------
       Method-id. "connectTo".

       linkage section.
       01  lnkInputComponent          object reference.
       01  lnkSocketId                pic x.

       procedure division using lnkInputComponent,
                                lnkSocketId delimited

       INVOKED AS == CONNECT <self> [TO]
           <lnkInputComponent> [AT] <lnkSocketId> == .

       end method "connectTo".
      *>------------------------------------------------------------
      *> Connects the outputs of outputComponent to socket socketID
      *> of inputComponent.
      *>------------------------------------------------------------
       Method-id. "connect".

       linkage section.
       01  lnkOutputComponent         object reference.
       01  lnkInputComponent          object reference.
       01  lnkSocketId                pic x.

       procedure division using lnkOutputComponent,
                                lnkInputComponent,
                                lnkSocketId delimited

       INVOKED AS == CONNECT <lnkOutputComponent> [TO]
           <lnkInputComponent> [AT] <lnkSocketId> <self> == .

       end method "connect".
      *>------------------------------------------------------------
      *> Disconnects the outputs of <self> from lnkComponent
      *>------------------------------------------------------------
       method-id. "removeHandler".

       Local-Storage Section.
       Linkage Section.
       01  lnkComponent            object reference.

       procedure division using lnkComponent
       INVOKED AS
       ==
           DISCONNECT <lnkComponent> [FROM] [<self>]
       ==.
       end method "removeHandler".
      *>------------------------------------------------------------
      *> Signal an event and pass an event parameter to the
      *> appropriate component.
      *>------------------------------------------------------------
       Method-id. "signal".
       local-storage section.

       linkage section.
       01  lnkSignalId                       pic x(32).
       01  lnkP1                       object reference.
       01  lnkP2                       object reference.
       01  lnkP3                       object reference.
       01  lnkP4                       object reference.
       01  lnkP5                       object reference.
       01  lnkP6                       object reference.
       01  lnkP7                       object reference.
       01  lnkP8                       object reference.
       01  lnkP9                       object reference.
       01  lnkP10                      object reference.
       01  lnkSignalReturnValue        object reference.

       procedure division using lnkSignalID delimited,
                                lnkP1
                                lnkP2
                                lnkP3
                                lnkP4
                                lnkP5
                                lnkP6
                                lnkP7
                                lnkP8
                                lnkP9
                                lnkP10
                      returning lnkSignalReturnValue

       INVOKED AS == SIGNAL [<self>] <lnkSignalId>
               [[WITH]
                                [<lnkP1>
                                [<lnkP2>
                                [<lnkP3>
                                [<lnkP4>
                                [<lnkP5>
                                [<lnkP6>
                                [<lnkP7>
                                [<lnkP8>
                                [<lnkP9>
                                [<lnkP10>
               ]]]]]]]]]]]
               [[GIVING]  [<lnkSignalReturnValue>]] == .

       end method "signal".


      *>------------------------------------------------------------
      *> Signal an event and pass an event parameter to the appropriate
      *> component.
      *>------------------------------------------------------------
       Method-id. "signalString".
       local-storage section.

       linkage section.
       01  lnkSignalId                 object reference.
       01  lnkP1                        object reference.
       01  lnkP2                       object reference.
       01  lnkP3                       object reference.
       01  lnkP4                       object reference.
       01  lnkP5                       object reference.
       01  lnkP6                       object reference.
       01  lnkP7                       object reference.
       01  lnkP8                       object reference.
       01  lnkP9                       object reference.
       01  lnkP10                      object reference.
       01  lnkSignalReturnValue        object reference.

       procedure division using lnkSignalID,
                                lnkP1
                                lnkP2
                                lnkP3
                                lnkP4
                                lnkP5
                                lnkP6
                                lnkP7
                                lnkP8
                                lnkP9
                                lnkP10
                 returning lnkSignalReturnValue

       INVOKED AS == SIGNALSTRING [<self>] <lnkSignalId>
               [[WITH]
                                [<lnkP1>
                                [<lnkP2>
                                [<lnkP3>
                                [<lnkP4>
                                [<lnkP5>
                                [<lnkP6>
                                [<lnkP7>
                                [<lnkP8>
                                [<lnkP9>
                                [<lnkP10>
               ]]]]]]]]]]]
               [[GIVING]  [<lnkSignalReturnValue>]] == .

       end method "signalString".
      *>------------------------------------------------------------
      *> write a trace record
      *>------------------------------------------------------------
       Method-id. "writeTrace".
       linkage section.
       01  lnkP1       pic x.
       01  lnkP2       pic x.
       01  lnkP3       pic x.
       01  lnkP4       pic x.
       01  lnkP5       pic x.
       01  lnkP6       pic x.
       01  lnkP7       pic x.
       01  lnkP8       pic x.
       01  lnkP9       pic x.

       procedure division paramcountcheck
                          using lnkP1 delimited
                                lnkP2 delimited
                                lnkP3 delimited
                                lnkP4 delimited
                                lnkP5 delimited
                                lnkP6 delimited
                                lnkP7 delimited
                                lnkP8 delimited
                                lnkP9 delimited
       INVOKED AS
       ==
       WRITETRACE [<self>] [WITH] [<lnkP1>]  [<lnkP2>] [<lnkP3>]
                                  [<lnkP4>] [<lnkP5>] [<lnkP6>]
                                  [<lnkP7>] [<lnkP8>] [<lnkP9>]
       ==.
       end method "writeTrace".
       end object.
       end class base.
