Message 56

Re: 15-721: scan.o in libwithout.a?

X-Added: With Flames (bblib $Revision: 1.4 $)
Return-path: <spapadim+@cs.cmu.edu>
X-Andrew-Authenticated-as: 0;andrew.cmu.edu;Network-Mail
Received: from po0.andrew.cmu.edu via trymail for bb+academic.cs.15-721@andrew.cmu.edu
          ID </afs/andrew.cmu.edu/usr0/bb/Mailbox/cvjtZUC00UdYEQmU45>;
          Sat,  6 Oct 2001 19:53:04 -0400 (EDT)
Received: from mx1.andrew.cmu.edu (MX1.ANDREW.CMU.EDU [128.2.10.111])
        by po0.andrew.cmu.edu (8.9.3/8.9.3) with ESMTP id TAA07361
        for <bb+academic.cs.15-721@ams.andrew.cmu.edu>; Sat, 6 Oct 2001 19:53:03 -0400 (EDT)
Received: from iluvatar.dhs.org (pool-151-201-19-40.pitt.east.verizon.net [151.201.19.40])
        by mx1.andrew.cmu.edu (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id f96Nr1eD006585
        for <bb+academic.cs.15-721@andrew.cmu.edu>; Sat, 6 Oct 2001 19:53:02 -0400
Received: from cs.cmu.edu (iluvatar.hobbiton.cmu.edu [192.168.0.2])
        by iluvatar.dhs.org (Postfix) with ESMTP
        id 44B9020543; Sat,  6 Oct 2001 19:53:01 -0400 (EDT)
Message-ID: <3BBF995C.5050506@cs.cmu.edu>
Date: Sat, 06 Oct 2001 19:53:00 -0400
From: Spiros Papadimitriou <spapadim+@cs.cmu.edu>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010808
X-Accept-Language: en-us
MIME-Version: 1.0
To: Bartosz Przydatek <bartosz@cs.cmu.edu>
Cc: bb+academic.cs.15-721@andrew.cmu.edu
Subject: Re: 15-721: scan.o in libwithout.a?
References: <Pine.LNX.3.95L.1011006182731.10321A-100000@ux10.sp.cs.cmu.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Yes, that is right...  I mentioned this in a previous email--in more
detail, the suggested workaround is for you to do sth like:

class HeapFile {
  friend class MyScan;
  // ...
};

class MyScan : public Scan {
    // Implement public methods, completely
    // shadowing(and ignoring) Scan
    // ...
}

Scan *HeapFile::openScan (Status &s) {
   MyScan *rval = new MyScan (...);
   // ...
   return rval;
}

If scan.o wasn't in there, you'd actually have to declare all private
members in Scan in your class (and to add more you'd have to
modify the declaration of class Scan {...} so...).  It is ugly, but... :-)
Hope this helps!

Spiros

Bartosz Przydatek wrote:

>Hi!
>
>Apparently, the library libwithout.a contains also object code 
>for the Scan class (scan.o), which seems to disturb the linker,
>since it conflicts with our implementation of Scan-methods.
>How should we proceed with it?
>
>Thanx,
>
>- Bartosz.
>
>