cppParameterList.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 cppParameterList.h
  10. * @author drose
  11. * @date 1999-10-21
  12. */
  13. #ifndef CPPPARAMETERLIST_H
  14. #define CPPPARAMETERLIST_H
  15. #include "dtoolbase.h"
  16. #include "cppDeclaration.h"
  17. #include <vector>
  18. class CPPInstance;
  19. class CPPScope;
  20. /**
  21. * A list of formal parameters for a function declaration.
  22. */
  23. class CPPParameterList {
  24. public:
  25. CPPParameterList();
  26. bool is_equivalent(const CPPParameterList &other) const;
  27. bool operator == (const CPPParameterList &other) const;
  28. bool operator != (const CPPParameterList &other) const;
  29. bool operator < (const CPPParameterList &other) const;
  30. bool is_tbd() const;
  31. bool is_parameter_expr() const;
  32. bool is_fully_specified() const;
  33. CPPParameterList *substitute_decl(CPPDeclaration::SubstDecl &subst,
  34. CPPScope *current_scope,
  35. CPPScope *global_scope);
  36. CPPParameterList *resolve_type(CPPScope *current_scope,
  37. CPPScope *global_scope);
  38. // This vector contains a list of formal parameters, in order. A parameter
  39. // may have an empty identifer name.
  40. typedef vector<CPPInstance *> Parameters;
  41. Parameters _parameters;
  42. bool _includes_ellipsis;
  43. void output(ostream &out, CPPScope *scope, bool parameter_names,
  44. int num_default_parameters = -1) const;
  45. };
  46. inline ostream &
  47. operator << (ostream &out, const CPPParameterList &plist) {
  48. plist.output(out, (CPPScope *)NULL, true);
  49. return out;
  50. }
  51. #endif