Commit a680352b authored by Pavel Vainerman's avatar Pavel Vainerman

Небольшие правки: auto& --> auto&&

parent b4e99c49
...@@ -2086,7 +2086,7 @@ MBExchange::RegInfo* MBExchange::addReg( RegMap& mp, ModbusRTU::RegID id, Modbus ...@@ -2086,7 +2086,7 @@ MBExchange::RegInfo* MBExchange::addReg( RegMap& mp, ModbusRTU::RegID id, Modbus
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
MBExchange::RSProperty* MBExchange::addProp( PList& plist, RSProperty&& p ) MBExchange::RSProperty* MBExchange::addProp( PList& plist, RSProperty&& p )
{ {
for( auto& it : plist ) for( auto&& it : plist )
{ {
if( it.si.id == p.si.id && it.si.node == p.si.node ) if( it.si.id == p.si.id && it.si.node == p.si.node )
return ⁢ return ⁢
...@@ -2409,7 +2409,7 @@ bool MBExchange::initItem( UniXML::iterator& it ) ...@@ -2409,7 +2409,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
ostringstream sl; ostringstream sl;
sl << "[ "; sl << "[ ";
for( auto& i : ri->slst ) for( const auto& i : ri->slst )
sl << ORepHelpers::getShortName(conf->oind->getMapName(i.si.id)) << ","; sl << ORepHelpers::getShortName(conf->oind->getMapName(i.si.id)) << ",";
sl << "]"; sl << "]";
...@@ -2960,12 +2960,12 @@ void MBExchange::sensorInfo( const UniSetTypes::SensorMessage* sm ) ...@@ -2960,12 +2960,12 @@ void MBExchange::sensorInfo( const UniSetTypes::SensorMessage* sm )
if( force_out ) if( force_out )
continue; continue;
for( auto& it : d->regmap ) for( const auto& it : d->regmap )
{ {
if( !isWriteFunction(it.second->mbfunc) ) if( !isWriteFunction(it.second->mbfunc) )
continue; continue;
for( auto& i : it.second->slst ) for( auto&& i : it.second->slst )
{ {
if( sm->id == i.si.id && sm->node == i.si.node ) if( sm->id == i.si.id && sm->node == i.si.node )
{ {
......
...@@ -412,7 +412,7 @@ void MBTCPMultiMaster::initIterators() ...@@ -412,7 +412,7 @@ void MBTCPMultiMaster::initIterators()
{ {
MBExchange::initIterators(); MBExchange::initIterators();
for( auto& it : mblist ) for( auto&& it : mblist )
shm->initIterator(it.respond_it); shm->initIterator(it.respond_it);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
--mbtcp-filter-value 5 \ --mbtcp-filter-value 5 \
--mbtcp-recv-timeout 7000 \ --mbtcp-recv-timeout 7000 \
--mbtcp-timeout 2000 \ --mbtcp-timeout 2000 \
--mbtcp-polltime 5000 \ --mbtcp-polltime 2000 \
--mbtcp-force-out 1 \ --mbtcp-force-out 1 \
--mbtcp-log-add-levels any \ --mbtcp-log-add-levels any \
--mbtcp-persistent-connection 1 \
$* $*
#--mbtcp-exchange-mode-id MB1_Mode_AS \ #--mbtcp-exchange-mode-id MB1_Mode_AS \
......
...@@ -559,7 +559,7 @@ void MBSlave::execute_rtu() ...@@ -559,7 +559,7 @@ void MBSlave::execute_rtu()
} }
} }
for( auto& it : iomap ) for( auto&& it : iomap )
IOBase::processingThreshold(&it.second, shm, force); IOBase::processingThreshold(&it.second, shm, force);
} }
catch(...) {} catch(...) {}
...@@ -645,7 +645,7 @@ void MBSlave::execute_tcp() ...@@ -645,7 +645,7 @@ void MBSlave::execute_tcp()
} }
} }
for( auto& it : iomap ) for( auto&& it : iomap )
IOBase::processingThreshold(&it.second, shm, force); IOBase::processingThreshold(&it.second, shm, force);
} }
catch( const std::exception& ex ) catch( const std::exception& ex )
...@@ -759,9 +759,9 @@ void MBSlave::askSensors( UniversalIO::UIOCommand cmd ) ...@@ -759,9 +759,9 @@ void MBSlave::askSensors( UniversalIO::UIOCommand cmd )
if( force ) if( force )
return; return;
for( auto& it : iomap ) for( const auto& it : iomap )
{ {
IOProperty* p(&it.second); const IOProperty* p(&it.second);
try try
{ {
...@@ -1147,7 +1147,7 @@ int MBSlave::getOptimizeWriteFunction( const int fn ) ...@@ -1147,7 +1147,7 @@ int MBSlave::getOptimizeWriteFunction( const int fn )
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool MBSlave::BitRegProperty::check( const IOController_i::SensorInfo& si ) bool MBSlave::BitRegProperty::check( const IOController_i::SensorInfo& si )
{ {
for( auto& i : bvec ) for( const auto& i : bvec )
{ {
if( i.si.id == si.id && i.si.node == si.node ) if( i.si.id == si.id && i.si.node == si.node )
return true; return true;
...@@ -1267,7 +1267,7 @@ std::ostream& operator<<( std::ostream& os, MBSlave::BitRegProperty& p ) ...@@ -1267,7 +1267,7 @@ std::ostream& operator<<( std::ostream& os, MBSlave::BitRegProperty& p )
{ {
os << " reg=" << ModbusRTU::dat2str(p.mbreg) << "(" << (int)p.mbreg << ")[ "; os << " reg=" << ModbusRTU::dat2str(p.mbreg) << "(" << (int)p.mbreg << ")[ ";
for( auto& i : p.bvec ) for( const auto& i : p.bvec )
os << "'" << i.si.id << "' "; os << "'" << i.si.id << "' ";
os << "]"; os << "]";
......
...@@ -289,7 +289,7 @@ bool SharedMemory::activateObject() ...@@ -289,7 +289,7 @@ bool SharedMemory::activateObject()
itPulsar = myioEnd(); itPulsar = myioEnd();
for( auto& it : hist ) for( auto&& it : hist )
{ {
for( auto && hit : it.hlst ) for( auto && hit : it.hlst )
hit.ioit = myioEnd(); hit.ioit = myioEnd();
...@@ -331,7 +331,7 @@ void SharedMemory::checkHeartBeat() ...@@ -331,7 +331,7 @@ void SharedMemory::checkHeartBeat()
bool wdtpingOK = true; bool wdtpingOK = true;
for( auto& it : hlist ) for( auto&& it : hlist )
{ {
try try
{ {
...@@ -378,7 +378,7 @@ void SharedMemory::checkHeartBeat() ...@@ -378,7 +378,7 @@ void SharedMemory::checkHeartBeat()
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool SharedMemory::readItem( const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec ) bool SharedMemory::readItem( const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec )
{ {
for( auto& r : lstRSlot ) for( auto&& r : lstRSlot )
{ {
try try
{ {
...@@ -666,7 +666,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode ) ...@@ -666,7 +666,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void SharedMemory::checkHistoryFilter( UniXML::iterator& xit ) void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
{ {
for( auto& it : hist ) for( auto&& it : hist )
{ {
if( xit.getProp(it.filter).empty() ) if( xit.getProp(it.filter).empty() )
continue; continue;
...@@ -701,9 +701,9 @@ void SharedMemory::saveHistory() ...@@ -701,9 +701,9 @@ void SharedMemory::saveHistory()
if( hist.empty() ) if( hist.empty() )
return; return;
for( auto& it : hist ) for( auto&& it : hist )
{ {
for( auto& hit : it.hlst ) for( auto&& hit : it.hlst )
{ {
try try
{ {
...@@ -743,7 +743,7 @@ void SharedMemory::updateHistory( std::shared_ptr<USensorInfo>& s_it, IOControll ...@@ -743,7 +743,7 @@ void SharedMemory::updateHistory( std::shared_ptr<USensorInfo>& s_it, IOControll
<< " value=" << value << " value=" << value
<< endl; << endl;
for( auto& it1 : i->second ) for( auto&& it1 : i->second )
{ {
History::iterator it = it1; History::iterator it = it1;
......
...@@ -430,7 +430,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po ...@@ -430,7 +430,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po
{ {
ost::IPV4Address a1(addr.c_str()); ost::IPV4Address a1(addr.c_str());
for( auto& it : recvlist ) for( const auto& it : recvlist )
{ {
if( it.r1->getAddress() == a1.getAddress() && it.r1->getPort() == port ) if( it.r1->getAddress() == a1.getAddress() && it.r1->getPort() == port )
return true; return true;
...@@ -441,7 +441,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po ...@@ -441,7 +441,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetExchange::startReceivers() void UNetExchange::startReceivers()
{ {
for( auto& it : recvlist ) for( const auto& it : recvlist )
{ {
if( it.r1 ) if( it.r1 )
it.r1->start(); it.r1->start();
...@@ -701,7 +701,7 @@ void UNetExchange::sigterm( int signo ) ...@@ -701,7 +701,7 @@ void UNetExchange::sigterm( int signo )
unetinfo << myname << ": ********* SIGTERM(" << signo << ") ********" << endl; unetinfo << myname << ": ********* SIGTERM(" << signo << ") ********" << endl;
activated = false; activated = false;
for( auto& it : recvlist ) for( const auto& it : recvlist )
{ {
try try
{ {
...@@ -745,7 +745,7 @@ void UNetExchange::initIterators() ...@@ -745,7 +745,7 @@ void UNetExchange::initIterators()
if( sender2 ) if( sender2 )
sender2->initIterators(); sender2->initIterators();
for( auto& it : recvlist ) for( auto&& it : recvlist )
it.initIterators(shm); it.initIterators(shm);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -814,7 +814,7 @@ std::shared_ptr<UNetExchange> UNetExchange::init_unetexchange( int argc, const c ...@@ -814,7 +814,7 @@ std::shared_ptr<UNetExchange> UNetExchange::init_unetexchange( int argc, const c
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetExchange::receiverEvent( const shared_ptr<UNetReceiver>& r, UNetReceiver::Event ev ) void UNetExchange::receiverEvent( const shared_ptr<UNetReceiver>& r, UNetReceiver::Event ev )
{ {
for( auto& it : recvlist ) for( auto&& it : recvlist )
{ {
if( it.r1 == r ) if( it.r1 == r )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment