Commit 6f8dfd03 authored by Pavel Vainerman's avatar Pavel Vainerman

Убрал лишние вызовы std::move() которые препятсвуют исползованию

компилятором оптимизации RVO
parent e201a96a
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
std::string strval( uniset::ObjectId id, bool showLinkName=true ) const; std::string strval( uniset::ObjectId id, bool showLinkName=true ) const;
/*! Вывод состояния внутренних переменных */ /*! Вывод состояния внутренних переменных */
inline std::string dumpVars(){ return std::move(vmon.pretty_str()); } inline std::string dumpVars(){ return vmon.pretty_str(); }
// ------------------------------------------------------------ // ------------------------------------------------------------
std::string help() noexcept; std::string help() noexcept;
...@@ -878,7 +878,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::help() noexcept ...@@ -878,7 +878,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::help() noexcept
s &lt;&lt; " ****************************************************************************************** " &lt;&lt; endl; s &lt;&lt; " ****************************************************************************************** " &lt;&lt; endl;
return std::move(s.str()); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
</xsl:template> </xsl:template>
...@@ -1529,7 +1529,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO() ...@@ -1529,7 +1529,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s &lt;&lt; std::endl; s &lt;&lt; std::endl;
} }
return std::move(s.str()); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, bool showLinkName ) const std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, bool showLinkName ) const
...@@ -1540,7 +1540,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, b ...@@ -1540,7 +1540,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, b
{ {
s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>"; s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>";
if( showLinkName ) s &lt;&lt; "(" &lt;&lt; ORepHelpers::getShortName( uniset_conf()->oind->getMapName(<xsl:value-of select="@name"/>)) &lt;&lt; ")"; if( showLinkName ) s &lt;&lt; "(" &lt;&lt; ORepHelpers::getShortName( uniset_conf()->oind->getMapName(<xsl:value-of select="@name"/>)) &lt;&lt; ")";
return std::move(s.str()); return s.str();
} }
</xsl:for-each> </xsl:for-each>
return ""; return "";
...@@ -1556,7 +1556,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id ...@@ -1556,7 +1556,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id
s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>"; s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>";
if( showLinkName ) s &lt;&lt; "(" &lt;&lt; ORepHelpers::getShortName( uniset_conf()->oind->getMapName(<xsl:value-of select="@name"/>)) &lt;&lt; ")"; if( showLinkName ) s &lt;&lt; "(" &lt;&lt; ORepHelpers::getShortName( uniset_conf()->oind->getMapName(<xsl:value-of select="@name"/>)) &lt;&lt; ")";
s &lt;&lt; "=" &lt;&lt; <xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>; s &lt;&lt; "=" &lt;&lt; <xsl:call-template name="setprefix"/><xsl:value-of select="@name"/>;
return std::move(s.str()); return s.str();
} }
</xsl:for-each> </xsl:for-each>
return ""; return "";
...@@ -1898,7 +1898,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO() ...@@ -1898,7 +1898,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s &lt;&lt; endl; s &lt;&lt; endl;
} }
return std::move(s.str()); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, bool showLinkName ) const std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, bool showLinkName ) const
...@@ -1911,7 +1911,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, b ...@@ -1911,7 +1911,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::str( uniset::ObjectId id, b
{ {
s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>"; s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>";
if( showLinkName ) s &lt;&lt; "(<xsl:value-of select="../../@name"/>)"; if( showLinkName ) s &lt;&lt; "(<xsl:value-of select="../../@name"/>)";
return std::move(s.str()); return s.str();
} }
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
...@@ -1930,7 +1930,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id, ...@@ -1930,7 +1930,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id,
s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>"; s &lt;&lt; "<xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>";
if( showLinkName ) s &lt;&lt; " ( <xsl:value-of select="../../@name"/> )"; if( showLinkName ) s &lt;&lt; " ( <xsl:value-of select="../../@name"/> )";
s &lt;&lt; "=" &lt;&lt; <xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>; s &lt;&lt; "=" &lt;&lt; <xsl:call-template name="setprefix"/><xsl:value-of select="../../@name"/>;
return std::move(s.str()); return s.str();
} }
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
......
...@@ -177,7 +177,7 @@ string MySQLInterface::addslashes( const string& str ) ...@@ -177,7 +177,7 @@ string MySQLInterface::addslashes( const string& str )
tmp << str[i]; tmp << str[i];
} }
return std::move(tmp.str()); return tmp.str();
} }
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
void MySQLInterface::makeResult(DBResult& dbres, MYSQL_RES* myres, bool finalize ) void MySQLInterface::makeResult(DBResult& dbres, MYSQL_RES* myres, bool finalize )
......
...@@ -182,7 +182,7 @@ DBResult PostgreSQLInterface::query( const string& q ) ...@@ -182,7 +182,7 @@ DBResult PostgreSQLInterface::query( const string& q )
result res( n.exec(q) ); result res( n.exec(q) );
DBResult dbres; DBResult dbres;
makeResult(dbres, res); makeResult(dbres, res);
return std::move(dbres); return dbres;
} }
catch( const std::exception& e ) catch( const std::exception& e )
{ {
......
...@@ -412,6 +412,6 @@ std::string MQTTPublisher::MQTTTextInfo::replace( RangeInfo* ri, long value ) ...@@ -412,6 +412,6 @@ std::string MQTTPublisher::MQTTTextInfo::replace( RangeInfo* ri, long value )
txt = replace_all(txt, "%rmax", smax.str()); txt = replace_all(txt, "%rmax", smax.str());
txt = replace_all(txt, "%r", r.str()); txt = replace_all(txt, "%r", r.str());
return std::move(txt); return txt;
} }
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
...@@ -3326,7 +3326,7 @@ namespace uniset ...@@ -3326,7 +3326,7 @@ namespace uniset
<< " type=" << dtype << " type=" << dtype
<< " ask_every_reg=" << ask_every_reg << " ask_every_reg=" << ask_every_reg
<< ")" << endl; << ")" << endl;
return std::move( s.str() ); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
} // end of namespace uniset } // end of namespace uniset
...@@ -758,7 +758,7 @@ const std::string MBTCPMultiMaster::MBSlaveInfo::getShortInfo() const ...@@ -758,7 +758,7 @@ const std::string MBTCPMultiMaster::MBSlaveInfo::getShortInfo() const
<< " persistent-connection=" << !force_disconnect << " persistent-connection=" << !force_disconnect
<< ")"; << ")";
return std::move(s.str()); return s.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
uniset::SimpleInfo* MBTCPMultiMaster::getInfo( const char* userparam ) uniset::SimpleInfo* MBTCPMultiMaster::getInfo( const char* userparam )
......
...@@ -2590,7 +2590,7 @@ namespace uniset ...@@ -2590,7 +2590,7 @@ namespace uniset
s << iaddr << " askCount=" << askCount; s << iaddr << " askCount=" << askCount;
return std::move(s.str()); return s.str();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
uniset::SimpleInfo* MBSlave::getInfo( const char* userparam ) uniset::SimpleInfo* MBSlave::getInfo( const char* userparam )
......
...@@ -948,7 +948,7 @@ const std::string UNetReceiver::getShortInfo() const noexcept ...@@ -948,7 +948,7 @@ const std::string UNetReceiver::getShortInfo() const noexcept
<< endl << endl
<< "\t[ qsize=" << qpack.size() << " recv=" << statRecvPerSec << " update=" << statUpPerSec << " per sec ]"; << "\t[ qsize=" << qpack.size() << " recv=" << statRecvPerSec << " update=" << statUpPerSec << " per sec ]";
return std::move(s.str()); return s.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UNetReceiver::pack_guard::pack_guard( mutex& _m, UNetReceiver::UpdateStrategy _s ): UNetReceiver::pack_guard::pack_guard( mutex& _m, UNetReceiver::UpdateStrategy _s ):
......
...@@ -552,7 +552,7 @@ namespace uniset ...@@ -552,7 +552,7 @@ namespace uniset
} }
} }
return std::move(s.str()); return s.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
} // end of namespace uniset } // end of namespace uniset
...@@ -76,7 +76,7 @@ static UniSetUDP::UDPMessage receive( unsigned int pnum = 0, timeout_t tout = 20 ...@@ -76,7 +76,7 @@ static UniSetUDP::UDPMessage receive( unsigned int pnum = 0, timeout_t tout = 20
ncycle--; ncycle--;
} }
return std::move(pack); return pack;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void send( UniSetUDP::UDPMessage& pack, int tout = 2000 ) void send( UniSetUDP::UDPMessage& pack, int tout = 2000 )
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ. ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// generate timestamp: 2016-12-12+03:00 // generate timestamp: 2016-12-23+03:00
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#ifndef UObject_SK_H_ #ifndef UObject_SK_H_
#define UObject_SK_H_ #define UObject_SK_H_
...@@ -116,7 +116,7 @@ class UObject_SK: ...@@ -116,7 +116,7 @@ class UObject_SK:
std::string strval( uniset::ObjectId id, bool showLinkName=true ) const; std::string strval( uniset::ObjectId id, bool showLinkName=true ) const;
/*! Вывод состояния внутренних переменных */ /*! Вывод состояния внутренних переменных */
inline std::string dumpVars(){ return std::move(vmon.pretty_str()); } inline std::string dumpVars(){ return vmon.pretty_str(); }
// ------------------------------------------------------------ // ------------------------------------------------------------
std::string help() noexcept; std::string help() noexcept;
......
...@@ -840,7 +840,7 @@ namespace uniset ...@@ -840,7 +840,7 @@ namespace uniset
b.ondelay_state = ondelay_state; b.ondelay_state = ondelay_state;
b.offdelay_state = offdelay_state; b.offdelay_state = offdelay_state;
return std::move(b); return b;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void IOBase::create_from_iobase( const IOBase& b ) void IOBase::create_from_iobase( const IOBase& b )
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ. ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// generate timestamp: 2016-12-12+03:00 // generate timestamp: 2016-12-23+03:00
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#include <memory> #include <memory>
#include <iomanip> #include <iomanip>
...@@ -343,7 +343,7 @@ std::string UObject_SK::dumpIO() ...@@ -343,7 +343,7 @@ std::string UObject_SK::dumpIO()
s << std::endl; s << std::endl;
} }
return std::move(s.str()); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
std::string UObject_SK::str( uniset::ObjectId id, bool showLinkName ) const std::string UObject_SK::str( uniset::ObjectId id, bool showLinkName ) const
...@@ -724,7 +724,7 @@ std::string UObject_SK::help() noexcept ...@@ -724,7 +724,7 @@ std::string UObject_SK::help() noexcept
s << " ****************************************************************************************** " << endl; s << " ****************************************************************************************** " << endl;
return std::move(s.str()); return s.str();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
...@@ -54,7 +54,7 @@ string LostTestProc::getMonitInfo() ...@@ -54,7 +54,7 @@ string LostTestProc::getMonitInfo()
{ {
ostringstream inf; ostringstream inf;
inf << "COUNT SENSORS: " << slist.size() << endl; inf << "COUNT SENSORS: " << slist.size() << endl;
return std::move(inf.str()); return inf.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void LostTestProc::timerInfo( const TimerMessage* tm ) void LostTestProc::timerInfo( const TimerMessage* tm )
......
...@@ -122,7 +122,7 @@ static UTypes::ShortIOInfo toUTypes( IOController_i::ShortIOInfo i ) ...@@ -122,7 +122,7 @@ static UTypes::ShortIOInfo toUTypes( IOController_i::ShortIOInfo i )
ret.tv_nsec = i.tv_nsec; ret.tv_nsec = i.tv_nsec;
ret.supplier = i.supplier; ret.supplier = i.supplier;
return std::move(ret); return ret;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
UTypes::ShortIOInfo UConnector::getTimeChange( long id, long node ) UTypes::ShortIOInfo UConnector::getTimeChange( long id, long node )
......
...@@ -103,7 +103,7 @@ namespace uniset ...@@ -103,7 +103,7 @@ namespace uniset
s << "]"; s << "]";
return std::move(s.str()); return s.str();
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
mbErrCode ModbusServer::processing( ModbusMessage& buf ) mbErrCode ModbusServer::processing( ModbusMessage& buf )
...@@ -1511,7 +1511,7 @@ namespace uniset ...@@ -1511,7 +1511,7 @@ namespace uniset
{ {
std::unordered_set<ModbusRTU::ModbusAddr> v; std::unordered_set<ModbusRTU::ModbusAddr> v;
v.emplace(mbaddr); v.emplace(mbaddr);
return std::move(v); return v;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
mbErrCode ModbusServer::receive(const std::unordered_set<ModbusAddr>& vaddr, timeout_t msecTimeout) mbErrCode ModbusServer::receive(const std::unordered_set<ModbusAddr>& vaddr, timeout_t msecTimeout)
...@@ -1658,7 +1658,7 @@ namespace uniset ...@@ -1658,7 +1658,7 @@ namespace uniset
ModbusServer::ExchangeErrorMap ModbusServer::getErrorMap() ModbusServer::ExchangeErrorMap ModbusServer::getErrorMap()
{ {
ExchangeErrorMap m(errmap); ExchangeErrorMap m(errmap);
return std::move(m); return m;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t ModbusServer::getErrCount( mbErrCode e ) size_t ModbusServer::getErrCount( mbErrCode e )
......
...@@ -360,7 +360,7 @@ namespace uniset ...@@ -360,7 +360,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; // szData(); mm.dlen = ind; // szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, ErrorRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, ErrorRetMessage& m )
...@@ -409,7 +409,7 @@ namespace uniset ...@@ -409,7 +409,7 @@ namespace uniset
memcpy(&(mm.data[last]), &crc, szCRC); memcpy(&(mm.data[last]), &crc, szCRC);
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ReadCoilMessage::ReadCoilMessage( const ModbusMessage& m ) ReadCoilMessage::ReadCoilMessage( const ModbusMessage& m )
...@@ -539,7 +539,7 @@ namespace uniset ...@@ -539,7 +539,7 @@ namespace uniset
udata |= 1 << i; udata |= 1 << i;
} }
return std::move(udata); return udata;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
const DataBits16& DataBits16::operator=( const ModbusData& r ) const DataBits16& DataBits16::operator=( const ModbusData& r )
...@@ -677,7 +677,7 @@ namespace uniset ...@@ -677,7 +677,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t ReadCoilRetMessage::szData() const size_t ReadCoilRetMessage::szData() const
...@@ -729,7 +729,7 @@ namespace uniset ...@@ -729,7 +729,7 @@ namespace uniset
memcpy(&(mm.data[last]), &crc, szCRC); memcpy(&(mm.data[last]), &crc, szCRC);
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ReadInputStatusMessage::ReadInputStatusMessage( const ModbusMessage& m ) ReadInputStatusMessage::ReadInputStatusMessage( const ModbusMessage& m )
...@@ -878,7 +878,7 @@ namespace uniset ...@@ -878,7 +878,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t ReadInputStatusRetMessage::szData() const size_t ReadInputStatusRetMessage::szData() const
...@@ -933,7 +933,7 @@ namespace uniset ...@@ -933,7 +933,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ReadOutputMessage::ReadOutputMessage( const ModbusMessage& m ) ReadOutputMessage::ReadOutputMessage( const ModbusMessage& m )
...@@ -1088,7 +1088,7 @@ namespace uniset ...@@ -1088,7 +1088,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t ReadOutputRetMessage::szData() const size_t ReadOutputRetMessage::szData() const
...@@ -1141,7 +1141,7 @@ namespace uniset ...@@ -1141,7 +1141,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ReadInputMessage::ReadInputMessage( const ModbusMessage& m ) ReadInputMessage::ReadInputMessage( const ModbusMessage& m )
...@@ -1301,7 +1301,7 @@ namespace uniset ...@@ -1301,7 +1301,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t ReadInputRetMessage::szData() size_t ReadInputRetMessage::szData()
...@@ -1423,7 +1423,7 @@ namespace uniset ...@@ -1423,7 +1423,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -1583,7 +1583,7 @@ namespace uniset ...@@ -1583,7 +1583,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, ForceCoilsRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, ForceCoilsRetMessage& m )
...@@ -1666,7 +1666,7 @@ namespace uniset ...@@ -1666,7 +1666,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -1842,7 +1842,7 @@ namespace uniset ...@@ -1842,7 +1842,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, WriteOutputRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, WriteOutputRetMessage& m )
...@@ -1876,7 +1876,7 @@ namespace uniset ...@@ -1876,7 +1876,7 @@ namespace uniset
// копируем CRC (последний элемент). Без переворачивания... // копируем CRC (последний элемент). Без переворачивания...
memcpy(&(mm.data[last]), &crc, szCRC); memcpy(&(mm.data[last]), &crc, szCRC);
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
...@@ -2012,7 +2012,7 @@ namespace uniset ...@@ -2012,7 +2012,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, ForceSingleCoilRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, ForceSingleCoilRetMessage& m )
...@@ -2047,7 +2047,7 @@ namespace uniset ...@@ -2047,7 +2047,7 @@ namespace uniset
// копируем CRC (последний элемент). Без переворачивания... // копируем CRC (последний элемент). Без переворачивания...
memcpy(&(mm.data[last]), &crc, szCRC); memcpy(&(mm.data[last]), &crc, szCRC);
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
...@@ -2190,7 +2190,7 @@ namespace uniset ...@@ -2190,7 +2190,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, WriteSingleOutputRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, WriteSingleOutputRetMessage& m )
...@@ -2379,7 +2379,7 @@ namespace uniset ...@@ -2379,7 +2379,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t DiagnosticMessage::szData() const size_t DiagnosticMessage::szData() const
...@@ -2475,7 +2475,7 @@ namespace uniset ...@@ -2475,7 +2475,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -2710,7 +2710,7 @@ namespace uniset ...@@ -2710,7 +2710,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t MEIMessageRetRDI::szData() const size_t MEIMessageRetRDI::szData() const
...@@ -2881,7 +2881,7 @@ namespace uniset ...@@ -2881,7 +2881,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
size_t JournalCommandRetMessage::szData() const size_t JournalCommandRetMessage::szData() const
...@@ -3118,7 +3118,7 @@ namespace uniset ...@@ -3118,7 +3118,7 @@ namespace uniset
memcpy(&(mm.data[bcnt]), &crc, szCRC); memcpy(&(mm.data[bcnt]), &crc, szCRC);
// длина сообщения... // длина сообщения...
mm.dlen = szData(); // bcnt + szCRC mm.dlen = szData(); // bcnt + szCRC
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
SetDateTimeRetMessage::SetDateTimeRetMessage( const ModbusMessage& m ) SetDateTimeRetMessage::SetDateTimeRetMessage( const ModbusMessage& m )
...@@ -3192,7 +3192,7 @@ namespace uniset ...@@ -3192,7 +3192,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); // bcnt + szCRC mm.dlen = szData(); // bcnt + szCRC
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
RemoteServiceMessage::RemoteServiceMessage( const ModbusMessage& m ) RemoteServiceMessage::RemoteServiceMessage( const ModbusMessage& m )
...@@ -3311,7 +3311,7 @@ namespace uniset ...@@ -3311,7 +3311,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ReadFileRecordMessage::ReadFileRecordMessage( const ModbusMessage& m ) ReadFileRecordMessage::ReadFileRecordMessage( const ModbusMessage& m )
...@@ -3415,7 +3415,7 @@ namespace uniset ...@@ -3415,7 +3415,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = szData(); mm.dlen = szData();
return std::move(mm); return mm;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
FileTransferMessage::FileTransferMessage( const ModbusMessage& m ) FileTransferMessage::FileTransferMessage( const ModbusMessage& m )
...@@ -3576,7 +3576,7 @@ namespace uniset ...@@ -3576,7 +3576,7 @@ namespace uniset
// длина сообщения... // длина сообщения...
mm.dlen = ind; mm.dlen = ind;
return std::move(mm); return mm;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
std::ostream& ModbusRTU::operator<<(std::ostream& os, FileTransferRetMessage& m ) std::ostream& ModbusRTU::operator<<(std::ostream& os, FileTransferRetMessage& m )
......
...@@ -249,11 +249,11 @@ namespace uniset ...@@ -249,11 +249,11 @@ namespace uniset
if( pos == string::npos ) if( pos == string::npos )
{ {
vector<string> v{lname, ""}; vector<string> v{lname, ""};
return std::move(v); return v;
} }
vector<string> v = {lname.substr(0, pos), lname.substr(pos + 1, lname.length()) }; vector<string> v = {lname.substr(0, pos), lname.substr(pos + 1, lname.length()) };
return std::move(v); return v;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
bool LogAgregator::logExist( std::shared_ptr<DebugStream>& log ) const bool LogAgregator::logExist( std::shared_ptr<DebugStream>& log ) const
...@@ -326,7 +326,7 @@ namespace uniset ...@@ -326,7 +326,7 @@ namespace uniset
cerr << "(LogAgregator::getLogList): " << ex.what() << std::endl; cerr << "(LogAgregator::getLogList): " << ex.what() << std::endl;
} }
return std::move(l); return l;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::list<LogAgregator::iLog> LogAgregator::getLogList() const std::list<LogAgregator::iLog> LogAgregator::getLogList() const
...@@ -336,7 +336,7 @@ namespace uniset ...@@ -336,7 +336,7 @@ namespace uniset
{ {
return a.name < b.name; return a.name < b.name;
}); });
return std::move(lst); return lst;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::list<LogAgregator::iLog> LogAgregator::makeLogNameList( const std::string& prefix ) const std::list<LogAgregator::iLog> LogAgregator::makeLogNameList( const std::string& prefix ) const
...@@ -363,7 +363,7 @@ namespace uniset ...@@ -363,7 +363,7 @@ namespace uniset
} }
} }
return std::move(lst); return lst;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void LogAgregator::offLogFile( const std::string& logname ) void LogAgregator::offLogFile( const std::string& logname )
......
...@@ -333,7 +333,7 @@ namespace uniset ...@@ -333,7 +333,7 @@ namespace uniset
{ {
ostringstream h; ostringstream h;
h << "--" << prefix << "-cmd-timeout msec - Timeout for wait command. Default: 2000 msec." << endl; h << "--" << prefix << "-cmd-timeout msec - Timeout for wait command. Default: 2000 msec." << endl;
return std::move( h.str() ); return h.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
string LogServer::getShortInfo() string LogServer::getShortInfo()
...@@ -353,7 +353,7 @@ namespace uniset ...@@ -353,7 +353,7 @@ namespace uniset
inf << " " << s->getShortInfo() << endl; inf << " " << s->getShortInfo() << endl;
} }
return std::move(inf.str()); return inf.str();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#ifndef DISABLE_REST_API #ifndef DISABLE_REST_API
...@@ -491,7 +491,7 @@ namespace uniset ...@@ -491,7 +491,7 @@ namespace uniset
s << "=================================" << endl << endl; s << "=================================" << endl << endl;
return std::move(s.str()); return s.str();
} }
return ""; return "";
......
...@@ -41,7 +41,7 @@ string IORFile::getIOR( const ObjectId id ) ...@@ -41,7 +41,7 @@ string IORFile::getIOR( const ObjectId id )
string sior; string sior;
ior_file >> sior; ior_file >> sior;
return std::move(sior); return sior;
} }
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
void IORFile::setIOR( const ObjectId id, const string& sior ) void IORFile::setIOR( const ObjectId id, const string& sior )
...@@ -69,6 +69,6 @@ string IORFile::getFileName( const ObjectId id ) ...@@ -69,6 +69,6 @@ string IORFile::getFileName( const ObjectId id )
{ {
ostringstream fname; ostringstream fname;
fname << uniset_conf()->getLockDir() << id; fname << uniset_conf()->getLockDir() << id;
return std::move( fname.str() ); return fname.str();
} }
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
...@@ -257,7 +257,7 @@ namespace uniset ...@@ -257,7 +257,7 @@ namespace uniset
} }
return std::move(bad); return bad;
} }
// --------------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------------
} }
......
...@@ -212,7 +212,7 @@ bool uniset::file_exist( const std::string& filename ) ...@@ -212,7 +212,7 @@ bool uniset::file_exist( const std::string& filename )
uniset::IDList uniset::explode( const std::string& str, char sep ) uniset::IDList uniset::explode( const std::string& str, char sep )
{ {
uniset::IDList l( explode_str(str, sep) ); uniset::IDList l( explode_str(str, sep) );
return std::move(l); return l;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::vector<std::string> uniset::explode_str( const std::string& str, char sep ) std::vector<std::string> uniset::explode_str( const std::string& str, char sep )
...@@ -256,7 +256,7 @@ std::vector<std::string> uniset::explode_str( const std::string& str, char sep ) ...@@ -256,7 +256,7 @@ std::vector<std::string> uniset::explode_str( const std::string& str, char sep )
} }
while( pos != string::npos ); while( pos != string::npos );
return std::move(v); return v;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
bool uniset::is_digit( const std::string& s ) noexcept bool uniset::is_digit( const std::string& s ) noexcept
...@@ -338,7 +338,7 @@ std::list<uniset::ParamSInfo> uniset::getSInfoList( const string& str, std::shar ...@@ -338,7 +338,7 @@ std::list<uniset::ParamSInfo> uniset::getSInfoList( const string& str, std::shar
res.emplace_back( std::move(item) ); res.emplace_back( std::move(item) );
} }
return std::move(res); return res;
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
std::list<uniset::ConsumerInfo> uniset::getObjectsList( const string& str, std::shared_ptr<Configuration> conf ) std::list<uniset::ConsumerInfo> uniset::getObjectsList( const string& str, std::shared_ptr<Configuration> conf )
...@@ -401,7 +401,7 @@ std::list<uniset::ConsumerInfo> uniset::getObjectsList( const string& str, std:: ...@@ -401,7 +401,7 @@ std::list<uniset::ConsumerInfo> uniset::getObjectsList( const string& str, std::
res.emplace_back( std::move(item) ); res.emplace_back( std::move(item) );
} }
return std::move(res); return res;
} }
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
UniversalIO::IOType uniset::getIOType( const std::string& stype ) noexcept UniversalIO::IOType uniset::getIOType( const std::string& stype ) noexcept
...@@ -571,7 +571,7 @@ std::string uniset::replace_all( const std::string& src, const std::string& from ...@@ -571,7 +571,7 @@ std::string uniset::replace_all( const std::string& src, const std::string& from
string res(src); string res(src);
if( from.empty() ) if( from.empty() )
return std::move(res); return res;
size_t pos = res.find(from, 0); size_t pos = res.find(from, 0);
...@@ -582,7 +582,7 @@ std::string uniset::replace_all( const std::string& src, const std::string& from ...@@ -582,7 +582,7 @@ std::string uniset::replace_all( const std::string& src, const std::string& from
pos = res.find(from, pos); pos = res.find(from, pos);
} }
return std::move(res); return res;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
timeval uniset::to_timeval( const chrono::system_clock::duration& d ) timeval uniset::to_timeval( const chrono::system_clock::duration& d )
...@@ -598,7 +598,7 @@ timeval uniset::to_timeval( const chrono::system_clock::duration& d ) ...@@ -598,7 +598,7 @@ timeval uniset::to_timeval( const chrono::system_clock::duration& d )
tv.tv_usec = std::chrono::duration_cast<std::chrono::microseconds>(d - sec).count(); tv.tv_usec = std::chrono::duration_cast<std::chrono::microseconds>(d - sec).count();
} }
return std::move(tv); return tv;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
timespec uniset::to_timespec( const chrono::system_clock::duration& d ) timespec uniset::to_timespec( const chrono::system_clock::duration& d )
...@@ -614,7 +614,7 @@ timespec uniset::to_timespec( const chrono::system_clock::duration& d ) ...@@ -614,7 +614,7 @@ timespec uniset::to_timespec( const chrono::system_clock::duration& d )
ts.tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d - sec).count(); ts.tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d - sec).count();
} }
return std::move(ts); return ts;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
timespec uniset::now_to_timespec() timespec uniset::now_to_timespec()
......
...@@ -138,6 +138,6 @@ std::string DBServer::help_print() ...@@ -138,6 +138,6 @@ std::string DBServer::help_print()
h << "--prefix-logserver-port num - listen port. Default: ID" << endl; h << "--prefix-logserver-port num - listen port. Default: ID" << endl;
h << LogServer::help_print("prefix-logserver") << endl; h << LogServer::help_print("prefix-logserver") << endl;
return std::move( h.str() ); return h.str();
} }
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
...@@ -331,7 +331,7 @@ namespace uniset ...@@ -331,7 +331,7 @@ namespace uniset
{ {
const string a(omniIt.getProp("arg")); const string a(omniIt.getProp("arg"));
uinfo << "(Configuration): add omniORB option '" << p << "' " << a << endl; uinfo << "(Configuration): add omniORB option '" << p << "' " << a << endl;
omniParams.emplace_back( std::move(std::make_pair(p, a)) ); omniParams.emplace_back( std::make_pair(p, a) );
} }
} }
} }
...@@ -485,7 +485,7 @@ namespace uniset ...@@ -485,7 +485,7 @@ namespace uniset
string s(uniset::getArgParam(name, _argc, _argv, "")); string s(uniset::getArgParam(name, _argc, _argv, ""));
if( !s.empty() ) if( !s.empty() )
return std::move(s); return s;
if( !defval.empty() ) if( !defval.empty() )
return defval; return defval;
...@@ -1010,7 +1010,7 @@ namespace uniset ...@@ -1010,7 +1010,7 @@ namespace uniset
{ {
ostringstream n; ostringstream n;
n << sec << "/" << name; n << sec << "/" << name;
return std::move(n.str()); return n.str();
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void Configuration::initRepSections() void Configuration::initRepSections()
...@@ -1052,7 +1052,7 @@ namespace uniset ...@@ -1052,7 +1052,7 @@ namespace uniset
if( ret.empty() ) if( ret.empty() )
ret = unixml->getProp(secnode, "name"); ret = unixml->getProp(secnode, "name");
return std::move(ret); return ret;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void Configuration::setConfFileName( const string& fn ) void Configuration::setConfFileName( const string& fn )
......
...@@ -155,7 +155,7 @@ LT_Object::TimersList LT_Object::getTimersList() ...@@ -155,7 +155,7 @@ LT_Object::TimersList LT_Object::getTimersList()
{ {
uniset_rwmutex_rlock l(lstMutex); uniset_rwmutex_rlock l(lstMutex);
TimersList lst(tlst); TimersList lst(tlst);
return std::move(lst); return lst;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
string LT_Object::getTimerName(int id) string LT_Object::getTimerName(int id)
......
...@@ -160,7 +160,7 @@ string UniXML::getProp2(const xmlNode* node, const string& name, const string& d ...@@ -160,7 +160,7 @@ string UniXML::getProp2(const xmlNode* node, const string& name, const string& d
string s(getProp(node, name)); string s(getProp(node, name));
if( !s.empty() ) if( !s.empty() )
return std::move(s); return s;
} }
catch(...) {} catch(...) {}
...@@ -182,7 +182,7 @@ string UniXML::getProp(const xmlNode* node, const string& name) noexcept ...@@ -182,7 +182,7 @@ string UniXML::getProp(const xmlNode* node, const string& name) noexcept
// формально при конструировании строки может быть exception // формально при конструировании строки может быть exception
const string t( (const char*)text ); const string t( (const char*)text );
xmlFree( (xmlChar*) text ); xmlFree( (xmlChar*) text );
return std::move(t); return t;
} }
catch(...) {} catch(...) {}
...@@ -214,7 +214,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node ) ...@@ -214,7 +214,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node )
{ {
UniXMLPropList lst; UniXMLPropList lst;
if( !node ) if( !node )
return std::move(lst); return lst;
xmlAttr* attribute = node->properties; xmlAttr* attribute = node->properties;
while( attribute ) while( attribute )
...@@ -227,7 +227,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node ) ...@@ -227,7 +227,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node )
attribute = attribute->next; attribute = attribute->next;
} }
return std::move(lst); return lst;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
xmlNode* UniXML::createChild(xmlNode* node, const string& title, const string& text) xmlNode* UniXML::createChild(xmlNode* node, const string& title, const string& text)
......
...@@ -33,7 +33,7 @@ namespace uniset ...@@ -33,7 +33,7 @@ namespace uniset
{ \ { \
std::ostringstream s; \ std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \ s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return std::move(s.str()); \ return s.str(); \
} \ } \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \ const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \ { \
...@@ -49,7 +49,7 @@ namespace uniset ...@@ -49,7 +49,7 @@ namespace uniset
{ \ { \
std::ostringstream s; \ std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \ s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return std::move(s.str()); \ return s.str(); \
} \ } \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \ const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \ { \
...@@ -69,13 +69,13 @@ namespace uniset ...@@ -69,13 +69,13 @@ namespace uniset
{ \ { \
std::ostringstream s; \ std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \ s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return std::move(s.str()); \ return s.str(); \
} \ } \
const std::string VMonitor::pretty_str( const std::string& name, const unsigned T* v, int nwidth ) \ const std::string VMonitor::pretty_str( const std::string& name, const unsigned T* v, int nwidth ) \
{ \ { \
std::ostringstream s; \ std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \ s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return std::move(s.str()); \ return s.str(); \
} \ } \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \ const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \ { \
...@@ -94,7 +94,7 @@ namespace uniset ...@@ -94,7 +94,7 @@ namespace uniset
{ \ { \
std::ostringstream s; \ std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \ s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return std::move(s.str()); \ return s.str(); \
} \ } \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \ const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \ { \
...@@ -167,7 +167,7 @@ namespace uniset ...@@ -167,7 +167,7 @@ namespace uniset
{ {
std::ostringstream s; std::ostringstream s;
s << (*this); s << (*this);
return std::move(s.str()); return s.str();
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
std::list<std::pair<std::string, std::string> > VMonitor::getList() std::list<std::pair<std::string, std::string> > VMonitor::getList()
...@@ -181,7 +181,7 @@ namespace uniset ...@@ -181,7 +181,7 @@ namespace uniset
VMON_MAKE_PAIR(vlist, float); VMON_MAKE_PAIR(vlist, float);
VMON_MAKE_PAIR(vlist, double); VMON_MAKE_PAIR(vlist, double);
VMON_MAKE_PAIR_S(vlist, string); VMON_MAKE_PAIR_S(vlist, string);
return std::move(vlist); return vlist;
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
std::string VMonitor::pretty_str( int namewidth, int colnum ) std::string VMonitor::pretty_str( int namewidth, int colnum )
...@@ -205,7 +205,7 @@ namespace uniset ...@@ -205,7 +205,7 @@ namespace uniset
os << std::endl; os << std::endl;
} }
return std::move(os.str()); return os.str();
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
} // end of namespace uniset } // end of namespace uniset
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <type_traits> #include <type_traits>
#include <tuple> #include <tuple>
#include "UTCPCore.h" #include "UTCPCore.h"
#include <chrono>
template<typename... Args> template<typename... Args>
class VMon class VMon
...@@ -18,91 +17,81 @@ class VMon ...@@ -18,91 +17,81 @@ class VMon
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
using namespace std; using namespace std;
using namespace uniset; // ------------------------------------------------------------------------------
struct TestClass
class PtrMapHashFn
{ {
public: TestClass()
size_t operator() (const long* const& key) const
{ {
return std::hash<long>()((long)key); cerr << "TEST CLASS CREATE.." << endl;
} }
};
struct struct_t
{
unsigned char hour = { 0 }; /*!< часы [0..23] */
unsigned char min = { 0 }; /*!< минуты [0..59] */
unsigned char sec = { 0 }; /*!< секунды [0..59] */
unsigned char day = { 1 }; /*!< день [1..31] */
unsigned char mon = { 1 }; /*!< месяц [1..12] */
unsigned char year = { 0 }; /*!< год [0..99] */
unsigned char century = { 20 }; /*!<*/
} __attribute__((packed));
int main( int argc, const char** argv )
{
cerr << "2000%1000000=" << int(2000 % 1000000) << endl;
return 0;
unordered_map<const long*, const long*, PtrMapHashFn> vmap; // TestClass( TestClass&& ) = default;
TestClass( const TestClass& t )
const long id = 10; {
long prive_val = 100; cerr << "TEST CLASS COPY.." << endl;
const long& val(prive_val); (*this) = t;
}
vmap.emplace(&id, &val);
auto i = vmap.find(&id);
return 0;
auto now = std::chrono::system_clock::now();
auto sec = std::chrono::time_point_cast<std::chrono::nanoseconds>(now);
auto nsec = std::chrono::time_point_cast<std::chrono::seconds>(now);
cout << "SEC=" << std::chrono::duration<double>(sec.time_since_epoch()).count() TestClass& operator=(const TestClass& t )
<< endl; {
return 0; cerr << "TEST CLASS COPY FUNC.." << endl;
(*this) = t;
return (*this);
}
TestClass& operator=( TestClass&& t ) = default;
std::chrono::time_point<std::chrono::system_clock> p1, p2, p3; TestClass( TestClass&& t )
{
cerr << "TEST CLASS MOVE.." << endl;
(*this) = std::move(t);
}
p2 = std::chrono::system_clock::now(); size_t len = { 10 };
p3 = p2 - std::chrono::hours(24); int data[10];
};
std::time_t epoch_time = std::chrono::system_clock::to_time_t(p1); struct MClass
std::cout << "epoch: " << std::ctime(&epoch_time); {
std::time_t today_time = std::chrono::system_clock::to_time_t(p2); MClass( int d1, int d2 = 0 )
std::cout << "today: " << std::ctime(&today_time); {
data[0] = d1;
data[1] = d2;
}
std::cout << "hours since epoch: " size_t len = { 2 };
<< std::chrono::duration_cast<std::chrono::hours>( int data[2];
p2.time_since_epoch()).count()
<< '\n';
std::cout << "yesterday, hours since epoch: "
<< std::chrono::duration_cast<std::chrono::hours>(
p3.time_since_epoch()).count()
<< '\n';
return 0; TestClass get()
unsigned char dat[] = { '1', '2', '3' , '4' }; {
TestClass m;
m.len = len;
memcpy(data, &m.data, sizeof(data));
//return std::move(m);
return m;
}
};
// UTCPCore::Buffer* buf = new UTCPCore::Buffer( dat, 0 ); void test_func( TestClass& m )
UTCPCore::Buffer* buf = new UTCPCore::Buffer( dat, 3 ); {
cerr << "func.." << endl;
}
// if( buf->nbytes() == 0 ) void test_func( TestClass&& m )
// delete buf; {
cout << "buf: " << buf->dpos() << endl; cerr << "move func.." << endl;
}
// ------------------------------------------------------------------------------
delete buf; int main( int argc, const char** argv )
{
MClass m(10, 11);
// VMon<int,double,char> vmon; TestClass c = m.get();
// cout << std::get<0>(vmon.m_tuple).size() << endl; test_func(c);
test_func( std::move(c) );
return 0; return 0;
} }
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