From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,555115ba813101ad,start X-Google-Attributes: gid103376,public From: Mario Amado Alves Subject: Finalization of package instance Date: 2000/01/18 Message-ID: #1/1 X-Deja-AN: 574250178 Content-Transfer-Encoding: 7bit To: comp.lang.ada@list.deja.com X-DejaID: _S7vnF8xsBK4JhDvr7+t2mw= X-Authentication-Warning: lexis.di.fct.unl.pt: maa owned process doing -bs Content-Type: text/plain Organization: Deja.com - Before you buy Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-18T00:00:00+00:00 List-Id: How do I define the finalization of an instantiation of a generic package? For example, generic package Datalink initializes a connection with a database server; when the package instance dies, the connection must be closed (cleanly) via the proper procedure call. How does one automatize this? E.g. generic Database_Server_Address: String; package Datalink is ... end Datalink; The body: package body Datalink is ... begin Connect(Database_Server_Address); finalize -- HERE, I WHICH THIS WAS POSSIBLE!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Disconnect(Database_Server_Address); end Datalink; Then, procedure Main is package Main_Data_Server is new Datalink("some.address.net"); begin ... end Main Now, when Main has complete running the disconnection should have been done automatically. Is there an idiom to accomplish this in Ada? Thanks. | |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+212976751 |M|A|R|I|O| mob 939354005 |A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536 |A|L|V|E|S| fax 212948541 | | | | | | maa@di.fct.unl.pt FCT 212948300 Sent via Deja.com http://www.deja.com/ Before you buy.