Yes. If you don't use pure (or extrern) then the compiler is looking for endtask or endfunction. pure virtual function void foo; // this is a prototype virtual function void foo; endfunction // this is a callable function ________________________________ From: Alsop, Thomas R [mailto:thomas.r.alsop@intel.com] Sent: Wednesday, April 29, 2009 10:22 AM To: Rich, Dave; Mehdi Mohtashemi; sv-ec@eda.org Subject: RE: [sv-ec] email ballot: response Mantis 2698 Thanks Dave for the response. Understood that the extern requires the body be defined someone in order for the class (abstract or not) to compile. I am still not clear on one issue with the use of 'pure'. If I create a virtual method without the body in an abstract class, do I have to label it 'pure'? -Tom ________________________________ From: Rich, Dave [mailto:Dave_Rich@mentor.com] Sent: Tuesday, April 28, 2009 10:30 PM To: Alsop, Thomas R; Mehdi Mohtashemi; sv-ec@eda.org Subject: RE: [sv-ec] email ballot: response Mantis 2698 id 57, svdb 2698 _____ YES __X__ No http://www.eda.org/svdb/view.php?id=2698 [Alsop, Thomas R] I am not convinced that 'pure' is required in order to create what is coined a "pure virtual method'. It's really ambiguous and seems like you can create a prototype virtual method and any level of abstract class hierarchy and only be forced to override it when you extend it to a non-abstract class and hence create the object out of it. I guess I am asking what the intent behind the 'pure' keyword is? If an abstract class at any level only prototypes a method, does that mean we have to label it 'pure'. [DR] No. an abstract class does not need to contain pure virtual methods, but a pure virtual method can only be contained in an abstract class. The "pure" keyword does two things: It says what follows is a prototype with no implementation, just like what "extern" does. However, the extern keyword requires that you provide an implementation (a body) that becomes part of the class definition, regardless of whether the method is virtual or not, or whether the class is abstract or not. The other thing the pure keyword does is say that I'm not providing an implementation in this abstract class, creating a requirement that someone provide an implementation in the form of an override in an extended class before you can construct a non-abstract class object. Dave -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Apr 29 15:55:23 2009
This archive was generated by hypermail 2.1.8 : Wed Apr 29 2009 - 15:56:08 PDT