Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pgraph/loaderFileTypeRegistry.h

Go to the documentation of this file.
00001 // Filename: loaderFileTypeRegistry.h
00002 // Created by:  drose (20Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef LOADERFILETYPEREGISTRY_H
00020 #define LOADERFILETYPEREGISTRY_H
00021 
00022 #include <pandabase.h>
00023 
00024 #include "pvector.h"
00025 #include "pmap.h"
00026 
00027 class LoaderFileType;
00028 class Filename;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : LoaderFileTypeRegistry
00032 // Description : This class maintains the set of all known
00033 //               LoaderFileTypes in the universe.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDA LoaderFileTypeRegistry {
00036 protected:
00037   LoaderFileTypeRegistry();
00038 
00039 public:
00040   ~LoaderFileTypeRegistry();
00041 
00042   static LoaderFileTypeRegistry *get_ptr();
00043 
00044   int get_num_types() const;
00045   LoaderFileType *get_type(int n) const;
00046 
00047   LoaderFileType *get_type_from_extension(const string &extension) const;
00048 
00049   void write_types(ostream &out, int indent_level = 0) const;
00050 
00051   void register_type(LoaderFileType *type);
00052 
00053 private:
00054   typedef pvector<LoaderFileType *> Types;
00055   Types _types;
00056 
00057   typedef pmap<string, LoaderFileType *> Extensions;
00058   Extensions _extensions;
00059 
00060   static LoaderFileTypeRegistry *_global_ptr;
00061 };
00062 
00063 #endif
00064 

Generated on Fri May 2 00:41:49 2003 for Panda by doxygen1.3