/ src / emc / rs274ngc / boost_pyenum_macros.hh
boost_pyenum_macros.hh
 1  /**
 2   * @file boost_pyenum_macros.hh
 3   *
 4   * Simple wrapper macros that avoid name repetition when defining python enums with boost::python.
 5   *
 6   * @author Robert W. Ellenberg <rwe24g@gmail.com>
 7   *
 8   * @copyright Copyright 2019, Robert W. Ellenberg
 9   *
10   * This source code is released for free distribution under the terms of the
11   * GNU General Public License (V2) as published by the Free Software Foundation.
12   */
13  
14  #ifndef BOOST_PYENUM_MACROS_HH
15  #define BOOST_PYENUM_MACROS_HH
16  #include <boost/python/enum.hpp>
17  
18  #define BOOST_PYENUM_VAL(X) value(#X, X)
19  #define BOOST_PYENUM_(X) enum_<X>(#X)
20  
21  #endif // BOOST_PYENUM_MACROS_HH