Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: using an Ad...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 9 Topic 5639 of 5830
Post > Topic >>

Re: using an Ada.Container as a private type

by Graham <graham.stark@[EMAIL PROTECTED] > Apr 3, 2008 at 09:20 AM

On Apr 3, 5:02 pm, "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
>
wrote:
> On Thu, 3 Apr 2008 08:29:28 -0700 (PDT), Graham wrote:
> > Hi,
> >     I'm writing a little financial application. I want to model a
> > stream of payments made at arbitrary periods (the periods are positive
> > numbers; they might be actual dates later on).
>
> > I think I want to declare this:
>
> > type Payment_Stream is private;
>
> > procedure Add_To_Payment_Stream(
> >             stream : in out Payment_Stream;
> >             period :  Positive;
> >             amount : Money );
>
> > ......
>
> > and then privately declare the payment stream as an Ordered Map, like:
>
> > private
>
> >    package Payment_Stream_Package is new Ada.Containers.Ordered_Maps(
> >       Element_Type => Money,
> >       Key_Type => Positive );
>
> >    type Payment_Stream is new Payment_Stream_Package.Map;
>
>    type Payment_Stream is new Payment_Stream_Package.Map with null
record;
>
> > but I can't do this. Gnat complains that "type derived from tagged
> > type must have extension".
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

Oh, I see (I think..) Thanks very much to both of you.

Graham
 




 9 Posts in Topic:
using an Ada.Container as a private type
Graham <graham.stark@[  2008-04-03 08:29:28 
Re: using an Ada.Container as a private type
Robert A Duff <bobduff  2008-04-03 12:00:24 
Re: using an Ada.Container as a private type
"Dmitry A. Kazakov&q  2008-04-03 18:02:48 
Re: using an Ada.Container as a private type
Graham <graham.stark@[  2008-04-03 09:20:40 
Re: using an Ada.Container as a private type
Maciej Sobczak <see.my  2008-04-03 13:41:10 
Re: using an Ada.Container as a private type
Graham <graham.stark@[  2008-04-04 01:02:30 
Re: using an Ada.Container as a private type
Robert A Duff <bobduff  2008-04-04 13:25:35 
Re: using an Ada.Container as a private type
Simon Wright <simon.j.  2008-04-04 20:37:38 
Re: using an Ada.Container as a private type
Adam Beneschan <adam@[  2008-04-04 08:57:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 14:43:13 CDT 2008.