cppExtensionType.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 cppExtensionType.h
  10. * @author drose
  11. * @date 1999-10-21
  12. */
  13. #ifndef CPPEXTENSIONTYPE_H
  14. #define CPPEXTENSIONTYPE_H
  15. #include "dtoolbase.h"
  16. #include "cppType.h"
  17. #include "cppInstance.h"
  18. class CPPScope;
  19. class CPPIdentifier;
  20. /**
  21. * Base class of enum, class, struct, and union types. An instance of the
  22. * base class (instead of one of the specializations) is used for forward
  23. * references.
  24. */
  25. class CPPExtensionType : public CPPType {
  26. public:
  27. enum Type {
  28. T_enum,
  29. T_class,
  30. T_struct,
  31. T_union,
  32. T_enum_class,
  33. T_enum_struct,
  34. };
  35. CPPExtensionType(Type type, CPPIdentifier *ident, CPPScope *current_scope,
  36. const CPPFile &file);
  37. virtual string get_simple_name() const;
  38. virtual string get_local_name(CPPScope *scope = NULL) const;
  39. virtual string get_fully_scoped_name() const;
  40. virtual bool is_incomplete() const;
  41. virtual bool is_tbd() const;
  42. virtual bool is_trivial() const;
  43. virtual bool is_default_constructible() const;
  44. virtual bool is_copy_constructible() const;
  45. virtual CPPDeclaration *substitute_decl(SubstDecl &subst,
  46. CPPScope *current_scope,
  47. CPPScope *global_scope);
  48. virtual CPPType *resolve_type(CPPScope *current_scope,
  49. CPPScope *global_scope);
  50. virtual bool is_equivalent(const CPPType &other) const;
  51. virtual void output(ostream &out, int indent_level, CPPScope *scope,
  52. bool complete) const;
  53. virtual SubType get_subtype() const;
  54. virtual CPPExtensionType *as_extension_type();
  55. Type _type;
  56. CPPIdentifier *_ident;
  57. CPPExpression *_alignment;
  58. };
  59. ostream &operator << (ostream &out, CPPExtensionType::Type type);
  60. #endif