00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GEOMCACHEENTRY_H
00016 #define GEOMCACHEENTRY_H
00017
00018 #include "pandabase.h"
00019 #include "geomCacheManager.h"
00020 #include "referenceCount.h"
00021 #include "config_gobj.h"
00022 #include "pointerTo.h"
00023 #include "mutexHolder.h"
00024
00025 class Geom;
00026 class GeomPrimitive;
00027
00028
00029
00030
00031
00032
00033
00034 class EXPCL_PANDA_GOBJ GeomCacheEntry : public ReferenceCount {
00035 public:
00036 INLINE GeomCacheEntry();
00037 virtual ~GeomCacheEntry();
00038
00039 PT(GeomCacheEntry) record(Thread *current_thread);
00040 void refresh(Thread *current_thread);
00041 PT(GeomCacheEntry) erase();
00042
00043 virtual void evict_callback();
00044 virtual void output(ostream &out) const;
00045
00046 private:
00047 int _last_frame_used;
00048
00049 INLINE void remove_from_list();
00050 INLINE void insert_before(GeomCacheEntry *node);
00051
00052 private:
00053 GeomCacheEntry *_prev, *_next;
00054
00055 public:
00056 static TypeHandle get_class_type() {
00057 return _type_handle;
00058 }
00059 static void init_type() {
00060 ReferenceCount::init_type();
00061 register_type(_type_handle, "GeomCacheEntry",
00062 ReferenceCount::get_class_type());
00063 }
00064
00065 private:
00066 static TypeHandle _type_handle;
00067
00068 friend class GeomCacheManager;
00069 };
00070
00071 INLINE ostream &operator << (ostream &out, const GeomCacheEntry &entry);
00072
00073 #include "geomCacheEntry.I"
00074
00075 #endif