Fix code style (add missing cv qualifiers) 57/59457/4
authorArkadiusz Szulakiewicz <a.szulakiewi@partner.samsung.com>
Mon, 15 Feb 2016 14:31:33 +0000 (15:31 +0100)
committerArkadiusz Szulakiewicz <a.szulakiewi@partner.samsung.com>
Tue, 16 Feb 2016 14:28:21 +0000 (15:28 +0100)
Change-Id: Ia57ad56abc0b0f46f59d124f263698f29c1fb4ce

src/common/plugins/plugins_launcher.cc
src/common/plugins/plugins_launcher.h
src/common/utils/dynamic_lib_handle.cc
src/common/utils/dynamic_lib_handle.h

index 7fd1194..7b69898 100644 (file)
@@ -70,13 +70,15 @@ bool PluginsLauncher::FunctionName(ProcessType process, ActionType action,
   return true;
 }
 
-bool PluginsLauncher::ExecPlugin(DynamicLibHandle& dlh, ProcessType process,
+bool PluginsLauncher::ExecPlugin(const DynamicLibHandle& dlh,
+                                 ProcessType process,
                                  ActionType action, const char* pkgId,
                                  int* result) {
   return ExecPluginImpl(dlh, process, action, result, pkgId);
 }
 
-bool PluginsLauncher::ExecPlugin(DynamicLibHandle& dlh, ProcessType process,
+bool PluginsLauncher::ExecPlugin(const DynamicLibHandle& dlh,
+                                 ProcessType process,
                                  ActionType action, xmlDocPtr docPtr,
                                  const char* pkgId, int* result) {
   return ExecPluginImpl(dlh, process, action, result, docPtr, pkgId);
index 6e06545..7a1ed34 100644 (file)
@@ -32,14 +32,15 @@ class PluginsLauncher {
   bool FunctionName(ProcessType process, ActionType action,
                     std::string* result);
 
-  bool ExecPlugin(DynamicLibHandle& dlh, ProcessType process, ActionType action,
-                  const char* pkgId, int* result);
+  bool ExecPlugin(const DynamicLibHandle& dlh, ProcessType process,
+                  ActionType action, const char* pkgId, int* result);
 
-  bool ExecPlugin(DynamicLibHandle& dlh, ProcessType process, ActionType action,
-                  xmlDocPtr docPtr, const char* pkgId, int* result);
+  bool ExecPlugin(const DynamicLibHandle& dlh, ProcessType process,
+                  ActionType action, xmlDocPtr docPtr,
+                  const char* pkgId, int* result);
 
   template <typename... Args>
-  bool ExecPluginImpl(DynamicLibHandle& dlh, ProcessType process,
+  bool ExecPluginImpl(const DynamicLibHandle& dlh, ProcessType process,
                       ActionType action, int* result, Args&&... args) {
     std::string name;
     if (!FunctionName(process, action, &name)) {
index 2b65db5..6f99fd6 100644 (file)
@@ -24,7 +24,7 @@ bool DynamicLibHandle::Load(const boost::filesystem::path& path, int flags) {
   return true;
 }
 
-void* DynamicLibHandle::GetSymbol(const std::string& name) {
+void* DynamicLibHandle::GetSymbol(const std::string& name) const {
   return dlsym(lib_handle_, name.c_str());
 }
 
index 77c155b..a648aeb 100644 (file)
@@ -21,7 +21,7 @@ class DynamicLibHandle {
   bool Load(const boost::filesystem::path& path, int flags);
 
   template <typename Ret, typename... Args>
-  bool Exec(const std::string& name, Ret* result, Args... args) {
+  bool Exec(const std::string& name, Ret* result, Args... args) const {
     using PluginFunctionPtr = Ret (*)(Args...);
     PluginFunctionPtr function =
         reinterpret_cast<PluginFunctionPtr>(GetSymbol(name));
@@ -45,7 +45,7 @@ class DynamicLibHandle {
   SCOPE_LOG_TAG(DynamicLibHandle)
 
  private:
-  void* GetSymbol(const std::string& name);
+  void* GetSymbol(const std::string& name) const;
   void* lib_handle_;
 };