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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,28a24746aa07c732 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.esat.net!zen.net.uk!dedekind.zen.co.uk!news.hacking.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Design help Date: Mon, 12 Mar 2007 21:48:00 -0500 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1173757582 11280 69.95.181.76 (13 Mar 2007 03:46:22 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 13 Mar 2007 03:46:22 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:14503 Date: 2007-03-12T21:48:00-05:00 List-Id: "Carroll, Andrew" wrote in message news:mailman.120.1173747027.18371.comp.lang.ada@ada-france.org... ... > It seems like the second method that Ludovic mentioned might be better > in my case even if there is a fixed-width database record. For each > type I have I could define a constructor function. Like this: You need to look at the stream attributes and how you can compose them when constructing user-defined versions. I looked in the usual places, and it didn't seem to be covered very throughly (for instance, John Barnes' book only gives 5 pages to this topic, which really isn't enough). But writing a full tutorial on this topic is a bit much... Anyway, you don't need necessarily need to write contructors (and matching writers): the compiler will do it for you. Unless your types have embedded pointers (then you have to do it yourself). You can use the predefined stream attributes for the types to handle the individual components. Of course, if you want to use a specific representation for the result, then you'll need to do it yourself. And then Unchecked_Conversion is your friend. ;-) Randy.