Question: We are in the process of anylizing the page performance, i would like to know if we have like 10 images , 2 css , 3 JS files. How is IE 7 , 8 actually how render the content. 

-> Is it like, it call the resources parllelly or is there any limit on the sequancy it calls all this resources.? Or it has like threds in built which will automatically handle.
-> If we have a JS call towords the end of the page which logs on entry to Anylitics (Pure JS call on client side) , will it wait until the calls finishes to render the page? or it will render what it has on the page?

Answer: 
When you specify that a generic parameter is a private type, well, Ada assumes you mean it :-)

I.e. you have no access to its components. Ada is not "[duck typed](http://en.wikipedia.org/wiki/Duck_typing)", so it's irrelevant whether or not you know that an instantiating type might actually possess a particular field. (How would you expect your Checksum function to work if The\_Transfer\_Type parameter were instantiated with, say, Integer?)

One way to address this is to also supply an accessor function as a parameter to the generic that will retrieve the data needed to, in this case, compute the checksum. E.g.:

```
generic
   type The_Transfer_Type is private;
   with function Get_Checksummable_Data_Item
           (Msg : The_Transfer_Type;
            I   : Integer) return Integer;
   SIZE : Integer;

package CC_Test_Channel is
   function Checksum(Msg : The_Transfer_Type) return Integer;
end CC_Test_Channel;

```

The body is then:

```
function Checksum(Msg : The_Transfer_Type) return Integer is
   Sum : Integer := 0;
begin
   -- calculate the checksum
   for i in 1 .. SIZE loop
      Sum := Sum + Get_Checksummable_Data(Msg, I);
   end loop;
   return Sum;
end Checksum;

```

The function you supply for Get\_Checksummable\_Data is then specific to The\_Transfer\_Type and simply returns the selected value from The\_Transfer\_Type's component fields.

There are a number of other ways to set this up as well, like providing an unconstrained array type as a generic formal parameter and a formal function to retrieve it--this allows you to also get rid of the explicit SIZE formal parameter. Or you could write a Checksum() function as one of the operations on the type that you're instantiating CC\_Test\_Channel with, and then have:

```
with function Calculate_Checksum(Msg : The_Transfer_Type) return Integer;

```

as one of the generic formals.

Step back, and think about the possibilities...
(moved from a comment, as this got long)

Ada (95 and later) supports streams. Unlike C++ streams, which are pretty much for string conversion, **Ada streams are meant as a general mechanism for performing operations on data** (typically I/O). 

Every Ada object has `'Write` and `'Read` attributes. There are some language supplied streams (for file I/O), but you also have the ability to create your own by deriving from [Ada.Streams.Root\_Stream\_Type](http://www.adaic.org/standards/95lrm/html/RM-13-13-1.html#I4474). If you write your own stream in this way, there are some low-level routines that give you direct access to the data. 

This allows you to write your own streams to perform operations like I/O, data compression, **or in your case perhaps checksumming data from the bus** before loading it into variables (via 'Read). I've done it myself in the past to implement a record/playback functionality for our real-time software. I looked into it for compression once too (we ended up not needing the compression).