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

direct/src/dcparser/dcClass.h

Go to the documentation of this file.
00001 // Filename: dcClass.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 DCCLASS_H
00020 #define DCCLASS_H
00021 
00022 #include "dcbase.h"
00023 #include "dcField.h"
00024 
00025 class HashGenerator;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : DCClass
00029 // Description : Defines a particular DistributedClass as read from an
00030 //               input .dc file.
00031 ////////////////////////////////////////////////////////////////////
00032 class EXPCL_DIRECT DCClass {
00033 PUBLISHED:
00034   int get_number() const;
00035   string get_name() const;
00036 
00037   bool has_parent() const;
00038   DCClass *get_parent() const;
00039 
00040   int get_num_fields();
00041   DCField *get_field(int n);
00042   DCField *get_field_by_name(const string &name);
00043 
00044   int get_num_inherited_fields();
00045   DCField *get_inherited_field(int n);
00046 
00047 public:
00048   DCClass();
00049   ~DCClass();
00050 
00051   void write(ostream &out, int indent_level = 0) const;
00052   void generate_hash(HashGenerator &hash) const;
00053 
00054   bool add_field(DCField *field);
00055 
00056 public:
00057   // These members define the primary interface to the distributed
00058   // class as read from the file.
00059   int _number;
00060   string _name;
00061 
00062   typedef pvector<DCClass *> Parents;
00063   Parents _parents;
00064 
00065   typedef pvector<DCField *> Fields;
00066   Fields _fields;
00067 
00068 public:
00069   // These members are built up during parsing for the convenience of
00070   // the parser.
00071   typedef pmap<string, DCField *> FieldsByName;
00072   FieldsByName _fields_by_name;
00073 };
00074 
00075 #endif

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