comp.lang.ada
 help / color / mirror / Atom feed
From: jsanchor@my-dejanews.com
Subject: Access types
Date: 1998/05/27
Date: 1998-05-27T00:00:00+00:00	[thread overview]
Message-ID: <6khbm1$ec1$1@nnrp1.dejanews.com> (raw)


HI, I am working with access types and have a challenge at hand which I seem
to be losing. Need some help. I have data in Non Volatile Memory and RAM that
I need to access using access types. The problem is I need to have the same
"types" to work on the data, ie compare them, calculate checksum, etc.
ex. I have a package that looks like this:
-------------NVM--------------------------------------
type Non_Volatile_Type is tagged private;

type Ptr_to_Non_Volatile_Type is access all Non_Volatile_Type'class;

????Ptr_to_Data : access Non_Volatile_Type'Class?????;

type Information_Record_Type is
record
    Tag_Part   : Tag;
    NVM_Access : Ptr_to_Data???;
    RAM_Access : Ptr_to_Data???;
end record;

procedure Compute_Checksum (block : ???Ptr_to_Data);
           or
procedure Compute_Checksum (block : ???access Non_Volatile_Type'Class);

private

   type Non_Volatile_Type is tagged
      record
         checksum : Storage_Element;
      end record;

Somebody trying to use my package will declare a package somewhat like this
---------------------USER Spec------------------------------------
  type List_NVM_Type is new ddNVM.Non_Volatile_Type with
  record
     word1 : INTEGER := 8;
  end record;
---------------------USER Body------------------------------------
   procedure test is
      my_nvm : aliased List_NVM_Type;
   begin

      ddNVM.Compute_checksum(my_nvm'access);
   end test;

Does anybody know of a way. Thanks in advance.

sincerely,
Jay Sanchorawala.










-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading




             reply	other threads:[~1998-05-27  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-27  0:00 jsanchor [this message]
1998-05-28  0:00 ` Access types Jerry van Dijk
1998-05-29  0:00   ` jsanchor
1998-05-30  0:00     ` Jerry van Dijk
  -- strict thread matches above, loose matches on Subject: below --
1999-07-15  0:00 Access Types Ronald Ayoub
1999-07-21  0:00 ` Robert A Duff
1999-07-22  0:00   ` Steve Folly
1999-07-23  0:00     ` Tucker Taft
2007-07-01  0:39 access types Brian May
2007-07-01  1:54 ` Robert A Duff
2007-07-01  7:52   ` Dmitry A. Kazakov
2007-07-01 14:57     ` Robert A Duff
2007-07-01 19:41       ` Dmitry A. Kazakov
2007-07-02  0:12         ` Robert A Duff
2007-07-02  8:06           ` Dmitry A. Kazakov
2007-07-02 15:37       ` Adam Beneschan
replies disabled

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