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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7b5a39957e6a4d01,start X-Google-Attributes: gid103376,public From: Bill Pritchett Subject: Protected Type Question Date: 1996/03/20 Message-ID: <31502A7B.2885@std.caci.com>#1/1 X-Deja-AN: 143399902 content-type: text/plain; charset=us-ascii organization: CACI, Inc mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (Win95; I) Date: 1996-03-20T00:00:00+00:00 List-Id: I have a question regarding protected types. Specifically, I've been trying to figure out how to pin a protected object to a specific memory location. The two ways I have tried are as follows: procedure Test is protected type Sensor (Sensor_Address : System.Address) is function Get_Value return Integer; private The_Sensor : Integer; for The_Sensor'Address use Sensor_Address; end Sensor; ... Sensor1 : Sensor(..); begin ... end Test; GNAT bombs on this incorrectly stating 'missing "end Sensor"' which throws the rest of the compilation out of whack. I'm pretty sure this is NOT legal anyway. The second alternative is this procedure Test is protected type Sensor is function Get_Value return Integer; private The_Sensor : Integer; end Sensor; ... Sensor1 : Sensor; for Sensor1'Address use ...; begin ... end Test; This compiles. When I execute this it bombs (partly because I have no clue of what's at the address I give it). My question is what does the address (Sensor1'Address) represent? Is it the address to the object as a whole or to The_Sensor (what I want)? If it is to the object as a whole, then how does one specify a particular address for a protected object? Is it possible directly? Thanks, Bill Pritchett CACI, Inc.