functionWriterPtrFromPython.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Filename: functionWriterPtrFromPython.h
  2. // Created by: drose (14Sep01)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef FUNCTIONWRITERPTRFROMPYTHON_H
  19. #define FUNCTIONWRITERPTRFROMPYTHON_H
  20. #include "functionWriter.h"
  21. class CPPType;
  22. ////////////////////////////////////////////////////////////////////
  23. // Class : FunctionWriterPtrFromPython
  24. // Description : This specialization of FunctionWriter generates a
  25. // function that converts a PyObject pointer
  26. // representing a class wrapper object to the
  27. // corresponding C++ pointer.
  28. ////////////////////////////////////////////////////////////////////
  29. class FunctionWriterPtrFromPython : public FunctionWriter {
  30. public:
  31. FunctionWriterPtrFromPython(CPPType *type);
  32. virtual ~FunctionWriterPtrFromPython();
  33. virtual void write_prototype(ostream &out);
  34. virtual void write_code(ostream &out);
  35. CPPType *get_type() const;
  36. CPPType *get_pointer_type() const;
  37. private:
  38. CPPType *_type;
  39. CPPType *_pointer_type;
  40. };
  41. #endif