I believe the terminology you're looking for is 'pure virtual', which
would correspond to an RB Class Interface, or a C++ class whose
header declares one or more methods as 'virtual' but provides so that
no definition exists, only a declaration. But note that C++ allows
you to make virtual methods that DO have a definition and a
declaration, even though the definition is usually null (only an '{'
and '}').
That's close, but off the mark in a few ways.
In C++, a method is "pure virtual" if it has no function body. A C++
pure virtual method declaration looks like this:
virtual int MyVirtualFunction() = 0;
In contrast, a declaration like this:
virtual int MyVirtualFunction() {}
is virtual, but not pure virtual, because {} is a valid function body
-- it does nothing, but it can be called and executed.
In C++, an "abstract class" is one that has one or more pure virtual
methods. Such a class cannot be instantiated because the compiler has
no code from which to create a function body.
A C++ "virtual method" is one that has been declared virtual, like the
ones above. If a method is virtual, the most-inherited version of it
will be executed; otherwise the version will be executed that
corresponds to the instance type, which depends on where & how it's
called.
In RB, all methods are virtual. If you want to execute from the top of
the inheritance chain instead of the bottom, use Events.
Actually if one want a class that can't be instantiated but can be
inherited then just give it a constructor and set it to private.
Such a class _can_ be instantiated, from within the class itself. So
this is not the same as an abstract class, although it's close enough
for most practical purposes.
This all might be beside the point to the original poster, who asked
about virtual classes. In C++, a virtual class is one that creates
only one version of multiply-inherited methods. RB doesn't have
multiple inheritance, so this situation doesn't arise. RB Interfaces
contain only declarations, not definitions (just like C++ pure virtual
methods), so when a class implements an Interface method, it doesn't
matter how many duplicate definitions are being implemented.
lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>