1+ /* *********************************************************************************
2+ * Copyright (c) 2020-2025 Evgenii Sopov <mrseakg@gmail.com>
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5+ * of this software and associated documentation files (the "Software"), to deal
6+ * in the Software without restriction, including without limitation the rights
7+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+ * copies of the Software, and to permit persons to whom the Software is
9+ * furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in all
12+ * copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+ * SOFTWARE.
21+ *
22+ ***********************************************************************************/
23+
124#include " wsjcpp_employees.h"
225#include < algorithm>
326#include < iostream>
427#include < wsjcpp_core.h>
528
6- // ---------------------------------------------------------------------
7-
829std::map<std::string, WsjcppEmployBase *> *g_pWsjcppEmployees = nullptr ;
930std::vector<std::string> *g_pWsjcppInitEmployees = nullptr ;
1031std::vector<std::string> *g_pWsjcppInitWith = nullptr ;
1132
12- // ---------------------------------------------------------------------
13-
1433void WsjcppEmployees::initGlobalVariables () {
1534 if (g_pWsjcppEmployees == nullptr ) {
1635 // WsjcppLog::info(std::string(), "Create employees map");
@@ -26,8 +45,6 @@ void WsjcppEmployees::initGlobalVariables() {
2645 }
2746}
2847
29- // ---------------------------------------------------------------------
30-
3148void WsjcppEmployees::deinitGlobalVariables () {
3249 const std::string TAG = " WsjcppEmployees::deinit" ;
3350 if (g_pWsjcppEmployees != nullptr ) {
@@ -56,8 +73,6 @@ void WsjcppEmployees::deinitGlobalVariables() {
5673 }
5774}
5875
59- // ---------------------------------------------------------------------
60-
6176void WsjcppEmployees::addEmploy (const std::string &sName , WsjcppEmployBase *pEmploy) {
6277 WsjcppEmployees::initGlobalVariables ();
6378 if (g_pWsjcppEmployees->find (sName ) != g_pWsjcppEmployees->end ()) {
@@ -68,8 +83,6 @@ void WsjcppEmployees::addEmploy(const std::string &sName, WsjcppEmployBase *pEmp
6883 }
6984}
7085
71- // ---------------------------------------------------------------------
72-
7386bool WsjcppEmployees::init (const std::vector<std::string> &vStart, bool bSilent) {
7487 WsjcppEmployees::initGlobalVariables ();
7588 std::string TAG = " WsjcppEmployees::init" ;
@@ -161,8 +174,6 @@ bool WsjcppEmployees::deinit(bool bSilent) {
161174 return true ;
162175}
163176
164- // ---------------------------------------------------------------------
165-
166177void WsjcppEmployees::recoursiveTestDependencies (const std::vector<std::string> &vNames) {
167178 std::vector<std::string> v = vNames;
168179 std::string sEmployName = v[v.size () - 1 ];
@@ -208,31 +219,23 @@ WsjcppEmployBase::WsjcppEmployBase(const std::vector<std::string> &vNames, const
208219 WsjcppEmployees::recoursiveTestDependencies (m_vNames);
209220}
210221
211- // ---------------------------------------------------------------------
212-
213222WsjcppEmployBase::~WsjcppEmployBase () {
214223 // nothing
215224}
216225
217- // ---------------------------------------------------------------------
218-
219226const std::vector<std::string> &WsjcppEmployBase::loadAfter () { return m_vLoadAfter; }
220227
221228// ---------------------------------------------------------------------
222229// WsjcppEmployRuntimeGlobalCache
223230
224231REGISTRY_WJSCPP_SERVICE_LOCATOR (WsjcppEmployRuntimeGlobalCache)
225232
226- // ---------------------------------------------------------------------
227-
228233WsjcppEmployRuntimeGlobalCache::WsjcppEmployRuntimeGlobalCache()
229234 : WsjcppEmployBase({WsjcppEmployRuntimeGlobalCache::name ()}, {}) {
230235
231236 TAG = WsjcppEmployRuntimeGlobalCache::name ();
232237}
233238
234- // ---------------------------------------------------------------------
235-
236239bool WsjcppEmployRuntimeGlobalCache::init (const std::string &sName , bool bSilent) {
237240 // checking settings
238241 if (!bSilent) {
@@ -241,8 +244,6 @@ bool WsjcppEmployRuntimeGlobalCache::init(const std::string &sName, bool bSilent
241244 return true ;
242245}
243246
244- // ---------------------------------------------------------------------
245-
246247bool WsjcppEmployRuntimeGlobalCache::deinit (const std::string &sName , bool bSilent) {
247248 // checking settings
248249 if (!bSilent) {
@@ -252,25 +253,17 @@ bool WsjcppEmployRuntimeGlobalCache::deinit(const std::string &sName, bool bSile
252253 return true ;
253254}
254255
255- // ---------------------------------------------------------------------
256-
257256void WsjcppEmployRuntimeGlobalCache::set (const std::string &sName , const std::string &sValue ) {
258257 m_sStringMap[sName ] = sValue ;
259258}
260259
261- // ---------------------------------------------------------------------
262-
263260bool WsjcppEmployRuntimeGlobalCache::has (const std::string &sName ) {
264261 return m_sStringMap.find (sName ) != m_sStringMap.end ();
265262}
266263
267- // ---------------------------------------------------------------------
268-
269264std::string WsjcppEmployRuntimeGlobalCache::get (const std::string &sName ) {
270265 if (m_sStringMap.find (sName ) != m_sStringMap.end ()) {
271266 return m_sStringMap[sName ];
272267 }
273268 return " " ;
274269}
275-
276- // ---------------------------------------------------------------------
0 commit comments