Specification of package Corba.Impl

 ========================================================================= --
 ===                                                                   === --
 ===                 Top Graph'X CORBA Implementation                  === --
 ===                                                                   === --
 ===                 Copyright (c) 2000, Top Graph'X.                  === --
 ===                                                                   === --
 ===                     --- Copyright Notice ---                      === --
 ===                                                                   === --
 ===    This software is protected as an unpublished work under the    === --
 ===     Copyright Act of 1976.  All rights reserved.  Top Graph'X.    === --
 ===                                                                   === --
 ========================================================================= --

with Ada.Finalization ;
with Ada.Unchecked_Deallocation ;
package Corba.Impl is
    The following type is the common ancestor of all object implementations
   type Object is abstract tagged
      Ref_Count : Unsigned_Long := 0 ;  Reference count
   end record;

   type Object_Ptr is access all Object'Class;

    The following procedure must be defined for all non abstract
    object implementations. It must contain all backup and cleanup operations
    needed before the destruction of the object, destruction which will
    immediately occur after the termination of this procedure.
    Finalize is automatically called when the Ref_Count becomes 0, providing
    that the pointer to the Object is stored in a Controller defined below
    (which is a mandatory requirement, as doing otherwise may lead to
    impredictable results)
    If Finalize needs to avoid the deallocation of the object (for example
    because it stores it in a "free list" for later reuse), it may either
    put it in another controller or increment the Ref_Count
   procedure Finalize (Self : access Object) ;

    This procedure dispatches operations for local interfaces and values
   procedure Invoke ( Self      : access Object ;
                      Operation : in Standard.String ;
                      Stream    : access Corba_Ios.Iop_Stream_Type) ;

    Deallocation procedure automatically called by finalization
   procedure Free is new Ada.Unchecked_Deallocation
      (Object => Object'Class, Name => Object_Ptr) ;

    Object_Ptr must always be stored inside a controlling object
    The following type must be used for this purpose
   type Controller is new Ada.Finalization.Controlled with
      Ptr : Object_Ptr ;
   end record ;

    Finalisation routines
   procedure Adjust (Self : in out Controller) ;
   procedure Finalize (Self : in out Controller) ;

    The following procedure must be used to set the contents
    of a Controller for proper finalization to be done
    This may cause the previous object stored in the controller
    to be finalized and destroyed if its Ref_Count becomes 0
    indicating that it is no longer used
   procedure Set (Self : in out Controller ; Ptr : in Object_Ptr) ;

    Operations signatures for fast dispatching
   type Operation_Signature is new Unsigned_Long ;
   type Operation_Signatures is array (Positive range <>) of
      Operation_Signature ;

   function Get_Index ( Operation  : in Standard.String ;
                        Scale      : in Operation_Signature ;
                        Signatures : in Operation_Signatures) return Natural ;
end Corba.Impl;

List of definition uses

This page was generated by PrismTech's ada2html on Friday Mai 12 2006 16:18