Skip to content

Commit ef91c25

Browse files
committed
Remove using namespace std/boost
1 parent dd2f1e6 commit ef91c25

File tree

268 files changed

+1362
-1637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+1362
-1637
lines changed

libs/attribute/src/ecflow/attribute/DateAttr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "ecflow/core/Extract.hpp"
2121
#include "ecflow/core/Serialization.hpp"
2222

23-
using namespace std;
2423
using namespace ecf;
2524

2625
//==========================================================================================

libs/attribute/src/ecflow/attribute/DayAttr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "ecflow/core/Serialization.hpp"
2121
#include "ecflow/core/cereal_boost_time.hpp"
2222

23-
using namespace std;
2423
using namespace ecf;
2524

2625
// #define DEBUG_DAYS 1

libs/attribute/src/ecflow/attribute/GenericAttr.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "ecflow/core/Str.hpp"
1717

1818
using namespace ecf;
19-
using namespace boost;
20-
using namespace std;
2119

2220
const GenericAttr& GenericAttr::EMPTY() {
2321
static const GenericAttr GENERICATTR = GenericAttr();
@@ -27,14 +25,14 @@ const GenericAttr& GenericAttr::EMPTY() {
2725
GenericAttr::GenericAttr(const std::string& name, const std::vector<std::string>& values)
2826
: name_(name),
2927
values_(values) {
30-
string msg;
28+
std::string msg;
3129
if (!Str::valid_name(name, msg)) {
3230
throw std::runtime_error("GenericAttr::GenericAttr : Invalid generic name : " + msg);
3331
}
3432
}
3533

3634
GenericAttr::GenericAttr(const std::string& name) : name_(name) {
37-
string msg;
35+
std::string msg;
3836
if (!Str::valid_name(name, msg)) {
3937
throw std::runtime_error("GenericAttr::GenericAttr : Invalid generic name : " + msg);
4038
}

libs/attribute/src/ecflow/attribute/LateAttr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include "ecflow/core/Str.hpp"
2020
#include "ecflow/core/TimeSeries.hpp"
2121

22-
using namespace std;
23-
2422
namespace ecf {
2523

2624
LateAttr::LateAttr() = default;

libs/attribute/src/ecflow/attribute/NodeAttr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "ecflow/core/Serialization.hpp"
1919
#include "ecflow/core/Str.hpp"
2020

21-
using namespace std;
2221
using namespace ecf;
2322

2423
const std::string& Event::SET() {
@@ -50,7 +49,7 @@ Event::Event(int number, const std::string& eventName, bool iv, bool check_name)
5049
v_(iv),
5150
iv_(iv) {
5251
if (!eventName.empty() && check_name) {
53-
string msg;
52+
std::string msg;
5453
if (!Str::valid_name(eventName, msg)) {
5554
throw std::runtime_error("Event::Event: Invalid event name : " + msg);
5655
}
@@ -83,7 +82,7 @@ Event::Event(const std::string& eventName, bool iv) : n_(eventName), v_(iv), iv_
8382
}
8483
}
8584

86-
string msg;
85+
std::string msg;
8786
if (!Str::valid_name(eventName, msg)) {
8887
throw std::runtime_error("Event::Event: Invalid event name : " + msg);
8988
}

libs/attribute/src/ecflow/attribute/QueueAttr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "ecflow/core/Serialization.hpp"
1818
#include "ecflow/core/Str.hpp"
1919

20-
using namespace std;
2120
using namespace ecf;
2221

2322
/////////////////////////////////////////////////////////////////////////////////////////////
@@ -34,7 +33,7 @@ QueueAttr& QueueAttr::EMPTY1() {
3433
QueueAttr::QueueAttr(const std::string& name, const std::vector<std::string>& theQueue)
3534
: theQueue_(theQueue),
3635
name_(name) {
37-
string msg;
36+
std::string msg;
3837
if (!Str::valid_name(name, msg)) {
3938
throw std::runtime_error("QueueAttr::QueueAttr: Invalid queue name : " + msg);
4039
}
@@ -279,7 +278,7 @@ void QueueAttr::set_state_vec(const std::vector<NState::State>& state_vec) {
279278
}
280279

281280
void QueueAttr::set_name(const std::string& name) {
282-
string msg;
281+
std::string msg;
283282
if (!Str::valid_name(name, msg)) {
284283
throw std::runtime_error("QueueAttr::set_name: Invalid queue name : " + msg);
285284
}

libs/attribute/src/ecflow/attribute/RepeatAttr.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "ecflow/core/Str.hpp"
2222
#include "ecflow/node/formatter/DefsWriter.hpp"
2323

24-
using namespace std;
2524
using namespace ecf;
2625

2726
const Repeat& Repeat::EMPTY() {
@@ -350,7 +349,7 @@ std::string RepeatDate::valueAsString() const {
350349
catch (const ecf::bad_conversion&) {
351350
LOG_ASSERT(false, "RepeatDate::valueAsString(): could not convert value " << value_ << " to a string");
352351
}
353-
return string();
352+
return std::string();
354353
}
355354

356355
std::string RepeatDate::value_as_string(int index) const {
@@ -360,7 +359,7 @@ std::string RepeatDate::value_as_string(int index) const {
360359
}
361360
catch (const ecf::bad_conversion&) {
362361
}
363-
return string();
362+
return std::string();
364363
}
365364

366365
std::string RepeatDate::next_value_as_string() const {
@@ -372,7 +371,7 @@ std::string RepeatDate::next_value_as_string() const {
372371
}
373372
catch (const ecf::bad_conversion&) {
374373
}
375-
return string();
374+
return std::string();
376375
}
377376

378377
std::string RepeatDate::prev_value_as_string() const {
@@ -384,7 +383,7 @@ std::string RepeatDate::prev_value_as_string() const {
384383
}
385384
catch (const ecf::bad_conversion&) {
386385
}
387-
return string();
386+
return std::string();
388387
}
389388

390389
void RepeatDate::increment() {
@@ -988,7 +987,7 @@ std::string RepeatDateList::valueAsString() const {
988987

989988
std::string RepeatDateList::value_as_string(int index) const {
990989
if (list_.empty()) {
991-
return string("0");
990+
return std::string("0");
992991
}
993992
if (index >= 0 && index < static_cast<int>(list_.size())) {
994993
return ecf::convert_to<std::string>(list_[index]);
@@ -1004,7 +1003,7 @@ std::string RepeatDateList::value_as_string(int index) const {
10041003

10051004
std::string RepeatDateList::next_value_as_string() const {
10061005
if (list_.empty()) {
1007-
return string("0");
1006+
return std::string("0");
10081007
}
10091008

10101009
int index = currentIndex_;
@@ -1014,7 +1013,7 @@ std::string RepeatDateList::next_value_as_string() const {
10141013

10151014
std::string RepeatDateList::prev_value_as_string() const {
10161015
if (list_.empty()) {
1017-
return string("0");
1016+
return std::string("0");
10181017
}
10191018

10201019
int index = currentIndex_;
@@ -1276,7 +1275,7 @@ std::string RepeatInteger::valueAsString() const {
12761275
catch (const ecf::bad_conversion&) {
12771276
LOG_ASSERT(false, "");
12781277
}
1279-
return string();
1278+
return std::string();
12801279
}
12811280

12821281
std::string RepeatInteger::value_as_string(int index) const {
@@ -1286,7 +1285,7 @@ std::string RepeatInteger::value_as_string(int index) const {
12861285
}
12871286
catch (const ecf::bad_conversion&) {
12881287
}
1289-
return string();
1288+
return std::string();
12901289
}
12911290

12921291
std::string RepeatInteger::next_value_as_string() const {
@@ -1297,7 +1296,7 @@ std::string RepeatInteger::next_value_as_string() const {
12971296
}
12981297
catch (const ecf::bad_conversion&) {
12991298
}
1300-
return string();
1299+
return std::string();
13011300
}
13021301

13031302
std::string RepeatInteger::prev_value_as_string() const {
@@ -1308,7 +1307,7 @@ std::string RepeatInteger::prev_value_as_string() const {
13081307
}
13091308
catch (const ecf::bad_conversion&) {
13101309
}
1311-
return string();
1310+
return std::string();
13121311
}
13131312

13141313
//======================================================================================
@@ -1428,7 +1427,7 @@ std::string RepeatEnumerated::value_as_string(int index) const {
14281427

14291428
std::string RepeatEnumerated::next_value_as_string() const {
14301429
if (theEnums_.empty()) {
1431-
return string();
1430+
return std::string();
14321431
}
14331432

14341433
int index = currentIndex_;
@@ -1444,7 +1443,7 @@ std::string RepeatEnumerated::next_value_as_string() const {
14441443

14451444
std::string RepeatEnumerated::prev_value_as_string() const {
14461445
if (theEnums_.empty()) {
1447-
return string();
1446+
return std::string();
14481447
}
14491448

14501449
int index = currentIndex_;
@@ -1597,7 +1596,7 @@ std::string RepeatString::next_value_as_string() const {
15971596
}
15981597
return theStrings_[index];
15991598
}
1600-
return string();
1599+
return std::string();
16011600
}
16021601

16031602
std::string RepeatString::prev_value_as_string() const {
@@ -1612,7 +1611,7 @@ std::string RepeatString::prev_value_as_string() const {
16121611
}
16131612
return theStrings_[index];
16141613
}
1615-
return string();
1614+
return std::string();
16161615
}
16171616

16181617
void RepeatString::increment() {

libs/attribute/src/ecflow/attribute/TodayAttr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "ecflow/core/Serialization.hpp"
2121
#include "ecflow/core/Str.hpp"
2222

23-
using namespace std;
24-
2523
namespace ecf {
2624

2725
TodayAttr::TodayAttr(const std::string& str) {

libs/attribute/src/ecflow/attribute/Variable.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "ecflow/core/Serialization.hpp"
1717
#include "ecflow/core/Str.hpp"
1818

19-
using namespace std;
2019
using namespace ecf;
2120

2221
// init static's

libs/attribute/src/ecflow/attribute/Zombie.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "ecflow/core/Serialization.hpp"
1616

1717
using namespace ecf;
18-
using namespace std;
1918

2019
// support return by reference
2120
const Zombie& Zombie::EMPTY() {
@@ -273,17 +272,17 @@ std::string Zombie::pretty_print(const std::vector<Zombie>& zombies, int indent)
273272
}
274273

275274
void Zombie::pretty_print(const std::vector<Zombie>& zombies, std::vector<std::string>& list, int indent) {
276-
string path("task-path");
277-
string type("type");
278-
string password("password");
279-
string rid("pid");
280-
string duration("age(s)");
281-
string calls("calls");
282-
string try_no("try_no");
283-
string user_action("action");
284-
string child_type("child");
285-
string host("host");
286-
string explanation("explanation");
275+
std::string path("task-path");
276+
std::string type("type");
277+
std::string password("password");
278+
std::string rid("pid");
279+
std::string duration("age(s)");
280+
std::string calls("calls");
281+
std::string try_no("try_no");
282+
std::string user_action("action");
283+
std::string child_type("child");
284+
std::string host("host");
285+
std::string explanation("explanation");
287286

288287
size_t path_width = path.size();
289288
size_t type_width = type.size();
@@ -353,11 +352,12 @@ void Zombie::pretty_print(const std::vector<Zombie>& zombies, std::vector<std::s
353352
ss << " ";
354353
}
355354
}
356-
ss << left << setw(path_width) << path << " " << setw(type_width) << type << " " << setw(duration_width)
357-
<< duration << " " << setw(password_width) << password << " " << setw(rid_width) << rid << " "
358-
<< setw(tryno_width) << try_no << " " << setw(user_action_width) << user_action << " "
359-
<< setw(child_type_width) << child_type << " " << setw(calls_width) << calls << " " << setw(host_width)
360-
<< host << " " << setw(explanation_width) << explanation;
355+
ss << std::left << std::setw(path_width) << path << " " << std::setw(type_width) << type << " "
356+
<< std::setw(duration_width) << duration << " " << std::setw(password_width) << password << " "
357+
<< std::setw(rid_width) << rid << " " << std::setw(tryno_width) << try_no << " "
358+
<< std::setw(user_action_width) << user_action << " " << std::setw(child_type_width) << child_type << " "
359+
<< std::setw(calls_width) << calls << " " << std::setw(host_width) << host << " "
360+
<< std::setw(explanation_width) << explanation;
361361
list.push_back(ss.str());
362362
}
363363

@@ -394,12 +394,12 @@ void Zombie::pretty_print(const std::vector<Zombie>& zombies, std::vector<std::s
394394
break;
395395
}
396396

397-
ss << left << setw(path_width) << z.path_to_task() << " " << setw(type_width) << z.type_str() << " "
398-
<< setw(duration_width) << z.duration() << " " << setw(password_width) << z.jobs_password() << " "
399-
<< setw(rid_width) << z.process_or_remote_id() << " " << setw(tryno_width) << z.try_no() << " "
400-
<< setw(user_action_width) << z.user_action_str() << " " << setw(child_type_width)
401-
<< Child::to_string(z.last_child_cmd()) << " " << setw(calls_width) << z.calls() << " " << setw(host_width)
402-
<< z.host() << " " << setw(explanation_width) << exp;
397+
ss << std::left << std::setw(path_width) << z.path_to_task() << " " << std::setw(type_width) << z.type_str()
398+
<< " " << std::setw(duration_width) << z.duration() << " " << std::setw(password_width) << z.jobs_password()
399+
<< " " << std::setw(rid_width) << z.process_or_remote_id() << " " << std::setw(tryno_width) << z.try_no()
400+
<< " " << std::setw(user_action_width) << z.user_action_str() << " " << std::setw(child_type_width)
401+
<< Child::to_string(z.last_child_cmd()) << " " << std::setw(calls_width) << z.calls() << " "
402+
<< std::setw(host_width) << z.host() << " " << std::setw(explanation_width) << exp;
403403
list.push_back(ss.str());
404404
}
405405
}

0 commit comments

Comments
 (0)