szaszm commented on a change in pull request #1252:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1252#discussion_r798549102
##########
File path: controller/Controller.h
##########
@@ -246,18 +246,18 @@
std::shared_ptr<org::apache::nifi::minifi::core::controller::ControllerService>
configuration->get(org::apache::nifi::minifi::Configure::nifi_provenance_repository_class_name,
prov_repo_class);
// Create repos for flow record and provenance
- const auto prov_repo =
org::apache::nifi::minifi::core::createRepository(prov_repo_class, true,
"provenance");
+ const std::shared_ptr<org::apache::nifi::minifi::core::Repository> prov_repo
= org::apache::nifi::minifi::core::createRepository(prov_repo_class, true,
"provenance");
Review comment:
So is this an invocation of the unique_ptr -> shared_ptr constuctor? In
that case, maybe just saying `std::shared_ptr` (and relying on CTAD) would be
enough.
```suggestion
const std::shared_ptr prov_repo =
org::apache::nifi::minifi::core::createRepository(prov_repo_class, true,
"provenance");
```
##########
File path: extensions/aws/processors/PutS3Object.h
##########
@@ -30,6 +30,7 @@
#include <utility>
#include <vector>
+#include "io/StreamPipe.h"
Review comment:
Oh, true
##########
File path: extensions/http-curl/tests/C2NullConfiguration.cpp
##########
@@ -61,10 +61,10 @@ class VerifyC2Server : public HTTPIntegrationBase {
}
void queryRootProcessGroup(std::shared_ptr<core::ProcessGroup> pg) override {
- std::shared_ptr<core::Processor> proc = pg->findProcessorByName("invoke");
+ auto proc = pg->findProcessorByName("invoke");
Review comment:
Prefer `auto*` if it's a raw pointer. I usually add `const`, too, when
it's not changed/moved-from/returned, that would be `auto* const`.
##########
File path: extensions/http-curl/tests/ControllerServiceIntegrationTests.cpp
##########
@@ -82,9 +82,10 @@ int main(int argc, char **argv) {
core::YamlConfiguration yaml_config(test_repo, test_repo, content_repo,
stream_factory, configuration, args.test_file);
- std::shared_ptr<core::ProcessGroup> pg(yaml_config.getRoot());
+ auto pg = yaml_config.getRoot();
- std::shared_ptr<core::controller::StandardControllerServiceProvider>
provider =
std::make_shared<core::controller::StandardControllerServiceProvider>(map, pg,
std::make_shared<minifi::Configure>());
+ std::shared_ptr<core::controller::StandardControllerServiceProvider>
provider =
+
std::make_shared<core::controller::StandardControllerServiceProvider>(map,
pg.get(), std::make_shared<minifi::Configure>());
Review comment:
Consider using `auto` here, too. No need to repeat long type names, and
it might fit in the line length limit that way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]