comp.lang.ada
 help / color / mirror / Atom feed
* Binary and XML serialization of types
@ 2014-01-23 18:53 hanslad
  2014-01-23 19:15 ` adambeneschan
  0 siblings, 1 reply; 34+ messages in thread
From: hanslad @ 2014-01-23 18:53 UTC (permalink / raw)


Hello,
I am an Ada beginner who is working on a private project.
The project is to implement a protocol which either does binary or xml serialization of the different defined records. 
I have tried to separate all the "encoding" details from the type declaration in a sub package like this:

package A.Types is

   type Guid_Array is array(1 .. 8) of Unsigned_8;
   type Guid is  record
      Data1 : Unsigned_32;
      Data2 : Unsigned_16;
      Data3 : Unsigned_16;
      Data4 : Guid_Array;
   end record;

end A.Types;


with with Ada.Streams; use Ada.Streams;
package A.Types.BinaryEncoder is

   procedure Guid_Write(
   Stream : access Ada.Streams.Root_Stream_Type'Class; Item : Guid );
   for Guid'Write use Guid_Write;

end A.Types.Encoders;


I get the following error:

7:8 entity must be declared in this Scope

How can I separate all the encoding and decoding details from the type declaration? I like the idea of splitting this into packages with different functionality. Is this possible at all?
Sorry for posting such a beginners question.

Thanks,

HP
   

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

end of thread, other threads:[~2014-02-06  1:32 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 18:53 Binary and XML serialization of types hanslad
2014-01-23 19:15 ` adambeneschan
2014-01-23 19:17   ` adambeneschan
2014-01-23 19:58     ` hanslad
2014-01-23 20:03       ` adambeneschan
2014-01-23 21:00       ` Dmitry A. Kazakov
2014-01-24  8:54         ` hanslad
2014-01-24 10:01           ` Dmitry A. Kazakov
2014-01-24 14:44             ` hanslad
2014-01-24 15:22               ` Dmitry A. Kazakov
2014-01-31  9:51                 ` hanslad
2014-01-31 10:49                   ` Dmitry A. Kazakov
2014-02-04 10:33                     ` AdaMagica
2014-02-04 11:14                       ` Dmitry A. Kazakov
2014-02-04 11:20                         ` AdaMagica
2014-02-04 13:04                           ` Dmitry A. Kazakov
2014-02-04 17:16                             ` AdaMagica
2014-02-04 17:57                               ` Dmitry A. Kazakov
2014-02-04 22:34                               ` Simon Wright
2014-02-05  9:02                                 ` AdaMagica
2014-02-05  9:39                                   ` Simon Wright
2014-02-05 10:35                                   ` Dmitry A. Kazakov
2014-02-05 13:03                                     ` AdaMagica
2014-02-05 13:44                                       ` G.B.
2014-02-05 15:34                                       ` Niklas Holsti
2014-02-06  1:32                                       ` adambeneschan
2014-01-24 17:36             ` Simon Wright
2014-01-24  8:44       ` Georg Bauhaus
2014-01-24 17:13         ` Simon Wright
2014-01-23 22:44   ` Simon Wright
2014-01-23 23:43     ` adambeneschan
2014-01-24  0:58       ` Randy Brukardt
2014-01-24  8:29       ` Oliver Kleinke
2014-01-24 16:22         ` adambeneschan

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