Repository: celix Updated Branches: refs/heads/feature/CELIX-426-cxx-api d9e95de89 -> b4ce49f80
CELIX-446: Refactors for effc c++ warnings (gcc8) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b4ce49f8 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b4ce49f8 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b4ce49f8 Branch: refs/heads/feature/CELIX-426-cxx-api Commit: b4ce49f804aa8d7fa37b9bfa9a22d3b178daff75 Parents: d9e95de Author: Pepijn Noltes <[email protected]> Authored: Tue Jul 10 17:51:03 2018 +0200 Committer: Pepijn Noltes <[email protected]> Committed: Tue Jul 10 17:51:03 2018 +0200 ---------------------------------------------------------------------- .../shell/include/celix/ShellCommandServiceAdapters.h | 4 ++++ .../shell_command_example/src/Activator.cc | 4 ++-- libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc | 14 +++++++++++++- libs/framework/include/celix/ServiceAdapter.h | 4 ++++ 4 files changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/b4ce49f8/bundles/shell/shell/include/celix/ShellCommandServiceAdapters.h ---------------------------------------------------------------------- diff --git a/bundles/shell/shell/include/celix/ShellCommandServiceAdapters.h b/bundles/shell/shell/include/celix/ShellCommandServiceAdapters.h index 1b5dbcf..ca68a89 100644 --- a/bundles/shell/shell/include/celix/ShellCommandServiceAdapters.h +++ b/bundles/shell/shell/include/celix/ShellCommandServiceAdapters.h @@ -71,6 +71,10 @@ namespace celix { public: ServiceAdapter(void *_svc) : cSvc{static_cast<command_service_t*>(_svc)} {} virtual ~ServiceAdapter() = default; + + ServiceAdapter(const ServiceAdapter&) = delete; + ServiceAdapter& operator=(const ServiceAdapter&) = delete; + celix::IShellCommand* adapt() override { return this; } int executeCommand(const std::string &commandLine, std::ostream &out, std::ostream &err) override { http://git-wip-us.apache.org/repos/asf/celix/blob/b4ce49f8/examples/celix-examples/shell_command_example/src/Activator.cc ---------------------------------------------------------------------- diff --git a/examples/celix-examples/shell_command_example/src/Activator.cc b/examples/celix-examples/shell_command_example/src/Activator.cc index 75835b0..c904c09 100644 --- a/examples/celix-examples/shell_command_example/src/Activator.cc +++ b/examples/celix-examples/shell_command_example/src/Activator.cc @@ -28,7 +28,7 @@ namespace { class BundleActivator : public celix::IBundleActivator, public celix::IShellCommand { public: - celix_status_t start(celix::BundleContext &_ctx) override { + celix_status_t start(celix::BundleContext &_ctx)override { this->ctx = &_ctx; celix::Properties props{}; props[OSGI_SHELL_COMMAND_NAME] = "cxx_exmpl"; @@ -50,7 +50,7 @@ namespace { } private: - celix::BundleContext *ctx; + celix::BundleContext *ctx{nullptr}; long svcId{-1}; }; } http://git-wip-us.apache.org/repos/asf/celix/blob/b4ce49f8/libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc ---------------------------------------------------------------------- diff --git a/libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc b/libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc index 63add3a..9eac3e2 100644 --- a/libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc +++ b/libs/framework/gtest/src/cxx_ServiceAdapter_tests.cc @@ -30,7 +30,7 @@ public: this->fw_ptr = std::unique_ptr<celix::Framework>{celix::FrameworkFactory::newFramework(std::move(config))}; } - ~ServiceAdapterTestd(){} + ~ServiceAdapterTest(){} celix::Framework& framework() { return *(this->fw_ptr); } private: @@ -111,6 +111,10 @@ public: public: ServiceAdapter(IHelloServiceNoDefaultWrapper *_svc) : svc{_svc} {} virtual ~ServiceAdapter() = default; + + ServiceAdapter(const ServiceAdapter&) = delete; + ServiceAdapter& operator=(const ServiceAdapter&) = delete; + IHelloServiceNoDefaultWrapper* adapt() override { return svc; } private: IHelloServiceNoDefaultWrapper* svc; @@ -134,6 +138,10 @@ public: public: ServiceAdapter(void *_svc) : svc{static_cast<IHelloServiceNoDefaultWrapper*>(_svc)} {} virtual ~ServiceAdapter() = default; + + ServiceAdapter(const ServiceAdapter&) = delete; + ServiceAdapter& operator=(const ServiceAdapter&) = delete; + IHelloServiceNoDefaultWrapper* adapt() override { return svc; } private: IHelloServiceNoDefaultWrapper* svc; @@ -233,6 +241,10 @@ public: public: ServiceAdapter(void *_svc) : cSvc{static_cast<do_service_t*>(_svc)} {} virtual ~ServiceAdapter() = default; + + ServiceAdapter(const ServiceAdapter&) = delete; + ServiceAdapter& operator=(const ServiceAdapter&) = delete; + IDoService* adapt() override { return this; } int do_something() override { http://git-wip-us.apache.org/repos/asf/celix/blob/b4ce49f8/libs/framework/include/celix/ServiceAdapter.h ---------------------------------------------------------------------- diff --git a/libs/framework/include/celix/ServiceAdapter.h b/libs/framework/include/celix/ServiceAdapter.h index 7030b7d..dd905e2 100644 --- a/libs/framework/include/celix/ServiceAdapter.h +++ b/libs/framework/include/celix/ServiceAdapter.h @@ -81,6 +81,8 @@ namespace celix { public: DefaultServiceAdapter(I *_svc) : svc{_svc} {} virtual ~DefaultServiceAdapter() = default; + DefaultServiceAdapter(const DefaultServiceAdapter&) = delete; + DefaultServiceAdapter& operator=(const DefaultServiceAdapter&) = delete; I* adapt() override { return svc; } private: I* svc; @@ -113,6 +115,8 @@ namespace celix { public: DefaultServiceAdapter(void *_svc) : svc{static_cast<I*>(_svc)} {} virtual ~DefaultServiceAdapter() = default; + DefaultServiceAdapter(const DefaultServiceAdapter&) = delete; + DefaultServiceAdapter& operator=(const DefaultServiceAdapter&) = delete; I* adapt() override { return svc; } private: I* svc;
