cppTBDType.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Filename: cppTBDType.h
  2. // Created by: drose (05Nov99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef CPPTBDTYPE_H
  6. #define CPPTBDTYPE_H
  7. #include <dtoolbase.h>
  8. #include "cppType.h"
  9. class CPPIdentifier;
  10. ///////////////////////////////////////////////////////////////////
  11. // Class : CPPTBDType
  12. // Description : This represents a type whose exact meaning is still
  13. // to-be-determined. It happens when a typename is
  14. // referenced in a template class (especially using the
  15. // 'typename' keyword) but the actual type cannot be
  16. // known until the class is instantiated.
  17. ////////////////////////////////////////////////////////////////////
  18. class CPPTBDType : public CPPType {
  19. public:
  20. CPPTBDType(CPPIdentifier *ident);
  21. virtual CPPType *resolve_type(CPPScope *current_scope,
  22. CPPScope *global_scope);
  23. virtual bool is_tbd() const;
  24. virtual string get_simple_name() const;
  25. virtual string get_local_name(CPPScope *scope = NULL) const;
  26. virtual string get_fully_scoped_name() const;
  27. virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
  28. CPPScope *current_scope,
  29. CPPScope *global_scope);
  30. virtual void output(ostream &out, int indent_level, CPPScope *scope,
  31. bool complete) const;
  32. virtual SubType get_subtype() const;
  33. virtual CPPTBDType *as_tbd_type();
  34. CPPIdentifier *_ident;
  35. protected:
  36. virtual bool is_equal(const CPPDeclaration *other) const;
  37. virtual bool is_less(const CPPDeclaration *other) const;
  38. private:
  39. bool _subst_decl_recursive_protect;
  40. };
  41. #endif