1 #include "pybind11/pybind11.h" 
    2 #include "pybind11/stl.h" 
   11 using namespace pybind11::literals;
 
   18 template <
typename T, 
typename C>
 
   21     cls.def(getName.
c_str(), (T (PropertySet::*)(
std::string const&) 
const) & PropertySet::get<T>, 
"name"_a);
 
   22     cls.def(getName.
c_str(), (T (PropertySet::*)(
std::string const&, T 
const&) 
const) & PropertySet::get<T>,
 
   23             "name"_a, 
"defaultValue"_a);
 
   30     cls.def(setName.
c_str(), (void (PropertySet::*)(
std::string const&, T 
const&)) & PropertySet::set<T>,
 
   37     cls.def(addName.
c_str(), (void (PropertySet::*)(
std::string const&, T 
const&)) & PropertySet::add<T>,
 
   44     cls.attr(typeName.
c_str()) = py::cast(PropertySet::typeOfT<T>(), py::return_value_policy::reference);
 
   50     py::module::import(
"lsst.daf.base.persistable");
 
   52     py::class_<std::type_info>(mod, 
"TypeInfo")
 
   60     py::class_<PropertySet, std::shared_ptr<PropertySet>> 
cls(mod, 
"PropertySet");
 
   62     cls.def(py::init<bool>(), 
"flat"_a = 
false);
 
   64     cls.def(
"deepCopy", &PropertySet::deepCopy);
 
   65     cls.def(
"nameCount", &PropertySet::nameCount, 
"topLevelOnly"_a = 
true);
 
   66     cls.def(
"names", &PropertySet::names, 
"topLevelOnly"_a = 
true);
 
   67     cls.def(
"paramNames", &PropertySet::paramNames, 
"topLevelOnly"_a = 
true);
 
   68     cls.def(
"propertySetNames", &PropertySet::propertySetNames, 
"topLevelOnly"_a = 
true);
 
   69     cls.def(
"exists", &PropertySet::exists);
 
   70     cls.def(
"isArray", &PropertySet::isArray);
 
   71     cls.def(
"isUndefined", &PropertySet::isUndefined);
 
   72     cls.def(
"isPropertySetPtr", &PropertySet::isPropertySetPtr);
 
   73     cls.def(
"valueCount", &PropertySet::valueCount);
 
   74     cls.def(
"typeOf", &PropertySet::typeOf, py::return_value_policy::reference);
 
   75     cls.def(
"toString", &PropertySet::toString, 
"topLevelOnly"_a = 
false, 
"indent"_a = 
"");
 
   76     cls.def(
"copy", &PropertySet::copy, 
"dest"_a, 
"source"_a, 
"name"_a, 
"asScalar"_a=
false);
 
   77     cls.def(
"combine", &PropertySet::combine);
 
   78     cls.def(
"remove", &PropertySet::remove);
 
   79     cls.def(
"getAsBool", &PropertySet::getAsBool);
 
   80     cls.def(
"getAsInt", &PropertySet::getAsInt);
 
   81     cls.def(
"getAsInt64", &PropertySet::getAsInt64);
 
   82     cls.def(
"getAsUInt64", &PropertySet::getAsUInt64);
 
   83     cls.def(
"getAsDouble", &PropertySet::getAsDouble);
 
   84     cls.def(
"getAsString", &PropertySet::getAsString);
 
   85     cls.def(
"getAsPropertySetPtr", &PropertySet::getAsPropertySetPtr);
 
   86     cls.def(
"getAsPersistablePtr", &PropertySet::getAsPersistablePtr);
 
   88     declareAccessors<bool>(
cls, 
"Bool");
 
   89     declareAccessors<short>(
cls, 
"Short");
 
   90     declareAccessors<int>(
cls, 
"Int");
 
   91     declareAccessors<long>(
cls, 
"Long");
 
   92     declareAccessors<long long>(
cls, 
"LongLong");
 
   93     declareAccessors<unsigned long long>(
cls, 
"UnsignedLongLong");
 
   94     declareAccessors<float>(
cls, 
"Float");
 
   95     declareAccessors<double>(
cls, 
"Double");
 
   96     declareAccessors<nullptr_t>(
cls, 
"Undef");
 
   97     declareAccessors<std::string>(
cls, 
"String");
 
   98     declareAccessors<DateTime>(
cls, 
"DateTime");
 
   99     declareAccessors<std::shared_ptr<PropertySet>>(
cls, 
"PropertySet");