| 121 | } |
| 122 | |
| 123 | cpp11::environment RExtensionType::r6_instance( |
| 124 | std::shared_ptr<arrow::DataType> storage_type, |
| 125 | const std::string& serialized_data) const { |
| 126 | // This is a version of to_r6<>() that is a more direct route to creating the object. |
| 127 | // This is done to avoid circular calls, since to_r6<>() has to go through |
| 128 | // ExtensionType$new(), which then calls back to C++ to get r6_class_ to then |
| 129 | // return the correct subclass. |
| 130 | std::unique_ptr<RExtensionType> cloned = Clone(); |
| 131 | cpp11::external_pointer<std::shared_ptr<RExtensionType>> xp( |
| 132 | new std::shared_ptr<RExtensionType>(cloned.release())); |
| 133 | |
| 134 | cpp11::function r6_class_new(r6_class()["new"]); |
| 135 | return r6_class_new(xp); |
| 136 | } |
| 137 | |
| 138 | // [[arrow::export]] |
| 139 | cpp11::environment ExtensionType__initialize( |
no test coverage detected