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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98e311935a219163 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-24 07:23:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank [Contractor]" Newsgroups: comp.lang.ada Subject: RE: Help with Copying Shared Memory to Local Date: Fri, 24 May 2002 10:22:14 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 1022250182 50857 137.194.161.2 (24 May 2002 14:23:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 24 May 2002 14:23:02 +0000 (UTC) Return-Path: X-Mailer: Internet Mail Service (5.5.2650.21) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:24648 Date: 2002-05-24T10:22:14-04:00 Jeffrey Carter wrote: > A : Storage_Array (1 .. Storage_Length); > for A'Address use Destination; > pragma Import (Ada, A); > > B : Storage_Array (1 .. Storage_Length); > for B'Address use Source; > pragma Import (Ada, B); > Jeff, Just curious. Why the "pragma Import" on the object? On our last Unix (HP-UX BLS) project, I wrote a generic package that worked very similar to your suggestion. The generic had methods that wrappered all the appropriate OS calls for managing the shared memory. When the package was instantiated with the desired type, it gave you an object of that type who's address would be mapped to shared memory with a call to the Get_Shared_Memory method in the generic. Once that was done, you just accessed the object just like any other, making it transparent to the user that it was in shared memory. My point to this is I did a "pragma Import" on the OS calls, such as ShmGet (what a descriptive name), but I didn't have to do a "pragma Import" on the object. What does it buy you to do the import on the object? Thanks Frank