1 // Copyright (c) 1994 James Clark 2 // See the file COPYING for copying permission. 3 #pragma ident "%Z%%M% %I% %E% SMI" 4 5 #ifndef TypeId_INCLUDED 6 #define TypeId_INCLUDED 1 7 8 #ifdef SP_NAMESPACE 9 namespace SP_NAMESPACE { 10 #endif 11 12 class SP_API TypeId { 13 public: TypeId(const void * const * bases)14 TypeId(const void *const *bases) : bases_(bases) { } 15 // Is this object of type ti? 16 int isA(TypeId ti) const; 17 // Can an object with this dynamic type be cast from a static type FROM 18 // to a static type TO? 19 int canCast(TypeId to, TypeId from) const; 20 int operator==(TypeId ti) const { return bases_ == ti.bases_; } 21 int operator!=(TypeId ti) const { return bases_ != ti.bases_; } 22 private: 23 const void *const *bases_; 24 }; 25 26 #ifdef SP_NAMESPACE 27 } 28 #endif 29 30 #endif /* not TypeId_INCLUDED */ 31