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

dtool/src/cppparser/cppStructType.h

Go to the documentation of this file.
00001 // Filename: cppStructType.h
00002 // Created by:  drose (19Oct99)
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 CPPSTRUCTTYPE_H
00020 #define CPPSTRUCTTYPE_H
00021 
00022 #include <dtoolbase.h>
00023 
00024 #include "cppExtensionType.h"
00025 #include "cppVisibility.h"
00026 
00027 #include <vector>
00028 #include <list>
00029 
00030 class CPPScope;
00031 class CPPTypeProxy;
00032 
00033 ///////////////////////////////////////////////////////////////////
00034 //       Class : CPPStructType
00035 // Description :
00036 ////////////////////////////////////////////////////////////////////
00037 class CPPStructType : public CPPExtensionType {
00038 public:
00039   CPPStructType(Type type, CPPIdentifier *ident,
00040                 CPPScope *current_scope,
00041                 CPPScope *scope,
00042                 const CPPFile &file);
00043   CPPStructType(const CPPStructType &copy);
00044   void operator = (const CPPStructType &copy);
00045 
00046   void append_derivation(CPPType *base, CPPVisibility vis, bool is_virtual);
00047 
00048   CPPScope *get_scope() const;
00049 
00050   bool is_abstract() const;
00051   void check_virtual();
00052   virtual bool is_fully_specified() const;
00053   virtual bool is_incomplete() const;
00054 
00055   CPPInstance *get_destructor() const;
00056 
00057   virtual CPPDeclaration *
00058   instantiate(const CPPTemplateParameterList *actual_params,
00059               CPPScope *current_scope, CPPScope *global_scope,
00060               CPPPreprocessor *error_sink = NULL) const;
00061 
00062   virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
00063                                           CPPScope *current_scope,
00064                                           CPPScope *global_scope);
00065 
00066   virtual void output(ostream &out, int indent_level, CPPScope *scope,
00067                       bool complete) const;
00068   virtual SubType get_subtype() const;
00069 
00070   virtual CPPStructType *as_struct_type();
00071 
00072   CPPScope *_scope;
00073   bool _incomplete;
00074 
00075   class Base {
00076   public:
00077     void output(ostream &out) const;
00078 
00079     CPPType *_base;
00080     CPPVisibility _vis;
00081     bool _is_virtual;
00082   };
00083 
00084   typedef vector<Base> Derivation;
00085   Derivation _derivation;
00086 
00087   typedef list<CPPInstance *> VFunctions;
00088   void get_virtual_funcs(VFunctions &funcs) const;
00089   void get_pure_virtual_funcs(VFunctions &funcs) const;
00090 
00091 protected:
00092   virtual bool is_equal(const CPPDeclaration *other) const;
00093   virtual bool is_less(const CPPDeclaration *other) const;
00094 
00095   bool _subst_decl_recursive_protect;
00096   typedef vector<CPPTypeProxy *> Proxies;
00097   Proxies _proxies;
00098 };
00099 
00100 inline ostream &operator << (ostream &out, const CPPStructType::Base &base) {
00101   base.output(out);
00102   return out;
00103 }
00104 
00105 
00106 #endif

Generated on Thu May 1 22:12:55 2003 for DTool by doxygen1.3