OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TXOwl contains a Clone function.
This function takes no parameters and returns a TXOwl*. Clone creates a copy of the current exception object by allocating a new TXOwl object with new and passing a dereferenced this pointer to the automatic copy constructor. The function is defined as follows:
It is important to note that any classes derived from TXOwl must override this function to use the proper constructor. For example, the TXOutOfMemory class, which is derived from TXOwl, implements the Clone function like this:
Note that the return type is still TXOwl*. With this return type, ObjectWindows exception-handling functions can treat any exception object as a TXOwl object.
Also note that the return type for TXOwl::Clone differs from TXBase::Clone(). TXBase provides the basic functionality for both the ObjectWindows and the ObjectComponents exception classes, but TXOwl provides the basic interface for the ObjectWindows exception classes alone.