next up previous
Next: Creating Active Objects Up: UC++: The Language Previous: Overall Issues

Declaring Activatable Classes

 

The programmer indicates that a class can be made active by publically deriving from base class Activatable. All public member functions of the class must be virtual: the parser will give an error if they are not. There should be no public data members: it is an error to access an active object's data members directly, except of course from within that members member functions. More details of the restrictions on Activatable classes are given in Section 2.4 below.

An example of creating an active class is shown below:

class Analyser : public Activatable {
 public:
   Analyser();
   virtual void insert(int x);
   virtual int average();
 private:
 ....
};



send comments or suggestions to J.Poole@cs.ucl.ac.uk

Click here for more information on UCL-CS.