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
// ------------------------------------------------------------------------------------------
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 )
return ⁢
......@@ -2409,7 +2409,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
ostringstream sl;
sl << "[ ";
for( auto& i : ri->slst )
for( const auto& i : ri->slst )
sl << ORepHelpers::getShortName(conf->oind->getMapName(i.si.id)) << ",";
sl << "]";
......@@ -2960,12 +2960,12 @@ void MBExchange::sensorInfo( const UniSetTypes::SensorMessage* sm )
if( force_out )
continue;
for( auto& it : d->regmap )
for( const auto& it : d->regmap )
{
if( !isWriteFunction(it.second->mbfunc) )
continue;
for( auto& i : it.second->slst )
for( auto&& i : it.second->slst )
{
if( sm->id == i.si.id && sm->node == i.si.node )
{
......
......@@ -412,7 +412,7 @@ void MBTCPMultiMaster::initIterators()
{
MBExchange::initIterators();
for( auto& it : mblist )
for( auto&& it : mblist )
shm->initIterator(it.respond_it);
}
// -----------------------------------------------------------------------------
......
......@@ -10,9 +10,10 @@
--mbtcp-filter-value 5 \
--mbtcp-recv-timeout 7000 \
--mbtcp-timeout 2000 \
--mbtcp-polltime 5000 \
--mbtcp-polltime 2000 \
--mbtcp-force-out 1 \
--mbtcp-log-add-levels any \
--mbtcp-persistent-connection 1 \
$*
#--mbtcp-exchange-mode-id MB1_Mode_AS \
......
......@@ -559,7 +559,7 @@ void MBSlave::execute_rtu()
}
}
for( auto& it : iomap )
for( auto&& it : iomap )
IOBase::processingThreshold(&it.second, shm, force);
}
catch(...) {}
......@@ -645,7 +645,7 @@ void MBSlave::execute_tcp()
}
}
for( auto& it : iomap )
for( auto&& it : iomap )
IOBase::processingThreshold(&it.second, shm, force);
}
catch( const std::exception& ex )
......@@ -759,9 +759,9 @@ void MBSlave::askSensors( UniversalIO::UIOCommand cmd )
if( force )
return;
for( auto& it : iomap )
for( const auto& it : iomap )
{
IOProperty* p(&it.second);
const IOProperty* p(&it.second);
try
{
......@@ -1147,7 +1147,7 @@ int MBSlave::getOptimizeWriteFunction( const int fn )
// ------------------------------------------------------------------------------------------
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 )
return true;
......@@ -1267,7 +1267,7 @@ std::ostream& operator<<( std::ostream& os, MBSlave::BitRegProperty& p )
{
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 << "]";
......
......@@ -289,7 +289,7 @@ bool SharedMemory::activateObject()
itPulsar = myioEnd();
for( auto& it : hist )
for( auto&& it : hist )
{
for( auto && hit : it.hlst )
hit.ioit = myioEnd();
......@@ -331,7 +331,7 @@ void SharedMemory::checkHeartBeat()
bool wdtpingOK = true;
for( auto& it : hlist )
for( auto&& it : hlist )
{
try
{
......@@ -378,7 +378,7 @@ void SharedMemory::checkHeartBeat()
// ------------------------------------------------------------------------------------------
bool SharedMemory::readItem( const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec )
{
for( auto& r : lstRSlot )
for( auto&& r : lstRSlot )
{
try
{
......@@ -666,7 +666,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
// -----------------------------------------------------------------------------
void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
{
for( auto& it : hist )
for( auto&& it : hist )
{
if( xit.getProp(it.filter).empty() )
continue;
......@@ -701,9 +701,9 @@ void SharedMemory::saveHistory()
if( hist.empty() )
return;
for( auto& it : hist )
for( auto&& it : hist )
{
for( auto& hit : it.hlst )
for( auto&& hit : it.hlst )
{
try
{
......@@ -743,7 +743,7 @@ void SharedMemory::updateHistory( std::shared_ptr<USensorInfo>& s_it, IOControll
<< " value=" << value
<< endl;
for( auto& it1 : i->second )
for( auto&& it1 : i->second )
{
History::iterator it = it1;
......
......@@ -430,7 +430,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po
{
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 )
return true;
......@@ -441,7 +441,7 @@ bool UNetExchange::checkExistUNetHost( const std::string& addr, ost::tpport_t po
// -----------------------------------------------------------------------------
void UNetExchange::startReceivers()
{
for( auto& it : recvlist )
for( const auto& it : recvlist )
{
if( it.r1 )
it.r1->start();
......@@ -701,7 +701,7 @@ void UNetExchange::sigterm( int signo )
unetinfo << myname << ": ********* SIGTERM(" << signo << ") ********" << endl;
activated = false;
for( auto& it : recvlist )
for( const auto& it : recvlist )
{
try
{
......@@ -745,7 +745,7 @@ void UNetExchange::initIterators()
if( sender2 )
sender2->initIterators();
for( auto& it : recvlist )
for( auto&& it : recvlist )
it.initIterators(shm);
}
// -----------------------------------------------------------------------------
......@@ -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 )
{
for( auto& it : recvlist )
for( auto&& it : recvlist )
{
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