comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: How do I create an object instance from a tag?
Date: Tue, 18 Feb 2003 09:29:04 +0100
Date: 2003-02-18T09:29:04+01:00	[thread overview]
Message-ID: <b8r35v0ivn09eu5cj9nmigsqvu2ug9crpq@4ax.com> (raw)
In-Reply-To: yyb4a.155282$vm2.110486@rwcrnsc54

On Mon, 17 Feb 2003 20:25:02 GMT, "Steve" <nospam_steved94@attbi.com>
wrote:

>I would like to create a function that returns a reference to a class wide
>object based on the external name.  Something along the lines of:
>
>function Create_Object( external_name : String ) return objAcc is
>  returnTag : Ada.Tags.Tag;
>begin
>  returnTag := Ada.Tags.Internal_Tag( external_name );
>  return ??? some function of returnTag ???
>end Create_Object;
>
>Can this be done?

No, you cannot dispatch on a bare tag without any object. But it seems
that this will be changed (soon?).

There could be work-arounds in specific cases. For example you could
use Ada.Streams for interesting types to define 'Input/'Output so that
no data are stored, just the tag.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2003-02-18  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 20:25 How do I create an object instance from a tag? Steve
2003-02-18  8:29 ` Dmitry A. Kazakov [this message]
2003-02-18 18:14   ` Randy Brukardt
2003-02-19  2:27     ` Steve
2003-02-19  9:18       ` Dmitry A. Kazakov
2003-02-20 15:38 ` Julio Cano
  -- strict thread matches above, loose matches on Subject: below --
2003-02-19  9:39 Grein, Christoph
2003-02-19 13:26 ` Dmitry A. Kazakov
2003-02-19 18:36   ` Randy Brukardt
2003-02-20  9:15     ` 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