@@ -36,30 +36,49 @@ namespace geode
3636 void python_attribute_class ( pybind11::class_< AttributeManager >& manager,
3737 const std::string& suffix )
3838 {
39- const auto read_suffix = absl::StrCat ( " find_attribute_ " , suffix );
39+ const auto read_suffix = absl::StrCat ( " read_attribute_ " , suffix );
4040 manager.def (
41- read_suffix.c_str (), &AttributeManager::find_attribute< type > );
42- const auto constant_suffix =
43- absl::StrCat ( " find_or_create_attribute_constant_" , suffix );
44- manager.def ( constant_suffix.c_str (),
41+ read_suffix.c_str (), &AttributeManager::read_attribute< type > );
42+ const auto create_constant_suffix =
43+ absl::StrCat ( " create_attribute_constant_" , suffix );
44+ manager.def ( create_constant_suffix.c_str (),
45+ static_cast < geode::uuid ( AttributeManager::* )(
46+ std::string_view, type ) >(
47+ &AttributeManager::create_attribute< ConstantAttribute,
48+ type > ) );
49+ const auto find_constant_suffix =
50+ absl::StrCat ( " find_attribute_constant_" , suffix );
51+ manager.def ( find_constant_suffix.c_str (),
4552 static_cast < std::shared_ptr< ConstantAttribute< type > > (
46- AttributeManager::* )( std::string_view, type ) >(
47- &AttributeManager::find_or_create_attribute< ConstantAttribute,
53+ AttributeManager::* )( const geode::uuid& ) >(
54+ &AttributeManager::find_attribute< ConstantAttribute,
55+ type > ) );
56+ const auto create_variable_suffix =
57+ absl::StrCat ( " create_attribute_variable_" , suffix );
58+ manager.def ( create_variable_suffix.c_str (),
59+ static_cast < geode::uuid ( AttributeManager::* )(
60+ std::string_view, type ) >(
61+ &AttributeManager::create_attribute< VariableAttribute,
4862 type > ) );
49- const auto variable_suffix =
50- absl::StrCat ( " find_or_create_attribute_variable_ " , suffix );
51- manager.def ( variable_suffix .c_str (),
63+ const auto find_variable_suffix =
64+ absl::StrCat ( " find_attribute_variable_ " , suffix );
65+ manager.def ( find_variable_suffix .c_str (),
5266 static_cast < std::shared_ptr< VariableAttribute< type > > (
53- AttributeManager::* )( std::string_view, type ) >(
54- &AttributeManager::find_or_create_attribute < VariableAttribute,
67+ AttributeManager::* )( const geode::uuid& ) >(
68+ &AttributeManager::find_attribute < VariableAttribute,
5569 type > ) );
56- const auto sparse_suffix =
57- absl::StrCat ( " find_or_create_attribute_sparse_" , suffix );
58- manager.def ( sparse_suffix.c_str (),
70+ const auto create_sparse_suffix =
71+ absl::StrCat ( " create_attribute_sparse_" , suffix );
72+ manager.def ( create_sparse_suffix.c_str (),
73+ static_cast < geode::uuid ( AttributeManager::* )( std::string_view,
74+ type ) >( &AttributeManager::create_attribute< SparseAttribute,
75+ type > ) );
76+ const auto find_sparse_suffix =
77+ absl::StrCat ( " find_attribute_sparse_" , suffix );
78+ manager.def ( find_sparse_suffix.c_str (),
5979 static_cast < std::shared_ptr< SparseAttribute< type > > (
60- AttributeManager::* )( std::string_view, type ) >(
61- &AttributeManager::find_or_create_attribute< SparseAttribute,
62- type > ) );
80+ AttributeManager::* )( const geode::uuid& ) >(
81+ &AttributeManager::find_attribute< SparseAttribute, type > ) );
6382 }
6483
6584 void define_attribute_manager ( pybind11::module & module )
@@ -69,7 +88,7 @@ namespace geode
6988 manager.def ( pybind11::init<>() )
7089 .def ( " find_generic_attribute" ,
7190 &AttributeManager::find_generic_attribute )
72- .def ( " attribute_names " , &AttributeManager::attribute_names )
91+ .def ( " attribute_ids " , &AttributeManager::attribute_ids )
7392 .def ( " attribute_type" , &AttributeManager::attribute_type )
7493 .def ( " attribute_exists" , &AttributeManager::attribute_exists )
7594 .def ( " nb_elements" , &AttributeManager::nb_elements )
0 commit comments