dns_requestcontext_python.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef __PYTHON_REQUESTCONTEXT_H
  15. #define __PYTHON_REQUESTCONTEXT_H 1
  16. #include <Python.h>
  17. #include <acl/dns.h>
  18. namespace isc {
  19. namespace acl {
  20. namespace dns {
  21. namespace python {
  22. // The s_* Class simply covers one instantiation of the object
  23. class s_RequestContext : public PyObject {
  24. public:
  25. s_RequestContext();
  26. RequestContext* cppobj;
  27. // This object needs to maintain some source data to construct the
  28. // underlying RequestContext object throughout its lifetime.
  29. // These are "public" so that it can be accessed in the python wrapper
  30. // implementation, but essentially they should be private, and the
  31. // implementation details are hidden.
  32. struct Data;
  33. Data* data_;
  34. };
  35. extern PyTypeObject requestcontext_type;
  36. bool initModulePart_RequestContext(PyObject* mod);
  37. } // namespace python
  38. } // namespace dns
  39. } // namespace acl
  40. } // namespace isc
  41. #endif // __PYTHON_REQUESTCONTEXT_H
  42. // Local Variables:
  43. // mode: c++
  44. // End: