Proposal that all UC++ classes inherit from a single UC++ base class
A postscript version of this whole document is available
The latex source is available here
At present all UC++ classes have extra private members inserted into them
ObjectStatus ObjectStatusFlag ;
int _ucpp_Vpid ;
friend OutputMessage & operator << (OutputMessage & Out, A *) ;
friend InputMessage & operator >> (InputMessage & In, A * &) ;
The proposal is that all UC++ classes should inherit from a single
(virtual) base class, perhaps UCPP. This UCPP base class might
well be a template class, as the output and input operator might
require to be template functions.
The advantages of moving to this method include:
- it fits in better with the object-oriented philosophy.
- it allows us to test at run-time if an object is a UC++
object---which is important for marchalling and unmarshalling.
- it allows us to give default behaviour to UCPP classes which can
be overriden by the programmer.
- from the point of view of output from the scanner it is cleaner.
It also helps move towards a situation where the programmer can
insert the UC++ directives manually in situations where using the
scanner is difficult (e.g. a class library where only certain
wrapper classes are to be made UC++ classes)
- it makes it easier to have a collection of UC++ objects, which
helps in the library design.
What are the disadvantages? Does mulitple inheritance interfere in
unexpected ways with other behaviour of classes?
Wed Aug 2 17:54:12 BST 1995