00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef POINTERTOBASE_H
00016 #define POINTERTOBASE_H
00017
00018 #include "pandabase.h"
00019 #include "pointerToVoid.h"
00020 #include "referenceCount.h"
00021 #include "typedef.h"
00022 #include "memoryUsage.h"
00023 #include "config_express.h"
00024
00025
00026
00027
00028
00029
00030
00031 template <class T>
00032 class PointerToBase : public PointerToVoid {
00033 public:
00034 typedef T To;
00035
00036 protected:
00037 INLINE PointerToBase(To *ptr);
00038 INLINE PointerToBase(const PointerToBase<T> ©);
00039 INLINE ~PointerToBase();
00040
00041 INLINE void reassign(To *ptr);
00042 INLINE void reassign(const PointerToBase<To> ©);
00043
00044 #ifdef DO_MEMORY_USAGE
00045 void update_type(To *ptr);
00046 #endif // DO_MEMORY_USAGE
00047
00048
00049
00050
00051
00052 PUBLISHED:
00053 INLINE void clear();
00054
00055 void output(ostream &out) const;
00056 };
00057
00058 template<class T>
00059 INLINE ostream &operator <<(ostream &out, const PointerToBase<T> &pointer) {
00060 pointer.output(out);
00061 return out;
00062 }
00063
00064 #include "pointerToBase.I"
00065
00066 #endif