home *** CD-ROM | disk | FTP | other *** search
- #include "contain.h"
-
- containable::~containable() {} /* stub */
-
- container::container()
- {
- object_count = 0;
- }
-
- container::~container() {}
-
- // The following types really needn't be defined, since
- // containable, sortable, and hashable are meant to be abstract.
- // There are defined solely as examples.
-
- const int containable::type = 0;
- const int sortable::type = 1;
- const int hashable::type = 2;
-
- int containable::class_type() const { return type; }
- int sortable::class_type() const { return type; }
- int hashable::class_type() const { return type; }
-
- int containable::descends_from(int arg) const
- {
- return arg == type;
- };
-
- int sortable::descends_from(int arg) const
- {
- return arg == type || containable::descends_from(arg);
- }
-
- int hashable::descends_from(int arg) const
- {
- return arg == type || containable::descends_from(arg);
- }
-