cppReferenceType.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file cppReferenceType.h
  10. * @author drose
  11. * @date 1999-10-19
  12. */
  13. #ifndef CPPREFERENCETYPE_H
  14. #define CPPREFERENCETYPE_H
  15. #include "dtoolbase.h"
  16. #include "cppType.h"
  17. /**
  18. * Either an lvalue- or rvalue-reference.
  19. */
  20. class CPPReferenceType : public CPPType {
  21. public:
  22. enum ValueCategory {
  23. VC_lvalue,
  24. VC_rvalue
  25. };
  26. CPPReferenceType(CPPType *pointing_at, ValueCategory vcat=VC_lvalue);
  27. CPPType *_pointing_at;
  28. ValueCategory _value_category;
  29. virtual bool is_fully_specified() const;
  30. virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
  31. CPPScope *current_scope,
  32. CPPScope *global_scope);
  33. virtual CPPType *resolve_type(CPPScope *current_scope,
  34. CPPScope *global_scope);
  35. virtual bool is_tbd() const;
  36. virtual bool is_standard_layout() const;
  37. virtual bool is_trivial() const;
  38. virtual bool is_constructible(const CPPType *type) const;
  39. virtual bool is_default_constructible() const;
  40. virtual bool is_copy_constructible() const;
  41. virtual bool is_destructible() const;
  42. virtual bool is_equivalent(const CPPType &other) const;
  43. virtual void output(ostream &out, int indent_level, CPPScope *scope,
  44. bool complete) const;
  45. virtual void output_instance(ostream &out, int indent_level,
  46. CPPScope *scope,
  47. bool complete, const string &prename,
  48. const string &name) const;
  49. virtual SubType get_subtype() const;
  50. virtual CPPReferenceType *as_reference_type();
  51. protected:
  52. virtual bool is_equal(const CPPDeclaration *other) const;
  53. virtual bool is_less(const CPPDeclaration *other) const;
  54. };
  55. #endif