00001 // Filename: cppTBDType.h 00002 // Created by: drose (05Nov99) 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 CPPTBDTYPE_H 00020 #define CPPTBDTYPE_H 00021 00022 #include <dtoolbase.h> 00023 00024 #include "cppType.h" 00025 00026 class CPPIdentifier; 00027 00028 /////////////////////////////////////////////////////////////////// 00029 // Class : CPPTBDType 00030 // Description : This represents a type whose exact meaning is still 00031 // to-be-determined. It happens when a typename is 00032 // referenced in a template class (especially using the 00033 // 'typename' keyword) but the actual type cannot be 00034 // known until the class is instantiated. 00035 //////////////////////////////////////////////////////////////////// 00036 class CPPTBDType : public CPPType { 00037 public: 00038 CPPTBDType(CPPIdentifier *ident); 00039 00040 virtual CPPType *resolve_type(CPPScope *current_scope, 00041 CPPScope *global_scope); 00042 00043 virtual bool is_tbd() const; 00044 00045 virtual string get_simple_name() const; 00046 virtual string get_local_name(CPPScope *scope = NULL) const; 00047 virtual string get_fully_scoped_name() const; 00048 00049 virtual CPPDeclaration *substitute_decl(SubstDecl &subst, 00050 CPPScope *current_scope, 00051 CPPScope *global_scope); 00052 00053 virtual void output(ostream &out, int indent_level, CPPScope *scope, 00054 bool complete) const; 00055 virtual SubType get_subtype() const; 00056 00057 virtual CPPTBDType *as_tbd_type(); 00058 00059 CPPIdentifier *_ident; 00060 00061 protected: 00062 virtual bool is_equal(const CPPDeclaration *other) const; 00063 virtual bool is_less(const CPPDeclaration *other) const; 00064 00065 private: 00066 bool _subst_decl_recursive_protect; 00067 }; 00068 00069 #endif