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

dtool/src/cppparser/cppFunctionType.h

Go to the documentation of this file.
00001 // Filename: cppFunctionType.h
00002 // Created by:  drose (21Oct99)
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 CPPFUNCTIONTYPE_H
00020 #define CPPFUNCTIONTYPE_H
00021 
00022 #include <dtoolbase.h>
00023 
00024 #include "cppType.h"
00025 
00026 class CPPParameterList;
00027 class CPPIdentifier;
00028 
00029 ///////////////////////////////////////////////////////////////////
00030 //       Class : CPPFunctionType
00031 // Description :
00032 ////////////////////////////////////////////////////////////////////
00033 class CPPFunctionType : public CPPType {
00034 public:
00035   enum Flags {
00036     F_const_method      = 0x01,
00037     F_operator_typecast = 0x02,
00038     F_constructor       = 0x04,
00039     F_destructor        = 0x08,
00040     F_method_pointer    = 0x10,
00041   };
00042 
00043   CPPFunctionType(CPPType *return_type, CPPParameterList *parameters,
00044                   int flags);
00045   CPPFunctionType(const CPPFunctionType &copy);
00046   void operator = (const CPPFunctionType &copy);
00047 
00048   CPPType *_return_type;
00049   CPPParameterList *_parameters;
00050   int _flags;
00051 
00052   virtual bool is_fully_specified() const;
00053   virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
00054                                           CPPScope *current_scope,
00055                                           CPPScope *global_scope);
00056 
00057   virtual CPPType *resolve_type(CPPScope *current_scope,
00058                                 CPPScope *global_scope);
00059 
00060   virtual bool is_tbd() const;
00061 
00062   virtual void output(ostream &out, int indent_level, CPPScope *scope,
00063                       bool complete) const;
00064   void output(ostream &out, int indent_level, CPPScope *scope,
00065               bool complete, int num_default_parameters) const;
00066   virtual void output_instance(ostream &out, int indent_level,
00067                                CPPScope *scope,
00068                                bool complete, const string &prename,
00069                                const string &name) const;
00070   void output_instance(ostream &out, int indent_level,
00071                        CPPScope *scope,
00072                        bool complete, const string &prename,
00073                        const string &name,
00074                        int num_default_parameters) const;
00075   int get_num_default_parameters() const;
00076 
00077   virtual SubType get_subtype() const;
00078 
00079   virtual CPPFunctionType *as_function_type();
00080 
00081   bool is_equivalent_function(const CPPFunctionType &other) const;
00082 
00083   CPPIdentifier *_class_owner;
00084 
00085 protected:
00086   virtual bool is_equal(const CPPDeclaration *other) const;
00087   virtual bool is_less(const CPPDeclaration *other) const;
00088 };
00089 
00090 #endif
00091 

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