comp.lang.ada
 help / color / mirror / Atom feed
* Array of bytes type
@ 2000-05-19  0:00 Joseph P Vlietstra
  2000-05-19  0:00 ` DuckE
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Joseph P Vlietstra @ 2000-05-19  0:00 UTC (permalink / raw)


Hi all,
I'm on a project which reuses/modifies code from several sources
and previous projects.  While integrating these packages together
we found 5 different declarations for an "array of bytes" type.
The declarations are similar enough that UC will copy slices from
one type to another but different enough to prevent any "clever"
conversions (e.g., overlays will fail due to different sizes in
index type).

We will probably standardize on one array of bytes type, play with
renames, etc.  But this effort has raises a question: what is the
plainest, simplest to reuse, declaration of an array of bytes?
(I would hope that some future project will steal/reuse my code
without the headaches I'm facing.)

Alternatives:

1. Roll my own.  For example:
   type Byte_Array is array(Integer range <>) of Interfaces.Unsigned_8;

   This seems like a universally useful array of bytes type;
   but I already have 5 different opinions of what a useful array
   of bytes type should look like.  So I'm thinking about hijacking
   something that is already defined in the LRM.

2. Use Stream_Element_Array.
   We do a lot of UC between our byte arrays and other data types.
   (Commmands come in and telemetry goes out in byte arrays.)
   This approach allows the possibility of using 'Read and 'Write
   to perform conversions on the byte array (using memory stream).
   The problem, of course, is that Stream_Element is implementation
   defined and need not match Storage_Element.
   BTW: Does anyone know of an implementation where Stream_Element
   doesn't match Storage_Element?

3. Use Storage_Element_Array.
   Again, this is implementation defined.
   (We're using a 32-bit processor, but a lot of spacecraft still
   use 1750A processors where the storage element is 16 bits.)

4. FLAME PROTECTION ON
   Use String
   FLAME PROTECTION OFF

5. Any other ideas?




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2000-05-23  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-19  0:00 Array of bytes type Joseph P Vlietstra
2000-05-19  0:00 ` DuckE
2000-05-19  0:00 ` Marin D. Condic
2000-05-19  0:00 ` Ken Garlington
2000-05-21  0:00   ` Robert Dewar
     [not found]     ` <8gae49$tr5$1@slb7.atl.mindspring.net>
2000-05-22  0:00       ` Marin D. Condic
2000-05-22  0:00         ` Jean-Pierre Rosen
2000-05-22  0:00         ` Ken Garlington
2000-05-22  0:00           ` David Kristola
2000-05-23  0:00             ` Paul Warren
2000-05-22  0:00           ` Marin D. Condic
2000-05-19  0:00 ` Jeff Carter
2000-05-20  0:00   ` Ken Garlington
2000-05-19  0:00 ` James S. Rogers

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