cppParameterList.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Filename: cppParameterList.h
  2. // Created by: drose (21Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CPPPARAMETERLIST_H
  15. #define CPPPARAMETERLIST_H
  16. #include "dtoolbase.h"
  17. #include "cppDeclaration.h"
  18. #include <vector>
  19. class CPPInstance;
  20. class CPPScope;
  21. ///////////////////////////////////////////////////////////////////
  22. // Class : CPPParameterList
  23. // Description : A list of formal parameters for a function
  24. // declaration.
  25. ////////////////////////////////////////////////////////////////////
  26. class CPPParameterList {
  27. public:
  28. CPPParameterList();
  29. bool is_equivalent(const CPPParameterList &other) const;
  30. bool operator == (const CPPParameterList &other) const;
  31. bool operator != (const CPPParameterList &other) const;
  32. bool operator < (const CPPParameterList &other) const;
  33. bool is_tbd() const;
  34. bool is_parameter_expr() const;
  35. bool is_fully_specified() const;
  36. CPPParameterList *substitute_decl(CPPDeclaration::SubstDecl &subst,
  37. CPPScope *current_scope,
  38. CPPScope *global_scope);
  39. CPPParameterList *resolve_type(CPPScope *current_scope,
  40. CPPScope *global_scope);
  41. // This vector contains a list of formal parameters, in order. A
  42. // parameter may have an empty identifer name.
  43. typedef vector<CPPInstance *> Parameters;
  44. Parameters _parameters;
  45. bool _includes_ellipsis;
  46. void output(ostream &out, CPPScope *scope, bool parameter_names,
  47. int num_default_parameters = -1) const;
  48. };
  49. inline ostream &
  50. operator << (ostream &out, const CPPParameterList &plist) {
  51. plist.output(out, (CPPScope *)NULL, true);
  52. return out;
  53. }
  54. #endif