10#include <boost/python/class.hpp>
11#include <boost/python/default_call_policies.hpp>
12#include <boost/python/list.hpp>
13#include <boost/python/make_constructor.hpp>
30template <
typename T>
ListValidator<T> *createListValidator(
const boost::python::list &allowedValues) {
34#define EXPORT_LISTVALIDATOR(type, prefix) \
35 class_<ListValidator<type>, bases<IValidator>, boost::noncopyable>(#prefix "ListValidator") \
36 .def("__init__", make_constructor(&createListValidator<type>, default_call_policies(), arg("allowedValues"))) \
37 .def("addAllowedValue", &ListValidator<type>::addAllowedValue, (arg("self"), arg("value")), \
38 "Adds a value to the list of accepted values");
#define EXPORT_LISTVALIDATOR(type, prefix)
void export_ListValidator()
IValidator is the basic interface for all validators for properties.
ListValidator is a validator that requires the value of a property to be one of a defined list of pos...
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the templa...