6 #ifndef PARAM_NODE_PYBIND_HH_ 7 #define PARAM_NODE_PYBIND_HH_ 18 std::list< std::string > all_members;
21 all_members.push_back(
"ParamNode" );
23 .def( pybind11::init< >() )
37 "returns the number of occurances of provided key" )
47 "Add a param object to a node at a particular key")
51 (
bool (
scarab::param_node::*)(
const std::string&,
bool)
const) &scarab::param_node::get_value<bool>,
54 "Get parameter node value at [key] or return [default] (as a bool)" )
56 (
unsigned (
scarab::param_node::*)(
const std::string&,
unsigned)
const) &scarab::param_node::get_value<uint>,
59 "Get parameter node value at [key] or return [default] (as an unsigned integer)" )
61 (
int (
scarab::param_node::*)(
const std::string&,
int)
const) &scarab::param_node::get_value<int>,
64 "Get parameter node value at [key] or return [default] (as a signed integer)" )
66 (
double (
scarab::param_node::*)(
const std::string&,
double)
const) &scarab::param_node::get_value<double>,
69 "Get parameter node value at [key] or return [default] (as a float)" )
74 "Get parameter node value at [key] or return [default] (as a string)" )
void replace(const std::string &a_name, const param &a_value)
Creates a copy of a_value; overwrites if the key exits.
Wrapper for Python extension modules.
std::string get_value(const std::string &a_name, const std::string &a_default) const
unsigned count(const std::string &a_name) const
Keep patient alive while nurse lives.
std::list< std::string > export_param_node(pybind11::module &mod)
bool add(const std::string &a_name, const param &a_value)
iterator make_iterator(Iterator first, Sentinel last, Extra &&... extra)
Makes a python iterator from a first and past-the-end C++ InputIterator.
bool has(const std::string &a_name) const
bool typename Extra class_ & def(const char *name_, Func &&f, const Extra &... extra)
virtual std::string to_string() const