enum_base.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef ENUM_BASE_DWA200298_HPP
  6. # define ENUM_BASE_DWA200298_HPP
  7. # include <boost/python/object_core.hpp>
  8. # include <boost/python/type_id.hpp>
  9. # include <boost/python/converter/to_python_function_type.hpp>
  10. # include <boost/python/converter/convertible_function.hpp>
  11. # include <boost/python/converter/constructor_function.hpp>
  12. namespace boost { namespace python { namespace objects {
  13. struct BOOST_PYTHON_DECL enum_base : python::api::object
  14. {
  15. protected:
  16. enum_base(
  17. char const* name
  18. , converter::to_python_function_t
  19. , converter::convertible_function
  20. , converter::constructor_function
  21. , type_info
  22. , const char *doc = 0
  23. );
  24. void add_value(char const* name, long value);
  25. void export_values();
  26. static PyObject* to_python(PyTypeObject* type, long x);
  27. };
  28. }}} // namespace boost::python::object
  29. #endif // ENUM_BASE_DWA200298_HPP