00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MODELPOOL_H
00020 #define MODELPOOL_H
00021
00022 #include "pandabase.h"
00023
00024 #include "filename.h"
00025 #include "pandaNode.h"
00026 #include "pointerTo.h"
00027
00028 #include "pmap.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class EXPCL_PANDA ModelPool {
00050 PUBLISHED:
00051 INLINE static bool has_model(const string &filename);
00052 INLINE static bool verify_model(const string &filename);
00053 INLINE static PandaNode *load_model(const string &filename);
00054
00055 INLINE static void add_model(const string &filename, PandaNode *model);
00056 INLINE static void release_model(const string &filename);
00057 INLINE static void release_all_models();
00058
00059 INLINE static int garbage_collect();
00060
00061 INLINE static void list_contents(ostream &out);
00062
00063 private:
00064 INLINE ModelPool();
00065
00066 bool ns_has_model(const string &filename);
00067 PandaNode *ns_load_model(const string &filename);
00068 void ns_add_model(const string &filename, PandaNode *model);
00069 void ns_release_model(const string &filename);
00070 void ns_release_all_models();
00071 int ns_garbage_collect();
00072 void ns_list_contents(ostream &out);
00073
00074 static ModelPool *get_ptr();
00075
00076 static ModelPool *_global_ptr;
00077 typedef pmap<string, PT(PandaNode) > Models;
00078 Models _models;
00079 };
00080
00081 #include "modelPool.I"
00082
00083 #endif
00084
00085