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

direct/src/dcparser/dcFile.h

Go to the documentation of this file.
00001 // Filename: dcFile.h
00002 // Created by:  drose (05Oct00)
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 DCFILE_H
00020 #define DCFILE_H
00021 
00022 #include "dcbase.h"
00023 #include "dcClass.h"
00024 
00025 class HashGenerator;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : DCFile
00029 // Description : Represents the complete list of Distributed Class
00030 //               descriptions as read from a .dc file.
00031 ////////////////////////////////////////////////////////////////////
00032 class EXPCL_DIRECT DCFile {
00033 PUBLISHED:
00034   DCFile();
00035   ~DCFile();
00036 
00037   bool read(Filename filename);
00038   bool read(istream &in, const string &filename = string());
00039 
00040   bool write(Filename filename) const;
00041   bool write(ostream &out, const string &filename = string()) const;
00042 
00043   int get_num_classes();
00044   DCClass *get_class(int n);
00045 
00046   DCClass *get_class_by_name(const string &name);
00047 
00048   unsigned long get_hash() const;
00049 
00050 public:
00051   void generate_hash(HashGenerator &hash) const;
00052   bool add_class(DCClass *dclass);
00053 
00054 public:
00055   // This vector is the primary interface to the distributed classes
00056   // read from the file.
00057   typedef pvector<DCClass *> Classes;
00058   Classes _classes;
00059 
00060 public:
00061   // This map is built up during parsing for the convenience of the parser.
00062   typedef pmap<string, DCClass *> ClassesByName;
00063   ClassesByName _classes_by_name;
00064 };
00065 
00066 #endif
00067 
00068 

Generated on Fri May 2 01:37:07 2003 for Direct by doxygen1.3