00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00031
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 ©);
00046 void operator = (const CPPFunctionType ©);
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