Re: THtml for interface abstract base class

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Oct 30 1998 - 11:07:23 MET


Hi Rutger,

  anyhow, I'll investigate the problem since indeed it should not crash.

However, there is absolutely no rule that you shall not put
any data members in ABC's. Actually it might be extremely useful to have
some common data members in ABC's that will be shared by the concrete
implementations. Also ABC's can have fully implemented member functions.
The only requirement for an ABC is to have at least one pure virtual
function that MUST be overridden by the concrete class, thereby guaranteeing
that the concrete class provides an implementation for this function.

Cheers, Fons.




Rutger van der Eijk wrote:
> 
> Hi,
> 
> Forget my last message. I already found out again that 'the defines' don't
> add any datamembers. Only TObject does.
> 
> I do think though that THtml should not crash on these cases (at the
> minimum just an error message reporting that the doc for OTABCDerived
> can't be created because no RTTI for OTABC availiable, or something)
> 
> Rutger
> 
> ---------- Forwarded message ----------
> Date: Thu, 29 Oct 1998 22:11:01 +0100 (MET)
> From: Rutger van der Eijk <r36@sigyn.nikhef.nl>
> To: ROOT mailing list <roottalk@root.cern.ch>
> Subject: THtml for interface abstract base class
> 
> Hi ROOTers,
> 
> I'm trying to use documentation generator class THtml to generate doc. The
> code generation crashes on a class which is derived from an abstract base
> class (i.e. no datamebers).
> 
> simple example:
> -------
> class OTABC {
> private:
> 
> public:
>   // Destructor
>   virtual ~OTABC();
> 
>   // ...
>   virtual void SetXXX(UInt_t xxx) = 0;
>   virtual UInt_t GetXXX() const = 0;
> };
> 
> and
> 
> class OTABCDerived: public OTABC {
> private:
>   // OTABC member
>   UInt_t fxxx; // xxx datamember
> 
> public:
>   // Constructor & destructor
>   OTABCDerived();
>   virtual ~OTABCDerived();
> 
>   // OTABC members
>   virtual void SetXXX(UInt_t xxx);
>   virtual UInt_t GetXXX() const;
> 
>   // other members
> 
>   ClassDef(OTABCDerived, 1) // OTABCDerived class
> };
> 
> gives a crash if trying to make doc for OTABCDerived. I don't want to use
> the ClassDef for OTABC because (as far as I know) this gives OTABC
> datamembers which an ABC should not have.
> 
> How to proceed?
> 
> Rutger van der Eijk

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:39 MET