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: a07f3367d7,e5dc20115bb61aec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Generalized serialization for enumeration types Date: Wed, 26 Aug 2009 12:44:11 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <249a69e5-8e21-4968-a183-64732618660a@h21g2000yqa.googlegroups.com> NNTP-Posting-Host: efa1a9c4807b5eb4b7717b6497a6c261 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 5f5785a46a4e065cdb36484a96680809 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <249a69e5-8e21-4968-a183-64732618660a@h21g2000yqa.googlegroups.com> X-Validate-Post: http://news.tornevall.net/validate.php?trace=5f5785a46a4e065cdb36484a96680809 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8003 Date: 2009-08-26T12:44:11-07:00 List-Id: xorque wrote: > > I'm designing a package that uses a lot of similar but distinct > enumeration types. > > At some point, those types need to be encoded to be sent over > the wire. The encoding rules are simple: > > The enumeration values are converted to unsigned 32 bit > integers with the first value as 0 and increasing sequentially > with each new value. The 32 bit value is packed into big-endian > byte order. 'Pos for enumeration types gives values that satisfy this rule. They are universal_integer, and so may be used anywhere a value of your unsigned 32 bit integer type is needed. I don't know if this helps you, however. -- Jeff Carter "If you don't get the President of the United States on that phone, ... you're going to have to answer to the Coca-Cola Company." Dr. Strangelove 32