[ekiga] Service: The getter should be a const method.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Service: The getter should be a const method.
- Date: Tue, 6 Jan 2015 17:26:52 +0000 (UTC)
commit 1c6c162b9d620b255161094ebd768d3fc5c3e906
Author: Damien Sandras <dsandras seconix com>
Date: Tue Jan 6 18:24:53 2015 +0100
Service: The getter should be a const method.
lib/engine/framework/services.cpp | 4 ++--
lib/engine/framework/services.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/framework/services.cpp b/lib/engine/framework/services.cpp
index f56b5a0..426fbfd 100644
--- a/lib/engine/framework/services.cpp
+++ b/lib/engine/framework/services.cpp
@@ -158,11 +158,11 @@ Ekiga::ServiceCore::close ()
}
Ekiga::ServicePtr
-Ekiga::ServiceCore::get (const std::string name)
+Ekiga::ServiceCore::get (const std::string name) const
{
ServicePtr result;
- for (services_type::iterator iter = services.begin ();
+ for (services_type::const_iterator iter = services.begin ();
iter != services.end () && !result;
iter++)
if (name == (*iter)->get_name ()) {
diff --git a/lib/engine/framework/services.h b/lib/engine/framework/services.h
index 9fbf167..72399cb 100644
--- a/lib/engine/framework/services.h
+++ b/lib/engine/framework/services.h
@@ -95,10 +95,10 @@ namespace Ekiga
bool add (ServicePtr service);
- ServicePtr get (const std::string name);
+ ServicePtr get (const std::string name) const;
template<typename T>
- boost::shared_ptr<T> get (const std::string name)
+ boost::shared_ptr<T> get (const std::string name) const
{ return boost::dynamic_pointer_cast<T> (get (name)); }
void close ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]