00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MEMORYINFO_H
00016 #define MEMORYINFO_H
00017
00018 #include "pandabase.h"
00019
00020 #ifdef DO_MEMORY_USAGE
00021
00022 #include "typeHandle.h"
00023
00024 class ReferenceCount;
00025 class TypedObject;
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class MemoryInfo {
00038 public:
00039 MemoryInfo();
00040
00041 public:
00042
00043 TypeHandle get_type();
00044
00045 INLINE void *get_void_ptr() const;
00046 INLINE ReferenceCount *get_ref_ptr() const;
00047 INLINE TypedObject *get_typed_ptr() const;
00048
00049 INLINE bool is_size_known() const;
00050 INLINE size_t get_size() const;
00051
00052 INLINE double get_time() const;
00053
00054 private:
00055
00056 void determine_dynamic_type();
00057 bool update_type_handle(TypeHandle &destination, TypeHandle refined);
00058
00059 private:
00060 enum Flags {
00061 F_size_known = 0x0001,
00062 F_reconsider_dynamic_type = 0x0002,
00063 };
00064
00065 void *_void_ptr;
00066 ReferenceCount *_ref_ptr;
00067 TypedObject *_typed_ptr;
00068 size_t _size;
00069 TypeHandle _static_type;
00070 TypeHandle _dynamic_type;
00071 int _flags;
00072
00073 double _time;
00074 int _freeze_index;
00075
00076 friend class MemoryUsage;
00077 };
00078
00079 #include "memoryInfo.I"
00080
00081 #endif // DO_MEMORY_USAGE
00082
00083 #endif
00084