Panda3D
 All Classes Functions Variables Enumerations
loaderFileTypeRegistry.h
1 // Filename: loaderFileTypeRegistry.h
2 // Created by: drose (20Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef LOADERFILETYPEREGISTRY_H
16 #define LOADERFILETYPEREGISTRY_H
17 
18 #include "pandabase.h"
19 
20 #include "pvector.h"
21 #include "pmap.h"
22 
23 class LoaderFileType;
24 class Filename;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : LoaderFileTypeRegistry
28 // Description : This class maintains the set of all known
29 // LoaderFileTypes in the universe.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_PGRAPH LoaderFileTypeRegistry {
32 protected:
34 
35 public:
37 
38  void register_type(LoaderFileType *type);
39  void register_deferred_type(const string &extension, const string &library);
40 
41 PUBLISHED:
42  int get_num_types() const;
43  LoaderFileType *get_type(int n) const;
44  MAKE_SEQ(get_types, get_num_types, get_type);
45  LoaderFileType *get_type_from_extension(const string &extension);
46 
47  void write(ostream &out, int indent_level = 0) const;
48 
49  static LoaderFileTypeRegistry *get_global_ptr();
50 
51 private:
52  void record_extension(const string &extension, LoaderFileType *type);
53 
54 private:
56  Types _types;
57 
59  Extensions _extensions;
60 
62  DeferredTypes _deferred_types;
63 
64  static LoaderFileTypeRegistry *_global_ptr;
65 };
66 
67 #endif
68 
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This class maintains the set of all known LoaderFileTypes in the universe.
This is the base class for a family of scene-graph file types that the Loader supports.