Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
6f8dfd03
Commit
6f8dfd03
authored
Dec 23, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Убрал лишние вызовы std::move() которые препятсвуют исползованию
компилятором оптимизации RVO
parent
e201a96a
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
157 additions
and
168 deletions
+157
-168
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+8
-8
MySQLInterface.cc
extensions/DBServer-MySQL/MySQLInterface.cc
+1
-1
PostgreSQLInterface.cc
extensions/DBServer-PostgreSQL/PostgreSQLInterface.cc
+1
-1
MQTTPublisher.cc
extensions/MQTTPublisher/MQTTPublisher.cc
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+1
-1
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+1
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+1
-1
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+1
-1
UNetSender.cc
extensions/UNetUDP/UNetSender.cc
+1
-1
test_unetudp.cc
extensions/UNetUDP/tests/test_unetudp.cc
+1
-1
UObject_SK.h
extensions/include/UObject_SK.h
+2
-2
IOBase.cc
extensions/lib/IOBase.cc
+1
-1
UObject_SK.cc
extensions/lib/UObject_SK.cc
+3
-3
LostTestProc.cc
extensions/tests/SMemoryTest/LostTestProc.cc
+1
-1
UConnector.cc
python/lib/pyUniSet/UConnector.cc
+1
-1
ModbusServer.cc
src/Communications/Modbus/ModbusServer.cc
+3
-3
ModbusTypes.cc
src/Communications/Modbus/ModbusTypes.cc
+27
-27
LogAgregator.cc
src/Log/LogAgregator.cc
+5
-5
LogServer.cc
src/Log/LogServer.cc
+3
-3
IORFile.cc
src/ObjectRepository/IORFile.cc
+2
-2
ORepHelpers.cc
src/ObjectRepository/ORepHelpers.cc
+1
-1
UniSetTypes.cc
src/ObjectRepository/UniSetTypes.cc
+8
-8
DBServer.cc
src/Services/DBServer.cc
+1
-1
Configuration.cc
src/Various/Configuration.cc
+4
-4
LT_Object.cc
src/Various/LT_Object.cc
+1
-1
UniXML.cc
src/Various/UniXML.cc
+4
-4
VMonitor.cc
src/Various/VMonitor.cc
+8
-8
develop.cc
tests/develop.cc
+65
-76
No files found.
Utilities/codegen/ctl-cpp-common.xsl
View file @
6f8dfd03
...
...
@@ -250,7 +250,7 @@
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;
...
...
@@ -878,7 +878,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::help() noexcept
s
<<
" ****************************************************************************************** "
<<
endl;
return s
td::move(s.str()
);
return s
.str(
);
}
// ----------------------------------------------------------------------------
</xsl:template>
...
...
@@ -1529,7 +1529,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s
<<
std::endl;
}
return s
td::move(s.str()
);
return s
.str(
);
}
// ----------------------------------------------------------------------------
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
{
s
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
";
if( showLinkName ) s
<<
"("
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
")";
return s
td::move(s.str()
);
return s
.str(
);
}
</xsl:for-each>
return "";
...
...
@@ -1556,7 +1556,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id
s
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
";
if( showLinkName ) s
<<
"("
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
")";
s
<<
"="
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
return s
td::move(s.str()
);
return s
.str(
);
}
</xsl:for-each>
return "";
...
...
@@ -1898,7 +1898,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s
<<
endl;
}
return s
td::move(s.str()
);
return s
.str(
);
}
// ----------------------------------------------------------------------------
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
{
s
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"../../@name"
/>
";
if( showLinkName ) s
<<
"(
<xsl:value-of
select=
"../../@name"
/>
)";
return s
td::move(s.str()
);
return s
.str(
);
}
</xsl:if>
</xsl:if>
...
...
@@ -1930,7 +1930,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::strval( uniset::ObjectId id,
s
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"../../@name"
/>
";
if( showLinkName ) s
<<
" (
<xsl:value-of
select=
"../../@name"
/>
)";
s
<<
"="
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"../../@name"
/>
;
return s
td::move(s.str()
);
return s
.str(
);
}
</xsl:if>
</xsl:if>
...
...
extensions/DBServer-MySQL/MySQLInterface.cc
View file @
6f8dfd03
...
...
@@ -177,7 +177,7 @@ string MySQLInterface::addslashes( const string& str )
tmp
<<
str
[
i
];
}
return
std
::
move
(
tmp
.
str
()
);
return
tmp
.
str
(
);
}
// -----------------------------------------------------------------------------------------
void
MySQLInterface
::
makeResult
(
DBResult
&
dbres
,
MYSQL_RES
*
myres
,
bool
finalize
)
...
...
extensions/DBServer-PostgreSQL/PostgreSQLInterface.cc
View file @
6f8dfd03
...
...
@@ -182,7 +182,7 @@ DBResult PostgreSQLInterface::query( const string& q )
result
res
(
n
.
exec
(
q
)
);
DBResult
dbres
;
makeResult
(
dbres
,
res
);
return
std
::
move
(
dbres
)
;
return
dbres
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
extensions/MQTTPublisher/MQTTPublisher.cc
View file @
6f8dfd03
...
...
@@ -412,6 +412,6 @@ std::string MQTTPublisher::MQTTTextInfo::replace( RangeInfo* ri, long value )
txt
=
replace_all
(
txt
,
"%rmax"
,
smax
.
str
());
txt
=
replace_all
(
txt
,
"%r"
,
r
.
str
());
return
std
::
move
(
txt
)
;
return
txt
;
}
//--------------------------------------------------------------------------------
extensions/ModbusMaster/MBExchange.cc
View file @
6f8dfd03
...
...
@@ -3326,7 +3326,7 @@ namespace uniset
<<
" type="
<<
dtype
<<
" ask_every_reg="
<<
ask_every_reg
<<
")"
<<
endl
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// ----------------------------------------------------------------------------
}
// end of namespace uniset
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
6f8dfd03
...
...
@@ -758,7 +758,7 @@ const std::string MBTCPMultiMaster::MBSlaveInfo::getShortInfo() const
<<
" persistent-connection="
<<
!
force_disconnect
<<
")"
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// -----------------------------------------------------------------------------
uniset
::
SimpleInfo
*
MBTCPMultiMaster
::
getInfo
(
const
char
*
userparam
)
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
6f8dfd03
...
...
@@ -2590,7 +2590,7 @@ namespace uniset
s
<<
iaddr
<<
" askCount="
<<
askCount
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// -------------------------------------------------------------------------
uniset
::
SimpleInfo
*
MBSlave
::
getInfo
(
const
char
*
userparam
)
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
6f8dfd03
...
...
@@ -948,7 +948,7 @@ const std::string UNetReceiver::getShortInfo() const noexcept
<<
endl
<<
"
\t
[ qsize="
<<
qpack
.
size
()
<<
" recv="
<<
statRecvPerSec
<<
" update="
<<
statUpPerSec
<<
" per sec ]"
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// -----------------------------------------------------------------------------
UNetReceiver
::
pack_guard
::
pack_guard
(
mutex
&
_m
,
UNetReceiver
::
UpdateStrategy
_s
)
:
...
...
extensions/UNetUDP/UNetSender.cc
View file @
6f8dfd03
...
...
@@ -552,7 +552,7 @@ namespace uniset
}
}
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// -----------------------------------------------------------------------------
}
// end of namespace uniset
extensions/UNetUDP/tests/test_unetudp.cc
View file @
6f8dfd03
...
...
@@ -76,7 +76,7 @@ static UniSetUDP::UDPMessage receive( unsigned int pnum = 0, timeout_t tout = 20
ncycle
--
;
}
return
std
::
move
(
pack
)
;
return
pack
;
}
// -----------------------------------------------------------------------------
void
send
(
UniSetUDP
::
UDPMessage
&
pack
,
int
tout
=
2000
)
...
...
extensions/include/UObject_SK.h
View file @
6f8dfd03
...
...
@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2016-12-
12
+03:00
// generate timestamp: 2016-12-
23
+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
...
...
@@ -116,7 +116,7 @@ class UObject_SK:
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
;
...
...
extensions/lib/IOBase.cc
View file @
6f8dfd03
...
...
@@ -840,7 +840,7 @@ namespace uniset
b
.
ondelay_state
=
ondelay_state
;
b
.
offdelay_state
=
offdelay_state
;
return
std
::
move
(
b
)
;
return
b
;
}
// ------------------------------------------------------------------------------------------
void
IOBase
::
create_from_iobase
(
const
IOBase
&
b
)
...
...
extensions/lib/UObject_SK.cc
View file @
6f8dfd03
...
...
@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2016-12-
12
+03:00
// generate timestamp: 2016-12-
23
+03:00
// -----------------------------------------------------------------------------
#include <memory>
#include <iomanip>
...
...
@@ -343,7 +343,7 @@ std::string UObject_SK::dumpIO()
s
<<
std
::
endl
;
}
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// ----------------------------------------------------------------------------
std
::
string
UObject_SK
::
str
(
uniset
::
ObjectId
id
,
bool
showLinkName
)
const
...
...
@@ -724,7 +724,7 @@ std::string UObject_SK::help() noexcept
s
<<
" ****************************************************************************************** "
<<
endl
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// ----------------------------------------------------------------------------
...
...
extensions/tests/SMemoryTest/LostTestProc.cc
View file @
6f8dfd03
...
...
@@ -54,7 +54,7 @@ string LostTestProc::getMonitInfo()
{
ostringstream
inf
;
inf
<<
"COUNT SENSORS: "
<<
slist
.
size
()
<<
endl
;
return
std
::
move
(
inf
.
str
()
);
return
inf
.
str
(
);
}
// -----------------------------------------------------------------------------
void
LostTestProc
::
timerInfo
(
const
TimerMessage
*
tm
)
...
...
python/lib/pyUniSet/UConnector.cc
View file @
6f8dfd03
...
...
@@ -122,7 +122,7 @@ static UTypes::ShortIOInfo toUTypes( IOController_i::ShortIOInfo i )
ret
.
tv_nsec
=
i
.
tv_nsec
;
ret
.
supplier
=
i
.
supplier
;
return
std
::
move
(
ret
)
;
return
ret
;
}
//---------------------------------------------------------------------------
UTypes
::
ShortIOInfo
UConnector
::
getTimeChange
(
long
id
,
long
node
)
...
...
src/Communications/Modbus/ModbusServer.cc
View file @
6f8dfd03
...
...
@@ -103,7 +103,7 @@ namespace uniset
s
<<
"]"
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// --------------------------------------------------------------------------------
mbErrCode
ModbusServer
::
processing
(
ModbusMessage
&
buf
)
...
...
@@ -1511,7 +1511,7 @@ namespace uniset
{
std
::
unordered_set
<
ModbusRTU
::
ModbusAddr
>
v
;
v
.
emplace
(
mbaddr
);
return
std
::
move
(
v
)
;
return
v
;
}
// -------------------------------------------------------------------------
mbErrCode
ModbusServer
::
receive
(
const
std
::
unordered_set
<
ModbusAddr
>&
vaddr
,
timeout_t
msecTimeout
)
...
...
@@ -1658,7 +1658,7 @@ namespace uniset
ModbusServer
::
ExchangeErrorMap
ModbusServer
::
getErrorMap
()
{
ExchangeErrorMap
m
(
errmap
);
return
std
::
move
(
m
)
;
return
m
;
}
// -------------------------------------------------------------------------
size_t
ModbusServer
::
getErrCount
(
mbErrCode
e
)
...
...
src/Communications/Modbus/ModbusTypes.cc
View file @
6f8dfd03
...
...
@@ -360,7 +360,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
// szData();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
ErrorRetMessage
&
m
)
...
...
@@ -409,7 +409,7 @@ namespace uniset
memcpy
(
&
(
mm
.
data
[
last
]),
&
crc
,
szCRC
);
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
ReadCoilMessage
::
ReadCoilMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -539,7 +539,7 @@ namespace uniset
udata
|=
1
<<
i
;
}
return
std
::
move
(
udata
)
;
return
udata
;
}
// -------------------------------------------------------------------------
const
DataBits16
&
DataBits16
::
operator
=
(
const
ModbusData
&
r
)
...
...
@@ -677,7 +677,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
ReadCoilRetMessage
::
szData
()
const
...
...
@@ -729,7 +729,7 @@ namespace uniset
memcpy
(
&
(
mm
.
data
[
last
]),
&
crc
,
szCRC
);
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
ReadInputStatusMessage
::
ReadInputStatusMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -878,7 +878,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
ReadInputStatusRetMessage
::
szData
()
const
...
...
@@ -933,7 +933,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
ReadOutputMessage
::
ReadOutputMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -1088,7 +1088,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
ReadOutputRetMessage
::
szData
()
const
...
...
@@ -1141,7 +1141,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
ReadInputMessage
::
ReadInputMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -1301,7 +1301,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
ReadInputRetMessage
::
szData
()
...
...
@@ -1423,7 +1423,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
...
...
@@ -1583,7 +1583,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
ForceCoilsRetMessage
&
m
)
...
...
@@ -1666,7 +1666,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
...
...
@@ -1842,7 +1842,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
WriteOutputRetMessage
&
m
)
...
...
@@ -1876,7 +1876,7 @@ namespace uniset
// копируем CRC (последний элемент). Без переворачивания...
memcpy
(
&
(
mm
.
data
[
last
]),
&
crc
,
szCRC
);
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// --------------------------------------------------------------------------------
...
...
@@ -2012,7 +2012,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
ForceSingleCoilRetMessage
&
m
)
...
...
@@ -2047,7 +2047,7 @@ namespace uniset
// копируем CRC (последний элемент). Без переворачивания...
memcpy
(
&
(
mm
.
data
[
last
]),
&
crc
,
szCRC
);
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// --------------------------------------------------------------------------------
...
...
@@ -2190,7 +2190,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
WriteSingleOutputRetMessage
&
m
)
...
...
@@ -2379,7 +2379,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
DiagnosticMessage
::
szData
()
const
...
...
@@ -2475,7 +2475,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
...
...
@@ -2710,7 +2710,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
MEIMessageRetRDI
::
szData
()
const
...
...
@@ -2881,7 +2881,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
size_t
JournalCommandRetMessage
::
szData
()
const
...
...
@@ -3118,7 +3118,7 @@ namespace uniset
memcpy
(
&
(
mm
.
data
[
bcnt
]),
&
crc
,
szCRC
);
// длина сообщения...
mm
.
dlen
=
szData
();
// bcnt + szCRC
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
SetDateTimeRetMessage
::
SetDateTimeRetMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -3192,7 +3192,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
// bcnt + szCRC
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
RemoteServiceMessage
::
RemoteServiceMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -3311,7 +3311,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
ReadFileRecordMessage
::
ReadFileRecordMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -3415,7 +3415,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
szData
();
return
std
::
move
(
mm
)
;
return
mm
;
}
// -------------------------------------------------------------------------
FileTransferMessage
::
FileTransferMessage
(
const
ModbusMessage
&
m
)
...
...
@@ -3576,7 +3576,7 @@ namespace uniset
// длина сообщения...
mm
.
dlen
=
ind
;
return
std
::
move
(
mm
)
;
return
mm
;
}
// -----------------------------------------------------------------------
std
::
ostream
&
ModbusRTU
::
operator
<<
(
std
::
ostream
&
os
,
FileTransferRetMessage
&
m
)
...
...
src/Log/LogAgregator.cc
View file @
6f8dfd03
...
...
@@ -249,11 +249,11 @@ namespace uniset
if
(
pos
==
string
::
npos
)
{
vector
<
string
>
v
{
lname
,
""
};
return
std
::
move
(
v
)
;
return
v
;
}
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
...
...
@@ -326,7 +326,7 @@ namespace uniset
cerr
<<
"(LogAgregator::getLogList): "
<<
ex
.
what
()
<<
std
::
endl
;
}
return
std
::
move
(
l
)
;
return
l
;
}
// -------------------------------------------------------------------------
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
getLogList
()
const
...
...
@@ -336,7 +336,7 @@ namespace uniset
{
return
a
.
name
<
b
.
name
;
});
return
std
::
move
(
lst
)
;
return
lst
;
}
// -------------------------------------------------------------------------
std
::
list
<
LogAgregator
::
iLog
>
LogAgregator
::
makeLogNameList
(
const
std
::
string
&
prefix
)
const
...
...
@@ -363,7 +363,7 @@ namespace uniset
}
}
return
std
::
move
(
lst
)
;
return
lst
;
}
// -------------------------------------------------------------------------
void
LogAgregator
::
offLogFile
(
const
std
::
string
&
logname
)
...
...
src/Log/LogServer.cc
View file @
6f8dfd03
...
...
@@ -333,7 +333,7 @@ namespace uniset
{
ostringstream
h
;
h
<<
"--"
<<
prefix
<<
"-cmd-timeout msec - Timeout for wait command. Default: 2000 msec."
<<
endl
;
return
std
::
move
(
h
.
str
()
);
return
h
.
str
(
);
}
// -----------------------------------------------------------------------------
string
LogServer
::
getShortInfo
()
...
...
@@ -353,7 +353,7 @@ namespace uniset
inf
<<
" "
<<
s
->
getShortInfo
()
<<
endl
;
}
return
std
::
move
(
inf
.
str
()
);
return
inf
.
str
(
);
}
// -----------------------------------------------------------------------------
#ifndef DISABLE_REST_API
...
...
@@ -491,7 +491,7 @@ namespace uniset
s
<<
"================================="
<<
endl
<<
endl
;
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
return
""
;
...
...
src/ObjectRepository/IORFile.cc
View file @
6f8dfd03
...
...
@@ -41,7 +41,7 @@ string IORFile::getIOR( const ObjectId id )
string
sior
;
ior_file
>>
sior
;
return
s
td
::
move
(
sior
)
;
return
s
ior
;
}
// -----------------------------------------------------------------------------------------
void
IORFile
::
setIOR
(
const
ObjectId
id
,
const
string
&
sior
)
...
...
@@ -69,6 +69,6 @@ string IORFile::getFileName( const ObjectId id )
{
ostringstream
fname
;
fname
<<
uniset_conf
()
->
getLockDir
()
<<
id
;
return
std
::
move
(
fname
.
str
()
);
return
fname
.
str
(
);
}
// -----------------------------------------------------------------------------------------
src/ObjectRepository/ORepHelpers.cc
View file @
6f8dfd03
...
...
@@ -257,7 +257,7 @@ namespace uniset
}
return
std
::
move
(
bad
)
;
return
bad
;
}
// ---------------------------------------------------------------------------------------------------------------
}
...
...
src/ObjectRepository/UniSetTypes.cc
View file @
6f8dfd03
...
...
@@ -212,7 +212,7 @@ bool uniset::file_exist( const std::string& filename )
uniset
::
IDList
uniset
::
explode
(
const
std
::
string
&
str
,
char
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
)
...
...
@@ -256,7 +256,7 @@ std::vector<std::string> uniset::explode_str( const std::string& str, char sep )
}
while
(
pos
!=
string
::
npos
);
return
std
::
move
(
v
)
;
return
v
;
}
// ------------------------------------------------------------------------------------------
bool
uniset
::
is_digit
(
const
std
::
string
&
s
)
noexcept
...
...
@@ -338,7 +338,7 @@ std::list<uniset::ParamSInfo> uniset::getSInfoList( const string& str, std::shar
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
)
...
...
@@ -401,7 +401,7 @@ std::list<uniset::ConsumerInfo> uniset::getObjectsList( const string& str, std::
res
.
emplace_back
(
std
::
move
(
item
)
);
}
return
std
::
move
(
res
)
;
return
res
;
}
// --------------------------------------------------------------------------------------
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
string
res
(
src
);
if
(
from
.
empty
()
)
return
std
::
move
(
res
)
;
return
res
;
size_t
pos
=
res
.
find
(
from
,
0
);
...
...
@@ -582,7 +582,7 @@ std::string uniset::replace_all( const std::string& src, const std::string& from
pos
=
res
.
find
(
from
,
pos
);
}
return
std
::
move
(
res
)
;
return
res
;
}
// -------------------------------------------------------------------------
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
();
}
return
std
::
move
(
tv
)
;
return
tv
;
}
// -------------------------------------------------------------------------
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
();
}
return
std
::
move
(
ts
)
;
return
ts
;
}
// -------------------------------------------------------------------------
timespec
uniset
::
now_to_timespec
()
...
...
src/Services/DBServer.cc
View file @
6f8dfd03
...
...
@@ -138,6 +138,6 @@ std::string DBServer::help_print()
h
<<
"--prefix-logserver-port num - listen port. Default: ID"
<<
endl
;
h
<<
LogServer
::
help_print
(
"prefix-logserver"
)
<<
endl
;
return
std
::
move
(
h
.
str
()
);
return
h
.
str
(
);
}
//--------------------------------------------------------------------------------------------
src/Various/Configuration.cc
View file @
6f8dfd03
...
...
@@ -331,7 +331,7 @@ namespace uniset
{
const
string
a
(
omniIt
.
getProp
(
"arg"
));
uinfo
<<
"(Configuration): add omniORB option '"
<<
p
<<
"' "
<<
a
<<
endl
;
omniParams
.
emplace_back
(
std
::
m
ove
(
std
::
make_pair
(
p
,
a
)
)
);
omniParams
.
emplace_back
(
std
::
m
ake_pair
(
p
,
a
)
);
}
}
}
...
...
@@ -485,7 +485,7 @@ namespace uniset
string
s
(
uniset
::
getArgParam
(
name
,
_argc
,
_argv
,
""
));
if
(
!
s
.
empty
()
)
return
s
td
::
move
(
s
)
;
return
s
;
if
(
!
defval
.
empty
()
)
return
defval
;
...
...
@@ -1010,7 +1010,7 @@ namespace uniset
{
ostringstream
n
;
n
<<
sec
<<
"/"
<<
name
;
return
std
::
move
(
n
.
str
()
);
return
n
.
str
(
);
}
// -------------------------------------------------------------------------
void
Configuration
::
initRepSections
()
...
...
@@ -1052,7 +1052,7 @@ namespace uniset
if
(
ret
.
empty
()
)
ret
=
unixml
->
getProp
(
secnode
,
"name"
);
return
std
::
move
(
ret
)
;
return
ret
;
}
// -------------------------------------------------------------------------
void
Configuration
::
setConfFileName
(
const
string
&
fn
)
...
...
src/Various/LT_Object.cc
View file @
6f8dfd03
...
...
@@ -155,7 +155,7 @@ LT_Object::TimersList LT_Object::getTimersList()
{
uniset_rwmutex_rlock
l
(
lstMutex
);
TimersList
lst
(
tlst
);
return
std
::
move
(
lst
)
;
return
lst
;
}
// ------------------------------------------------------------------------------------------
string
LT_Object
::
getTimerName
(
int
id
)
...
...
src/Various/UniXML.cc
View file @
6f8dfd03
...
...
@@ -160,7 +160,7 @@ string UniXML::getProp2(const xmlNode* node, const string& name, const string& d
string
s
(
getProp
(
node
,
name
));
if
(
!
s
.
empty
()
)
return
s
td
::
move
(
s
)
;
return
s
;
}
catch
(...)
{}
...
...
@@ -182,7 +182,7 @@ string UniXML::getProp(const xmlNode* node, const string& name) noexcept
// формально при конструировании строки может быть exception
const
string
t
(
(
const
char
*
)
text
);
xmlFree
(
(
xmlChar
*
)
text
);
return
std
::
move
(
t
)
;
return
t
;
}
catch
(...)
{}
...
...
@@ -214,7 +214,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node )
{
UniXMLPropList
lst
;
if
(
!
node
)
return
std
::
move
(
lst
)
;
return
lst
;
xmlAttr
*
attribute
=
node
->
properties
;
while
(
attribute
)
...
...
@@ -227,7 +227,7 @@ UniXMLPropList UniXML::getPropList( xmlNode* node )
attribute
=
attribute
->
next
;
}
return
std
::
move
(
lst
)
;
return
lst
;
}
// -----------------------------------------------------------------------------
xmlNode
*
UniXML
::
createChild
(
xmlNode
*
node
,
const
string
&
title
,
const
string
&
text
)
...
...
src/Various/VMonitor.cc
View file @
6f8dfd03
...
...
@@ -33,7 +33,7 @@ namespace uniset
{ \
std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return s
td::move(s.str()
); \
return s
.str(
); \
} \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \
...
...
@@ -49,7 +49,7 @@ namespace uniset
{ \
std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return s
td::move(s.str()
); \
return s
.str(
); \
} \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \
...
...
@@ -69,13 +69,13 @@ namespace uniset
{ \
std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return s
td::move(s.str()
); \
return s
.str(
); \
} \
const std::string VMonitor::pretty_str( const std::string& name, const unsigned T* v, int nwidth ) \
{ \
std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return s
td::move(s.str()
); \
return s
.str(
); \
} \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \
...
...
@@ -94,7 +94,7 @@ namespace uniset
{ \
std::ostringstream s; \
s << std::right << std::setw(nwidth) << name << std::left << " = " << std::right << std::setw(10) << *(v); \
return s
td::move(s.str()
); \
return s
.str(
); \
} \
const std::string VMonitor::pretty_str( const std::string& name, const T& v, int nwidth ) \
{ \
...
...
@@ -167,7 +167,7 @@ namespace uniset
{
std
::
ostringstream
s
;
s
<<
(
*
this
);
return
s
td
::
move
(
s
.
str
()
);
return
s
.
str
(
);
}
// --------------------------------------------------------------------------
std
::
list
<
std
::
pair
<
std
::
string
,
std
::
string
>
>
VMonitor
::
getList
()
...
...
@@ -181,7 +181,7 @@ namespace uniset
VMON_MAKE_PAIR
(
vlist
,
float
);
VMON_MAKE_PAIR
(
vlist
,
double
);
VMON_MAKE_PAIR_S
(
vlist
,
string
);
return
std
::
move
(
vlist
)
;
return
vlist
;
}
// --------------------------------------------------------------------------
std
::
string
VMonitor
::
pretty_str
(
int
namewidth
,
int
colnum
)
...
...
@@ -205,7 +205,7 @@ namespace uniset
os
<<
std
::
endl
;
}
return
std
::
move
(
os
.
str
()
);
return
os
.
str
(
);
}
// --------------------------------------------------------------------------
}
// end of namespace uniset
tests/develop.cc
View file @
6f8dfd03
...
...
@@ -6,7 +6,6 @@
#include <type_traits>
#include <tuple>
#include "UTCPCore.h"
#include <chrono>
template
<
typename
...
Args
>
class
VMon
...
...
@@ -18,91 +17,81 @@ class VMon
// ------------------------------------------------------------------------------
using
namespace
std
;
using
namespace
uniset
;
class
PtrMapHashFn
// ------------------------------------------------------------------------------
struct
TestClass
{
public
:
size_t
operator
()
(
const
long
*
const
&
key
)
const
{
return
std
::
hash
<
long
>
()((
long
)
key
);
}
TestClass
()
{
cerr
<<
"TEST CLASS CREATE.."
<<
endl
;
}
// TestClass( TestClass&& ) = default;
TestClass
(
const
TestClass
&
t
)
{
cerr
<<
"TEST CLASS COPY.."
<<
endl
;
(
*
this
)
=
t
;
}
TestClass
&
operator
=
(
const
TestClass
&
t
)
{
cerr
<<
"TEST CLASS COPY FUNC.."
<<
endl
;
(
*
this
)
=
t
;
return
(
*
this
);
}
TestClass
&
operator
=
(
TestClass
&&
t
)
=
default
;
TestClass
(
TestClass
&&
t
)
{
cerr
<<
"TEST CLASS MOVE.."
<<
endl
;
(
*
this
)
=
std
::
move
(
t
);
}
size_t
len
=
{
10
};
int
data
[
10
];
};
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
)
struct
MClass
{
cerr
<<
"2000%1000000="
<<
int
(
2000
%
1000000
)
<<
endl
;
return
0
;
unordered_map
<
const
long
*
,
const
long
*
,
PtrMapHashFn
>
vmap
;
const
long
id
=
10
;
long
prive_val
=
100
;
const
long
&
val
(
prive_val
);
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
()
<<
endl
;
return
0
;
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
p1
,
p2
,
p3
;
p2
=
std
::
chrono
::
system_clock
::
now
();
p3
=
p2
-
std
::
chrono
::
hours
(
24
);
std
::
time_t
epoch_time
=
std
::
chrono
::
system_clock
::
to_time_t
(
p1
);
std
::
cout
<<
"epoch: "
<<
std
::
ctime
(
&
epoch_time
);
std
::
time_t
today_time
=
std
::
chrono
::
system_clock
::
to_time_t
(
p2
);
std
::
cout
<<
"today: "
<<
std
::
ctime
(
&
today_time
);
std
::
cout
<<
"hours since epoch: "
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
hours
>
(
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
;
unsigned
char
dat
[]
=
{
'1'
,
'2'
,
'3'
,
'4'
};
MClass
(
int
d1
,
int
d2
=
0
)
{
data
[
0
]
=
d1
;
data
[
1
]
=
d2
;
}
size_t
len
=
{
2
};
int
data
[
2
];
TestClass
get
()
{
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 );
UTCPCore
::
Buffer
*
buf
=
new
UTCPCore
::
Buffer
(
dat
,
3
);
void
test_func
(
TestClass
&
m
)
{
cerr
<<
"func.."
<<
endl
;
}
// if( buf->nbytes() == 0 )
// delete buf;
cout
<<
"buf: "
<<
buf
->
dpos
()
<<
endl
;
void
test_func
(
TestClass
&&
m
)
{
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment