![]() |
![]()
| ![]() |
![]()
NAMEoo::abstract - a class that does not allow direct instances of itself SYNOPSISpackage require tcl::oo oo::abstract method ?arg ...? CLASS HIERARCHYoo::object DESCRIPTIONAbstract classes are classes that can contain definitions, but which cannot be directly manufactured; they are intended to only ever be inherited from and instantiated indirectly. The characteristic methods of oo::class (create and new) are not exported by an instance of oo::abstract. Note that oo::abstract is not itself an instance of oo::abstract. CONSTRUCTORThe oo::abstract class does not define an explicit constructor; this means that it is effectively the same as the constructor of the oo::class class. DESTRUCTORThe oo::abstract class does not define an explicit destructor; destroying an instance of it is just like destroying an ordinary class (and will destroy all its subclasses). EXPORTED METHODSThe oo::abstract class defines no new exported methods. NON-EXPORTED METHODSThe oo::abstract class explicitly states that create, createWithNamespace, and new are unexported. EXAMPLESThis example defines a simple class hierarchy and creates a new instance of it. It then invokes a method of the object before destroying the hierarchy and showing that the destruction is transitive. oo::abstract create fruit { SEE ALSOoo::define(n), oo::object(n) KEYWORDSabstract class, class, metaclass, object
|