comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Experimenting with the OOP features in Ada
Date: Thu, 5 Jan 2017 14:02:19 +0100
Date: 2017-01-05T14:02:19+01:00	[thread overview]
Message-ID: <o4lg4u$1rdp$1@gioia.aioe.org> (raw)
In-Reply-To: 580eb363-2195-43f3-a589-b01657a1be43@googlegroups.com

On 2017-01-05 12:41, Laurent wrote:
> On Wednesday, 4 January 2017 13:44:31 UTC+1, Dmitry A. Kazakov  wrote:

>> Object.Entity and Object.Archived.Deposit are already tagged.
>>
>>>
> And that is why there is no place to put it? Or does abstract automatically
> implies tagged?

No.

Object.Entity is derived from Ada.Finalization.Limited_Controlled which 
is tagged.

[Tagged property is transitive upon derivation.]

>> The package name Object gets hidden by the declaration the type Object.
>> Change it to:
>>
>>    type Object is abstract new Standard.Object.Entity ...
>>
> Why Standard? Thought that was for libraries which come preinstalled? I thought I
> get access to Simple Components via Gnoga?

Standard is the root package in Ada. So the full name of the package 
Object is Standard.Object.

> So previous errors are gone, a new one:
>
> base_types-antibiotics.ads:30:9: type must be declared abstract or "Get_Class"
> overridden
>
> So I looked at Get_Class.
>
> -- Get_Class -- Of an object
> --
> --    Object - The object
> --
> -- This  function  returns  the  class  of Object. The class is a string
> -- uniquely  describing  the  object's type. It is analogous to external
> -- type  tag representation. Though, different types of objects may have
> -- same class if necessary.
> --
> -- Returns :
> --
> --    The object class
> --
>    function Get_Class (Object : Deposit) return String is abstract;
>
> Hm is abstract, so no body to copy from. What is it doing?

A persistent object must be stored externally. When you restore it you 
must know its Ada type. The string returned by Get_Class is the 
information you will use to get at that type.

> If Object is of type ie.: Base_Type it will return a String with Base_Type?

It is any text. See 2.4 and 2.4.2 for sample code. 2.4.2 implements a 
persistent binary tree of nodes. Each tree node is a separate persistent 
object.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2017-01-05 13:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 13:21 Experimenting with the OOP features in Ada Laurent
2017-01-02 14:11 ` Brian Drummond
2017-01-02 14:43   ` Brian Drummond
2017-01-02 16:27     ` Laurent
2017-01-03 13:01       ` Brian Drummond
2017-01-03 13:57         ` Laurent
2017-01-03 14:31           ` Dmitry A. Kazakov
2017-01-03 17:07             ` G.B.
2017-01-03 20:42               ` Dmitry A. Kazakov
2017-01-04 12:18             ` Laurent
2017-01-04 12:44               ` Dmitry A. Kazakov
2017-01-05 11:41                 ` Laurent
2017-01-05 13:02                   ` Dmitry A. Kazakov [this message]
2017-01-05 13:11                   ` AdaMagica
2017-01-04 15:09               ` Shark8
2017-01-05 11:54                 ` Laurent
     [not found]     ` <85ef59f3-bcbe-4630-9b4d-8285623ab456@googlegroups.com>
2017-01-03 12:48       ` Brian Drummond
2017-01-03 13:43         ` Laurent
2017-01-02 15:54   ` Laurent
2017-01-02 16:41 ` Dmitry A. Kazakov
2017-01-02 18:50   ` Laurent
2017-01-02 20:55     ` Dmitry A. Kazakov
2017-01-03 13:39       ` Laurent
2017-01-03 14:40         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox