cppParameterList.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Filename: cppParameterList.h
  2. // Created by: drose (21Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef CPPPARAMETERLIST_H
  19. #define CPPPARAMETERLIST_H
  20. #include <dtoolbase.h>
  21. #include "cppDeclaration.h"
  22. #include <vector>
  23. class CPPInstance;
  24. class CPPScope;
  25. ///////////////////////////////////////////////////////////////////
  26. // Class : CPPParameterList
  27. // Description :
  28. ////////////////////////////////////////////////////////////////////
  29. class CPPParameterList {
  30. public:
  31. CPPParameterList();
  32. bool is_equivalent(const CPPParameterList &other) const;
  33. bool operator == (const CPPParameterList &other) const;
  34. bool operator != (const CPPParameterList &other) const;
  35. bool operator < (const CPPParameterList &other) const;
  36. bool is_tbd() const;
  37. bool is_fully_specified() const;
  38. CPPParameterList *substitute_decl(CPPDeclaration::SubstDecl &subst,
  39. CPPScope *current_scope,
  40. CPPScope *global_scope);
  41. CPPParameterList *resolve_type(CPPScope *current_scope,
  42. CPPScope *global_scope);
  43. // This vector contains a list of formal parameters, in order. A
  44. // parameter may have an empty identifer name.
  45. typedef vector<CPPInstance *> Parameters;
  46. Parameters _parameters;
  47. bool _includes_ellipsis;
  48. void output(ostream &out, CPPScope *scope, bool parameter_names,
  49. int num_default_parameters = -1) const;
  50. };
  51. inline ostream &
  52. operator << (ostream &out, const CPPParameterList &plist) {
  53. plist.output(out, (CPPScope *)NULL, true);
  54. return out;
  55. }
  56. #endif