From: Maxim Mamontov Date: Sun, 28 Sep 2014 15:37:30 +0000 (+0300) Subject: Better names for service iterators. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/e7987df1fe4b07d5b8240acc98968400be12b757 Better names for service iterators. --- diff --git a/projects/stargazer/services_impl.cpp b/projects/stargazer/services_impl.cpp index ea231615..ac856000 100644 --- a/projects/stargazer/services_impl.cpp +++ b/projects/stargazer/services_impl.cpp @@ -54,7 +54,7 @@ if (!priv->serviceChg) return -1; } -srv_iter si(find(data.begin(), data.end(), service)); +iterator si(find(data.begin(), data.end(), service)); if (si != data.end()) { @@ -92,7 +92,7 @@ if (!priv->serviceChg) return -1; } -srv_iter si(find(data.begin(), data.end(), SERVICE_CONF(name))); +iterator si(find(data.begin(), data.end(), SERVICE_CONF(name))); if (si == data.end()) { @@ -101,7 +101,7 @@ if (si == data.end()) return -1; } -std::map::iterator csi; +std::map::iterator csi; csi = searchDescriptors.begin(); while (csi != searchDescriptors.end()) { @@ -136,7 +136,7 @@ if (!priv->serviceChg) return -1; } -srv_iter si(find(data.begin(), data.end(), service)); +iterator si(find(data.begin(), data.end(), service)); if (si == data.end()) { @@ -192,7 +192,7 @@ STG_LOCKER lock(&mutex); if (data.empty()) return false; -const_srv_iter si(find(data.begin(), data.end(), SERVICE_CONF(name))); +const_iterator si(find(data.begin(), data.end(), SERVICE_CONF(name))); if (si != data.end()) { @@ -212,7 +212,7 @@ if (data.empty()) return true; } -const_srv_iter si(find(data.begin(), data.end(), SERVICE_CONF(name))); +const_iterator si(find(data.begin(), data.end(), SERVICE_CONF(name))); if (si != data.end()) return true; diff --git a/projects/stargazer/services_impl.h b/projects/stargazer/services_impl.h index 254df8a1..0415183c 100644 --- a/projects/stargazer/services_impl.h +++ b/projects/stargazer/services_impl.h @@ -58,15 +58,15 @@ private: SERVICES_IMPL(const SERVICES_IMPL & rvalue); SERVICES_IMPL & operator=(const SERVICES_IMPL & rvalue); - typedef std::list::iterator srv_iter; - typedef std::list::const_iterator const_srv_iter; + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; bool Read(); std::list data; STORE * store; STG_LOGGER & WriteServLog; - mutable std::map searchDescriptors; + mutable std::map searchDescriptors; mutable unsigned int handle; mutable pthread_mutex_t mutex; std::string strError;