00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef GLUE_TYPEDOBJ_H
00024 #define GLUE_TYPEDOBJ_H
00025 
00026 #include "std/dllimpexp.H"
00027 #include "std/strings.H"
00028 
00029 #define ISA(O)         (!!(O) && (O)->is_of_type(static_name()))
00030 #define ISOF(N,PAR)    (N == static_name() || PAR::is_of_type(N))
00031 #define IS(N)          (N == static_name())
00032 
00033 #ifdef GLUE_AVOID_STATIC_LOCAL_INLINE_VAR
00034    #define STAT_STR_RET str_ptr
00035 #else
00036    #define STAT_STR_RET Cstr_ptr &
00037 #endif
00038 #define DEFINE_BASE_TYPE(CLASS_NAME, CLASS_PTR)               \
00039    static  STAT_STR_RET static_name()         { RET_STAT_STR(#CLASS_NAME); } \
00040    virtual STAT_STR_RET class_name () const   { return static_name(); }   \
00041    virtual int  is_of_type(Cstr_ptr &n)const  { return n == static_name(); } \
00042    static  int  isa       (CLASS_PTR o)       { return ISA (o); }  \
00043    static  int  isa       (cTYPEDOBJ *o)      { return ISA (o); }
00044 
00045 #define DEFINE_DERIVED_TYPE(CLASS_NAME, CLASS_PAR, CLASS_PTR)               \
00046    static  STAT_STR_RET  static_name()         { RET_STAT_STR(#CLASS_NAME);} \
00047    virtual STAT_STR_RET class_name () const   { return static_name(); }   \
00048    virtual int  is_of_type(Cstr_ptr &n)const  { return ISOF(n,CLASS_PAR);}\
00049    static  int  isa       (CLASS_PTR  o)      { return ISA (o); }  \
00050    static  int  isa       (cTYPEDOBJ *o)      { return ISA (o); }
00051 
00052 typedef const class TYPEDOBJ cTYPEDOBJ;
00053 
00054 class DllImpExp TYPEDOBJ {
00055    public:
00056 
00057      
00058  virtual STAT_STR_RET class_name ()           const = 0;
00059  virtual int          is_of_type(Cstr_ptr &t) const = 0; 
00060 };
00061 
00062 
00063 
00064 #ifndef DECLARE_TAGS_AND_DECODER
00065 #ifdef sun
00066 #define DECLARE_TAGS_AND_DECODER "You must include tags/tagset.H"
00067 #else
00068 #define DECLARE_TAGS_AND_DECODER(X) You_must_include_tagset_H_file_from_tags
00069 #endif
00070 #endif
00071 
00072 #endif