Skip to content

Commit ccf6d3b

Browse files
committed
Remove HAS_RANGE_BASE_FOR
We now require C++11. Done with unifdef -DHAS_RANGE_BASE_FOR
1 parent dd5232a commit ccf6d3b

File tree

6 files changed

+0
-105
lines changed

6 files changed

+0
-105
lines changed

cpp_test_suite/new_tests/conf_devtest.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,10 @@ int main(int argc, char **argv) {
6363

6464
try {
6565
db->add_server(str, db_dev_infos);
66-
#ifdef HAS_RANGE_BASE_FOR
6766
for(auto info : db_dev_infos){
6867
cout << "Added test server : " << str << " -> " << info.name << ", class : " <<
6968
info._class << std::endl;
7069
}
71-
#else
72-
for(size_t i = 0; i < db_dev_infos.size(); i++){
73-
cout << "Added test server : " << str << " -> " << db_dev_infos[i].name
74-
<< ", class : " << db_dev_infos[i]._class << std::endl;
75-
}
76-
#endif
7770
cout << std::endl;
7871
}
7972
catch (...) {
@@ -92,17 +85,10 @@ int main(int argc, char **argv) {
9285

9386
try {
9487
db->add_server(str, db_dev_infos);
95-
#ifdef HAS_RANGE_BASE_FOR
9688
for(auto info : db_dev_infos){
9789
cout << "Added test server : " << str << " -> " << info.name << ", class : " <<
9890
info._class << std::endl;
9991
}
100-
#else
101-
for(size_t i = 0; i < db_dev_infos.size(); i++){
102-
cout << "Added test server : " << str << " -> " << db_dev_infos[i].name
103-
<< ", class : " << db_dev_infos[i]._class << std::endl;
104-
}
105-
#endif
10692
cout << std::endl;
10793
}
10894
catch (...) {
@@ -118,17 +104,10 @@ int main(int argc, char **argv) {
118104
db_dev_infos.push_back(fwdTestInfo);
119105
try {
120106
db->add_server(str, db_dev_infos);
121-
#ifdef HAS_RANGE_BASE_FOR
122107
for(auto info : db_dev_infos){
123108
cout << "Added test server : " << str << " -> " << info.name << ", class : " <<
124109
info._class << std::endl;
125110
}
126-
#else
127-
for(size_t i = 0; i < db_dev_infos.size(); i++){
128-
cout << "Added test server : " << str << " -> " << db_dev_infos[i].name
129-
<< ", class : " << db_dev_infos[i]._class << std::endl;
130-
}
131-
#endif
132111
cout << std::endl;
133112
}
134113
catch (...) {

cppapi/client/devapi_base.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10146,7 +10146,6 @@ int DeviceProxy::get_tango_lib_version()
1014610146
bool ecs = false;
1014710147
bool zesc = false;
1014810148

10149-
#ifdef HAS_RANGE_BASE_FOR
1015010149
for (const auto &cmd : *cmd_list)
1015110150
{
1015210151
if (cmd.cmd_name == "EventConfirmSubscription")
@@ -10160,22 +10159,6 @@ int DeviceProxy::get_tango_lib_version()
1016010159
zesc = true;
1016110160
}
1016210161
}
10163-
#else
10164-
std::vector<CommandInfo>::iterator pos, pos_end;
10165-
for (pos = (*cmd_list).begin(), pos_end = (*cmd_list).end(); pos != pos_end; ++pos)
10166-
{
10167-
if (pos->cmd_name == "EventConfirmSubscription")
10168-
{
10169-
ecs = true;
10170-
break;
10171-
}
10172-
10173-
if (pos->cmd_name == "ZmqEventSubscriptionChange")
10174-
{
10175-
zesc = true;
10176-
}
10177-
}
10178-
#endif
1017910162
if (ecs == true)
1018010163
{
1018110164
ret = 810;

cppapi/client/zmqeventconsumer.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,6 @@ void ZmqEventConsumer::connect_event_channel(std::string &channel_name,TANGO_UNU
12421242

12431243
std::string prefix = channel_name.substr(0,channel_name.find('/',8) + 1);
12441244
bool found = false;
1245-
#ifdef HAS_RANGE_BASE_FOR
12461245
for (const auto &elem:env_var_fqdn_prefix)
12471246
{
12481247
if (elem == prefix)
@@ -1251,17 +1250,6 @@ void ZmqEventConsumer::connect_event_channel(std::string &channel_name,TANGO_UNU
12511250
break;
12521251
}
12531252
}
1254-
#else
1255-
std::vector<std::string>::iterator ite;
1256-
for (ite = env_var_fqdn_prefix.begin();ite != env_var_fqdn_prefix.end();++ite)
1257-
{
1258-
if (*ite == prefix)
1259-
{
1260-
found = true;
1261-
break;
1262-
}
1263-
}
1264-
#endif
12651253

12661254
if (found == false && db != NULL)
12671255
{

cppapi/server/dserver.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ void DServer::init_device()
482482

483483
void DServer::server_init_hook()
484484
{
485-
#ifdef HAS_RANGE_BASE_FOR
486485
for (DeviceClass *dclass : this->get_class_list())
487486
{
488487
for (DeviceImpl *device : dclass->get_device_list())
@@ -505,34 +504,6 @@ void DServer::server_init_hook()
505504
}
506505
}
507506
}
508-
#else
509-
std::vector<DeviceClass*> &dclass_vector = this->get_class_list();
510-
std::vector<DeviceClass*>::iterator dclass_vector_pos, dclass_vector_end;
511-
for (dclass_vector_pos = dclass_vector.begin(), dclass_vector_end = dclass_vector.end(); dclass_vector_pos != dclass_vector_end; ++dclass_vector_pos)
512-
{
513-
std::vector<DeviceImpl*> &device_vector = (*dclass_vector_pos)->get_device_list();
514-
std::vector<DeviceImpl*>::iterator device_vector_pos, device_vector_end;
515-
for (device_vector_pos = device_vector.begin(), device_vector_end = device_vector.end(); device_vector_pos != device_vector_end; ++device_vector_pos)
516-
{
517-
DeviceImpl *device = *device_vector_pos;
518-
cout4 << "Device " << device->get_name_lower() << " executes init_server_hook" << std::endl;
519-
try
520-
{
521-
device->server_init_hook();
522-
}
523-
catch(const DevFailed& devFailed){
524-
device->set_state(FAULT);
525-
526-
std::ostringstream ss;
527-
ss << "Device[" << device->get_name_lower() << "] server_init_hook has failed due to DevFailed:"
528-
<< std::endl;
529-
ss << devFailed;
530-
531-
device->set_status(ss.str());
532-
}
533-
}
534-
}
535-
#endif
536507
}
537508

538509
//+----------------------------------------------------------------------------------------------------------------

cppapi/server/dserverpoll.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,8 @@ Tango::DevVarStringArray *DServer::dev_poll_status(std::string &dev_name)
246246

247247
if (i == nb_poll_obj - 1)
248248
{
249-
#ifdef HAS_RANGE_BASE_FOR
250249
for (auto &elem:root_dev_poll_status)
251250
delete elem.second;
252-
#else
253-
std::map<std::string,std::vector<std::string> *>::iterator pos;
254-
for (pos = root_dev_poll_status.begin();pos != root_dev_poll_status.end();++pos)
255-
delete pos->second;
256-
#endif
257251
}
258252

259253
//

cppapi/server/rootattreg.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -847,18 +847,10 @@ void RootAttRegistry::remove_root_att(std::string &root_dev_name,std::string &ro
847847

848848
if (it != map_event_id_user.end())
849849
{
850-
#ifdef HAS_RANGE_BASE_FOR
851850
for (const auto &elem:it->second)
852851
{
853852
pos->second->unsubscribe_event(elem.event_id);
854853
}
855-
#else
856-
std::vector<UserEvent>::iterator posi;
857-
for (posi = it->second.begin();posi != it->second.end();++posi)
858-
{
859-
pos->second->unsubscribe_event(posi->event_id);
860-
}
861-
#endif
862854
map_event_id_user.erase(it);
863855
}
864856
}
@@ -1075,7 +1067,6 @@ bool RootAttRegistry::is_event_subscribed(std::string &ev,EventType et)
10751067
pos = map_event_id_user.find(ev);
10761068
if (pos != map_event_id_user.end())
10771069
{
1078-
#ifdef HAS_RANGE_BASE_FOR
10791070
for (const auto &elem:pos->second)
10801071
{
10811072
if (elem.event_type == et)
@@ -1084,17 +1075,6 @@ bool RootAttRegistry::is_event_subscribed(std::string &ev,EventType et)
10841075
break;
10851076
}
10861077
}
1087-
#else
1088-
std::vector<UserEvent>::iterator posi;
1089-
for (posi = pos->second.begin();posi != pos->second.end();++posi)
1090-
{
1091-
if (posi->event_type == et)
1092-
{
1093-
ret = true;
1094-
break;
1095-
}
1096-
}
1097-
#endif
10981078
}
10991079
}
11001080

0 commit comments

Comments
 (0)