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
c966df0d
Commit
c966df0d
authored
Aug 08, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Небольшие оптимизации: push_[back,front] --> emplace_[back,front]
parent
44303a48
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
61 additions
and
75 deletions
+61
-75
mbtcptester.cc
Utilities/MBTester/mbtcptester.cc
+1
-1
log.cc
Utilities/ULog/log.cc
+10
-10
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+3
-3
MySQLInterface.cc
extensions/DBServer-MySQL/MySQLInterface.cc
+2
-2
DBServer_PostgreSQL.cc
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
+1
-1
SQLiteInterface.cc
extensions/DBServer-SQLite/SQLiteInterface.cc
+3
-3
IOControl.cc
extensions/IOControl/IOControl.cc
+1
-2
Element.cc
extensions/LogicProcessor/Element.cc
+1
-1
LProcessor.cc
extensions/LogicProcessor/LProcessor.cc
+2
-2
Schema.cc
extensions/LogicProcessor/Schema.cc
+2
-2
SchemaXML.cc
extensions/LogicProcessor/SchemaXML.cc
+1
-1
TDelay.cc
extensions/LogicProcessor/TDelay.cc
+1
-1
TNOT.cc
extensions/LogicProcessor/TNOT.cc
+1
-1
TOR.cc
extensions/LogicProcessor/TOR.cc
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+2
-2
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+1
-1
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+4
-6
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+1
-1
DigitalFilter.cc
extensions/lib/DigitalFilter.cc
+1
-1
ModbusTCPServer.cc
src/Communications/Modbus/ModbusTCPServer.cc
+1
-1
LogAgregator.cc
src/Log/LogAgregator.cc
+1
-2
LogSession.cc
src/Log/LogSession.cc
+1
-4
ObjectRepository.cc
src/ObjectRepository/ObjectRepository.cc
+2
-8
UniSetTypes.cc
src/ObjectRepository/UniSetTypes.cc
+4
-4
NCRestorer_XML.cc
src/Processes/NCRestorer_XML.cc
+2
-3
Configuration.cc
src/Various/Configuration.cc
+2
-2
VMonitor.cc
src/Various/VMonitor.cc
+6
-6
perf_test.cc
tests/perf_test.cc
+1
-1
test_mutex.cc
tests/test_mutex.cc
+2
-2
No files found.
Utilities/MBTester/mbtcptester.cc
View file @
c966df0d
...
@@ -254,7 +254,7 @@ int main( int argc, char** argv )
...
@@ -254,7 +254,7 @@ int main( int argc, char** argv )
dval
.
d
.
v
=
ModbusRTU
::
str2mbData
(
arg
);
dval
.
d
.
v
=
ModbusRTU
::
str2mbData
(
arg
);
}
}
data
.
push
_back
(
dval
);
data
.
emplace
_back
(
dval
);
val
=
dval
.
d
.
v
;
val
=
dval
.
d
.
v
;
}
}
...
...
Utilities/ULog/log.cc
View file @
c966df0d
...
@@ -115,7 +115,7 @@ int main( int argc, char** argv )
...
@@ -115,7 +115,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
)
);
vcmd
.
emplace_back
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
);
}
}
break
;
break
;
...
@@ -129,7 +129,7 @@ int main( int argc, char** argv )
...
@@ -129,7 +129,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
)
);
vcmd
.
emplace_back
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
);
}
}
break
;
break
;
...
@@ -143,7 +143,7 @@ int main( int argc, char** argv )
...
@@ -143,7 +143,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
)
);
vcmd
.
emplace_back
(
cmd
,
(
int
)
Debug
::
value
(
d
),
filter
);
}
}
break
;
break
;
...
@@ -156,7 +156,7 @@ int main( int argc, char** argv )
...
@@ -156,7 +156,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
LogServerTypes
::
cmdList
,
0
,
filter
)
);
vcmd
.
emplace_back
(
LogServerTypes
::
cmdList
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -169,7 +169,7 @@ int main( int argc, char** argv )
...
@@ -169,7 +169,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -182,7 +182,7 @@ int main( int argc, char** argv )
...
@@ -182,7 +182,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -195,7 +195,7 @@ int main( int argc, char** argv )
...
@@ -195,7 +195,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -209,7 +209,7 @@ int main( int argc, char** argv )
...
@@ -209,7 +209,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -222,7 +222,7 @@ int main( int argc, char** argv )
...
@@ -222,7 +222,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
@@ -248,7 +248,7 @@ int main( int argc, char** argv )
...
@@ -248,7 +248,7 @@ int main( int argc, char** argv )
if
(
arg2
)
if
(
arg2
)
filter
=
string
(
arg2
);
filter
=
string
(
arg2
);
vcmd
.
push_back
(
LogReader
::
Command
(
cmd
,
0
,
filter
)
);
vcmd
.
emplace_back
(
cmd
,
0
,
filter
);
}
}
break
;
break
;
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
c966df0d
...
@@ -1146,7 +1146,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
...
@@ -1146,7 +1146,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s1
<<
" "
<<
setw(30)
<<
std::right
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
"
s1
<<
" "
<<
setw(30)
<<
std::right
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
"
<<
" ( "
<<
setw(30)
<<
std::left
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
" )"
<<
" ( "
<<
setw(30)
<<
std::left
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
" )"
<<
std::right
<<
" = "
<<
setw(6)
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
<<
std::right
<<
" = "
<<
setw(6)
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
v_in.
push
_back(s1.str());
v_in.
emplace
_back(s1.str());
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
...
@@ -1158,7 +1158,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
...
@@ -1158,7 +1158,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
s1
<<
" "
<<
setw(30)
<<
std::right
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
"
s1
<<
" "
<<
setw(30)
<<
std::right
<<
"
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
"
<<
" ( "
<<
setw(30)
<<
std::left
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
" )"
<<
" ( "
<<
setw(30)
<<
std::left
<<
ORepHelpers::getShortName( uniset_conf()->oind->getMapName(
<xsl:value-of
select=
"@name"
/>
))
<<
" )"
<<
std::right
<<
" = "
<<
setw(6)
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
<<
std::right
<<
" = "
<<
setw(6)
<<
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
v_out.
push
_back(s1.str());
v_out.
emplace
_back(s1.str());
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
...
@@ -1494,7 +1494,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
...
@@ -1494,7 +1494,7 @@ std::string <xsl:value-of select="$CLASSNAME"/>_SK::dumpIO()
<xsl:if
test=
"normalize-space(@name)=$OID"
>
<xsl:if
test=
"normalize-space(@name)=$OID"
>
s1.str("");
s1.str("");
s1
<<
" "
<<
strval(
<xsl:value-of
select=
"../../@name"
/>
);
s1
<<
" "
<<
strval(
<xsl:value-of
select=
"../../@name"
/>
);
v.
push
_back(s1.str());
v.
emplace
_back(s1.str());
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
...
...
extensions/DBServer-MySQL/MySQLInterface.cc
View file @
c966df0d
...
@@ -198,9 +198,9 @@ void MySQLInterface::makeResult(DBResult& dbres, MYSQL_RES* myres, bool finalize
...
@@ -198,9 +198,9 @@ void MySQLInterface::makeResult(DBResult& dbres, MYSQL_RES* myres, bool finalize
DBResult
::
COL
c
;
DBResult
::
COL
c
;
for
(
unsigned
int
i
=
0
;
i
<
nfields
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
nfields
;
i
++
)
c
.
push
_back
(
(
mysql_row
[
i
]
!=
0
?
string
(
mysql_row
[
i
])
:
""
)
);
c
.
emplace
_back
(
(
mysql_row
[
i
]
!=
0
?
string
(
mysql_row
[
i
])
:
""
)
);
dbres
.
row
().
push
_back
(
c
);
dbres
.
row
().
emplace
_back
(
c
);
}
}
if
(
finalize
)
if
(
finalize
)
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
View file @
c966df0d
...
@@ -271,7 +271,7 @@ void DBServer_PostgreSQL::sensorInfo( const UniSetTypes::SensorMessage* si )
...
@@ -271,7 +271,7 @@ void DBServer_PostgreSQL::sensorInfo( const UniSetTypes::SensorMessage* si )
std
::
to_string
(
si
->
node
),
std
::
to_string
(
si
->
node
),
};
};
ibuf
.
push
_back
(
std
::
move
(
rec
));
ibuf
.
emplace
_back
(
std
::
move
(
rec
));
ibufSize
++
;
ibufSize
++
;
if
(
ibufSize
>=
ibufMaxSize
)
if
(
ibufSize
>=
ibufMaxSize
)
...
...
extensions/DBServer-SQLite/SQLiteInterface.cc
View file @
c966df0d
...
@@ -253,12 +253,12 @@ void SQLiteInterface::makeResult(DBResult& dbres, sqlite3_stmt* s, bool finalize
...
@@ -253,12 +253,12 @@ void SQLiteInterface::makeResult(DBResult& dbres, sqlite3_stmt* s, bool finalize
char
*
p
=
(
char
*
)
sqlite3_column_text
(
s
,
i
);
char
*
p
=
(
char
*
)
sqlite3_column_text
(
s
,
i
);
if
(
p
)
if
(
p
)
c
.
push
_back
(
p
);
c
.
emplace
_back
(
p
);
else
else
c
.
push
_back
(
""
);
c
.
emplace
_back
(
""
);
}
}
dbres
.
row
().
push
_back
(
c
);
dbres
.
row
().
emplace
_back
(
c
);
}
}
while
(
sqlite3_step
(
s
)
==
SQLITE_ROW
);
while
(
sqlite3_step
(
s
)
==
SQLITE_ROW
);
...
...
extensions/IOControl/IOControl.cc
View file @
c966df0d
...
@@ -795,8 +795,7 @@ bool IOControl::initIOItem( UniXML::iterator& it )
...
@@ -795,8 +795,7 @@ bool IOControl::initIOItem( UniXML::iterator& it )
if
(
prior
>
0
)
if
(
prior
>
0
)
{
{
IOPriority
p
(
prior
,
maxItem
);
pmap
.
emplace_back
(
prior
,
maxItem
);
pmap
.
push_back
(
p
);
iolog3
<<
myname
<<
"(readItem): add to priority list: "
<<
iolog3
<<
myname
<<
"(readItem): add to priority list: "
<<
it
.
getProp
(
"name"
)
it
.
getProp
(
"name"
)
<<
" priority="
<<
prior
<<
endl
;
<<
" priority="
<<
prior
<<
endl
;
...
...
extensions/LogicProcessor/Element.cc
View file @
c966df0d
...
@@ -102,7 +102,7 @@ void Element::addInput(size_t num, bool state)
...
@@ -102,7 +102,7 @@ void Element::addInput(size_t num, bool state)
}
}
}
}
ins
.
push_front
(
InputInfo
(
num
,
state
)
);
ins
.
emplace_front
(
num
,
state
);
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
Element
::
delInput
(
size_t
num
)
void
Element
::
delInput
(
size_t
num
)
...
...
extensions/LogicProcessor/LProcessor.cc
View file @
c966df0d
...
@@ -125,7 +125,7 @@ void LProcessor::build( const string& lfile )
...
@@ -125,7 +125,7 @@ void LProcessor::build( const string& lfile )
continue
;
continue
;
}
}
extInputs
.
push_front
(
ei
);
extInputs
.
emplace_front
(
std
::
move
(
ei
)
);
}
}
for
(
auto
it
=
sch
->
outBegin
();
it
!=
sch
->
outEnd
();
++
it
)
for
(
auto
it
=
sch
->
outBegin
();
it
!=
sch
->
outEnd
();
++
it
)
...
@@ -149,7 +149,7 @@ void LProcessor::build( const string& lfile )
...
@@ -149,7 +149,7 @@ void LProcessor::build( const string& lfile )
continue
;
continue
;
}
}
extOuts
.
push_front
(
ei
);
extOuts
.
emplace_front
(
std
::
move
(
ei
)
);
}
}
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
...
extensions/LogicProcessor/Schema.cc
View file @
c966df0d
...
@@ -61,7 +61,7 @@ void Schema::link( Element::ElementID rootID, Element::ElementID childID, int nu
...
@@ -61,7 +61,7 @@ void Schema::link( Element::ElementID rootID, Element::ElementID childID, int nu
e1
->
addChildOut
(
e2
,
numIn
);
e1
->
addChildOut
(
e2
,
numIn
);
// сохраняем в список соединений
// сохраняем в список соединений
inLinks
.
push_front
(
INLink
(
e1
,
e2
,
numIn
)
);
inLinks
.
emplace_front
(
e1
,
e2
,
numIn
);
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
Schema
::
unlink
(
Element
::
ElementID
rootID
,
Element
::
ElementID
childID
)
void
Schema
::
unlink
(
Element
::
ElementID
rootID
,
Element
::
ElementID
childID
)
...
@@ -122,7 +122,7 @@ void Schema::extlink( const string& name, Element::ElementID childID, int numIn
...
@@ -122,7 +122,7 @@ void Schema::extlink( const string& name, Element::ElementID childID, int numIn
// уже должен быть
// уже должен быть
// заносим в список
// заносим в список
extLinks
.
push_front
(
EXTLink
(
name
,
el
,
numIn
)
);
extLinks
.
emplace_front
(
name
,
el
,
numIn
);
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
std
::
shared_ptr
<
Element
>
Schema
::
manage
(
std
::
shared_ptr
<
Element
>
el
)
std
::
shared_ptr
<
Element
>
Schema
::
manage
(
std
::
shared_ptr
<
Element
>
el
)
...
...
extensions/LogicProcessor/SchemaXML.cc
View file @
c966df0d
...
@@ -141,7 +141,7 @@ void SchemaXML::read( const string& xmlfile )
...
@@ -141,7 +141,7 @@ void SchemaXML::read( const string& xmlfile )
}
}
dinfo
<<
"SchemaXML: set Out: from="
<<
fID
<<
" to="
<<
tID
<<
endl
;
dinfo
<<
"SchemaXML: set Out: from="
<<
fID
<<
" to="
<<
tID
<<
endl
;
outList
.
push_front
(
EXTOut
(
tID
,
el
)
);
outList
.
emplace_front
(
tID
,
el
);
}
}
}
}
}
}
...
...
extensions/LogicProcessor/TDelay.cc
View file @
c966df0d
...
@@ -30,7 +30,7 @@ TDelay::TDelay(Element::ElementID id, timeout_t delayMS, size_t inCount):
...
@@ -30,7 +30,7 @@ TDelay::TDelay(Element::ElementID id, timeout_t delayMS, size_t inCount):
{
{
// создаём заданное количество входов
// создаём заданное количество входов
for
(
unsigned
int
i
=
1
;
i
<=
inCount
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<=
inCount
;
i
++
)
ins
.
push_front
(
InputInfo
(
i
,
false
)
);
// addInput(i,st);
ins
.
emplace_front
(
i
,
false
);
// addInput(i,st);
}
}
}
}
...
...
extensions/LogicProcessor/TNOT.cc
View file @
c966df0d
...
@@ -26,7 +26,7 @@ TNOT::TNOT( ElementID id, bool out_default ):
...
@@ -26,7 +26,7 @@ TNOT::TNOT( ElementID id, bool out_default ):
Element
(
id
),
Element
(
id
),
myout
(
out_default
)
myout
(
out_default
)
{
{
ins
.
push_front
(
InputInfo
(
1
,
!
out_default
)
);
ins
.
emplace_front
(
1
,
!
out_default
);
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
TNOT
::~
TNOT
()
TNOT
::~
TNOT
()
...
...
extensions/LogicProcessor/TOR.cc
View file @
c966df0d
...
@@ -31,7 +31,7 @@ TOR::TOR(ElementID id, size_t num, bool st):
...
@@ -31,7 +31,7 @@ TOR::TOR(ElementID id, size_t num, bool st):
// создаём заданное количество входов
// создаём заданное количество входов
for
(
unsigned
int
i
=
1
;
i
<=
num
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<=
num
;
i
++
)
{
{
ins
.
push_front
(
InputInfo
(
i
,
st
)
);
// addInput(i,st);
ins
.
emplace_front
(
i
,
st
);
// addInput(i,st);
if
(
st
==
true
)
if
(
st
==
true
)
myout
=
true
;
myout
=
true
;
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
c966df0d
...
@@ -2113,7 +2113,7 @@ MBExchange::RSProperty* MBExchange::addProp( PList& plist, RSProperty&& p )
...
@@ -2113,7 +2113,7 @@ MBExchange::RSProperty* MBExchange::addProp( PList& plist, RSProperty&& p )
return
&
it
;
return
&
it
;
}
}
plist
.
push
_back
(
std
::
move
(
p
)
);
plist
.
emplace
_back
(
std
::
move
(
p
)
);
auto
it
=
plist
.
end
();
auto
it
=
plist
.
end
();
--
it
;
--
it
;
return
&
(
*
it
);
return
&
(
*
it
);
...
@@ -2581,7 +2581,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
...
@@ -2581,7 +2581,7 @@ bool MBExchange::initItem( UniXML::iterator& it )
}
}
}
}
initRegList
.
push
_back
(
std
::
move
(
ii
)
);
initRegList
.
emplace
_back
(
std
::
move
(
ii
)
);
ri
->
mb_initOK
=
false
;
ri
->
mb_initOK
=
false
;
ri
->
sm_initOK
=
false
;
ri
->
sm_initOK
=
false
;
}
}
...
...
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
c966df0d
...
@@ -137,8 +137,8 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
...
@@ -137,8 +137,8 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
auto
l
=
loga
->
create
(
sinf
.
myname
);
auto
l
=
loga
->
create
(
sinf
.
myname
);
sinf
.
mbtcp
->
setLog
(
l
);
sinf
.
mbtcp
->
setLog
(
l
);
mblist
.
push_back
(
sinf
);
mbinfo
<<
myname
<<
"(init): add slave channel "
<<
sinf
.
myname
<<
endl
;
mbinfo
<<
myname
<<
"(init): add slave channel "
<<
sinf
.
myname
<<
endl
;
mblist
.
emplace_back
(
std
::
move
(
sinf
));
}
}
if
(
ic
)
if
(
ic
)
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
c966df0d
...
@@ -488,7 +488,7 @@ bool SharedMemory::readItem( const std::shared_ptr<UniXML>& xml, UniXML::iterato
...
@@ -488,7 +488,7 @@ bool SharedMemory::readItem( const std::shared_ptr<UniXML>& xml, UniXML::iterato
// без проверки на дублирование т.к.
// без проверки на дублирование т.к.
// id - гарантирует уникальность в нашем configure.xml
// id - гарантирует уникальность в нашем configure.xml
hblist
.
push_back
(
hi
);
hblist
.
emplace_back
(
std
::
move
(
hi
)
);
return
true
;
return
true
;
}
}
...
@@ -687,7 +687,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
...
@@ -687,7 +687,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
<<
endl
;
<<
endl
;
// WARNING: no check duplicates...
// WARNING: no check duplicates...
hist
.
push_back
(
hi
);
hist
.
emplace_back
(
std
::
move
(
hi
)
);
}
}
sminfo
<<
myname
<<
"(buildHistoryList): history logs count="
<<
hist
.
size
()
<<
endl
;
sminfo
<<
myname
<<
"(buildHistoryList): history logs count="
<<
hist
.
size
()
<<
endl
;
...
@@ -702,8 +702,7 @@ void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
...
@@ -702,8 +702,7 @@ void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
if
(
!
xit
.
getProp
(
"id"
).
empty
()
)
if
(
!
xit
.
getProp
(
"id"
).
empty
()
)
{
{
HistoryItem
ai
(
xit
.
getIntProp
(
"id"
),
it
.
size
,
xit
.
getIntProp
(
"default"
)
);
it
.
hlst
.
emplace_back
(
xit
.
getIntProp
(
"id"
),
it
.
size
,
xit
.
getIntProp
(
"default"
));
it
.
hlst
.
push_back
(
std
::
move
(
ai
)
);
continue
;
continue
;
}
}
...
@@ -715,8 +714,7 @@ void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
...
@@ -715,8 +714,7 @@ void SharedMemory::checkHistoryFilter( UniXML::iterator& xit )
continue
;
continue
;
}
}
HistoryItem
ai
(
id
,
it
.
size
,
xit
.
getIntProp
(
"default"
)
);
it
.
hlst
.
emplace_back
(
id
,
it
.
size
,
xit
.
getIntProp
(
"default"
));
it
.
hlst
.
push_back
(
std
::
move
(
ai
)
);
}
}
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
c966df0d
...
@@ -372,7 +372,7 @@ UNetExchange::UNetExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId sh
...
@@ -372,7 +372,7 @@ UNetExchange::UNetExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId sh
ri
.
setRespondID
(
resp_comm_id
,
resp_invert
);
ri
.
setRespondID
(
resp_comm_id
,
resp_invert
);
ri
.
setLostPacketsID
(
lp_comm_id
);
ri
.
setLostPacketsID
(
lp_comm_id
);
ri
.
setChannelNumID
(
numchannel_id
);
ri
.
setChannelNumID
(
numchannel_id
);
recvlist
.
push_back
(
ri
);
recvlist
.
emplace_back
(
std
::
move
(
ri
)
);
}
}
// -------------------------------
// -------------------------------
...
...
extensions/lib/DigitalFilter.cc
View file @
c966df0d
...
@@ -90,7 +90,7 @@ void DigitalFilter::init( int val )
...
@@ -90,7 +90,7 @@ void DigitalFilter::init( int val )
{
{
buf
.
clear
();
buf
.
clear
();
for
(
unsigned
in
t
i
=
0
;
i
<
maxsize
;
i
++
)
for
(
size_
t
i
=
0
;
i
<
maxsize
;
i
++
)
buf
.
push_back
(
val
);
buf
.
push_back
(
val
);
w
.
assign
(
maxsize
,
1.0
/
maxsize
);
w
.
assign
(
maxsize
,
1.0
/
maxsize
);
...
...
src/Communications/Modbus/ModbusTCPServer.cc
View file @
c966df0d
...
@@ -175,7 +175,7 @@ void ModbusTCPServer::getSessions( Sessions& lst )
...
@@ -175,7 +175,7 @@ void ModbusTCPServer::getSessions( Sessions& lst )
for
(
const
auto
&
i
:
slist
)
for
(
const
auto
&
i
:
slist
)
{
{
SessionInfo
inf
(
i
->
getClientAddress
(),
i
->
getAskCount
()
);
SessionInfo
inf
(
i
->
getClientAddress
(),
i
->
getAskCount
()
);
lst
.
push_back
(
inf
);
lst
.
emplace_back
(
std
::
move
(
inf
)
);
}
}
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
...
src/Log/LogAgregator.cc
View file @
c966df0d
...
@@ -356,8 +356,7 @@ std::list<LogAgregator::iLog> LogAgregator::makeLogNameList( const std::string&
...
@@ -356,8 +356,7 @@ std::list<LogAgregator::iLog> LogAgregator::makeLogNameList( const std::string&
else
else
{
{
const
std
::
string
nm
(
p2
+
l
.
second
->
getLogName
());
const
std
::
string
nm
(
p2
+
l
.
second
->
getLogName
());
LogAgregator
::
iLog
il
(
l
.
second
,
std
::
move
(
nm
)
);
lst
.
emplace_back
(
l
.
second
,
std
::
move
(
nm
)
);
lst
.
push_back
(
std
::
move
(
il
)
);
}
}
}
}
...
...
src/Log/LogSession.cc
View file @
c966df0d
...
@@ -405,10 +405,7 @@ void LogSession::cmdProcessing( const string& cmdLogName, const LogServerTypes::
...
@@ -405,10 +405,7 @@ void LogSession::cmdProcessing( const string& cmdLogName, const LogServerTypes::
else
else
{
{
if
(
cmdLogName
.
empty
()
||
cmdLogName
==
"ALL"
||
log
->
getLogFile
()
==
cmdLogName
)
if
(
cmdLogName
.
empty
()
||
cmdLogName
==
"ALL"
||
log
->
getLogFile
()
==
cmdLogName
)
{
loglist
.
emplace_back
(
log
,
log
->
getLogName
());
LogAgregator
::
iLog
llog
(
log
,
log
->
getLogName
());
loglist
.
emplace_back
(
llog
);
}
}
}
if
(
msg
.
cmd
==
LogServerTypes
::
cmdFilterMode
)
if
(
msg
.
cmd
==
LogServerTypes
::
cmdFilterMode
)
...
...
src/ObjectRepository/ObjectRepository.cc
View file @
c966df0d
...
@@ -388,10 +388,7 @@ bool ObjectRepository::list(const string& section, ListObjectName* ls, unsigned
...
@@ -388,10 +388,7 @@ bool ObjectRepository::list(const string& section, ListObjectName* ls, unsigned
case
ObjectRef
:
case
ObjectRef
:
{
{
if
(
bl
[
i
].
binding_type
==
CosNaming
::
nobject
)
if
(
bl
[
i
].
binding_type
==
CosNaming
::
nobject
)
{
ls
->
emplace_front
(
omniURI
::
nameToString
(
bl
[
i
].
binding_name
));
string
objn
=
omniURI
::
nameToString
(
bl
[
i
].
binding_name
);
ls
->
push_front
(
objn
);
}
break
;
break
;
}
}
...
@@ -399,10 +396,7 @@ bool ObjectRepository::list(const string& section, ListObjectName* ls, unsigned
...
@@ -399,10 +396,7 @@ bool ObjectRepository::list(const string& section, ListObjectName* ls, unsigned
case
Section
:
case
Section
:
{
{
if
(
bl
[
i
].
binding_type
==
CosNaming
::
ncontext
)
if
(
bl
[
i
].
binding_type
==
CosNaming
::
ncontext
)
{
ls
->
emplace_front
(
omniURI
::
nameToString
(
bl
[
i
].
binding_name
));
string
objn
=
omniURI
::
nameToString
(
bl
[
i
].
binding_name
);
ls
->
push_front
(
objn
);
}
break
;
break
;
}
}
...
...
src/ObjectRepository/UniSetTypes.cc
View file @
c966df0d
...
@@ -241,7 +241,7 @@ std::vector<std::string> UniSetTypes::explode_str( const string& str, char sep )
...
@@ -241,7 +241,7 @@ std::vector<std::string> UniSetTypes::explode_str( const string& str, char sep )
string
s
(
str
.
substr
(
prev
,
sz
-
prev
));
string
s
(
str
.
substr
(
prev
,
sz
-
prev
));
if
(
!
s
.
empty
()
)
if
(
!
s
.
empty
()
)
v
.
emplace_back
(
s
);
v
.
emplace_back
(
std
::
move
(
s
)
);
break
;
break
;
}
}
...
@@ -256,7 +256,7 @@ std::vector<std::string> UniSetTypes::explode_str( const string& str, char sep )
...
@@ -256,7 +256,7 @@ std::vector<std::string> UniSetTypes::explode_str( const string& str, char sep )
if
(
!
s
.
empty
()
)
if
(
!
s
.
empty
()
)
{
{
v
.
emplace_back
(
s
);
v
.
emplace_back
(
s
td
::
move
(
s
)
);
prev
=
pos
+
1
;
prev
=
pos
+
1
;
}
}
}
}
...
@@ -344,7 +344,7 @@ std::list<UniSetTypes::ParamSInfo> UniSetTypes::getSInfoList( const string& str,
...
@@ -344,7 +344,7 @@ std::list<UniSetTypes::ParamSInfo> UniSetTypes::getSInfoList( const string& str,
continue
;
continue
;
}
}
res
.
push_back
(
item
);
res
.
emplace_back
(
std
::
move
(
item
)
);
}
}
return
std
::
move
(
res
);
return
std
::
move
(
res
);
...
@@ -407,7 +407,7 @@ std::list<UniSetTypes::ConsumerInfo> UniSetTypes::getObjectsList( const string&
...
@@ -407,7 +407,7 @@ std::list<UniSetTypes::ConsumerInfo> UniSetTypes::getObjectsList( const string&
continue
;
continue
;
}
}
res
.
push_back
(
item
);
res
.
emplace_back
(
std
::
move
(
item
)
);
}
}
return
std
::
move
(
res
);
return
std
::
move
(
res
);
...
...
src/Processes/NCRestorer_XML.cc
View file @
c966df0d
...
@@ -419,7 +419,7 @@ void NCRestorer_XML::read_thresholds( const std::shared_ptr<UniXML>& xml, xmlNod
...
@@ -419,7 +419,7 @@ void NCRestorer_XML::read_thresholds( const std::shared_ptr<UniXML>& xml, xmlNod
}
}
// порог добавляем в любом случае, даже если список заказчиков пуст...
// порог добавляем в любом случае, даже если список заказчиков пуст...
tlst
.
push
_back
(
std
::
move
(
ti
)
);
tlst
.
emplace
_back
(
std
::
move
(
ti
)
);
rtslot
(
xml
,
tit
,
it
);
rtslot
(
xml
,
tit
,
it
);
}
}
...
@@ -468,8 +468,7 @@ bool NCRestorer_XML::getConsumerList( const std::shared_ptr<UniXML>& xml, xmlNod
...
@@ -468,8 +468,7 @@ bool NCRestorer_XML::getConsumerList( const std::shared_ptr<UniXML>& xml, xmlNod
if
(
!
getConsumerInfo
(
it
,
ci
.
id
,
ci
.
node
)
)
if
(
!
getConsumerInfo
(
it
,
ci
.
id
,
ci
.
node
)
)
continue
;
continue
;
// IONotifyController::ConsumerInfoExt cinf(ci);
lst
.
clst
.
emplace_back
(
std
::
move
(
ci
)
);
lst
.
clst
.
emplace_back
(
ci
);
cslot
(
xml
,
it
,
node
);
cslot
(
xml
,
it
,
node
);
}
}
...
...
src/Various/Configuration.cc
View file @
c966df0d
...
@@ -313,7 +313,7 @@ namespace UniSetTypes
...
@@ -313,7 +313,7 @@ namespace UniSetTypes
{
{
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
.
push_back
(
std
::
make_pair
(
p
,
a
)
);
omniParams
.
emplace_back
(
std
::
move
(
std
::
make_pair
(
p
,
a
)
)
);
}
}
}
}
}
}
...
@@ -835,7 +835,7 @@ namespace UniSetTypes
...
@@ -835,7 +835,7 @@ namespace UniSetTypes
initNode
(
ninf
,
it
);
initNode
(
ninf
,
it
);
uinfo
<<
"Configuration(createNodesList): add to list of nodes: node="
<<
nodename
<<
" id="
<<
ninf
.
id
<<
endl
;
uinfo
<<
"Configuration(createNodesList): add to list of nodes: node="
<<
nodename
<<
" id="
<<
ninf
.
id
<<
endl
;
lnodes
.
push_back
(
ninf
);
lnodes
.
emplace_back
(
std
::
move
(
ninf
)
);
}
}
uinfo
<<
"Configuration(createNodesList): size of node list "
<<
lnodes
.
size
()
<<
endl
;
uinfo
<<
"Configuration(createNodesList): size of node list "
<<
lnodes
.
size
()
<<
endl
;
...
...
src/Various/VMonitor.cc
View file @
c966df0d
...
@@ -85,33 +85,33 @@
...
@@ -85,33 +85,33 @@
#define VMON_MAKE_PAIR(vlist, T) \
#define VMON_MAKE_PAIR(vlist, T) \
{\
{\
for( const auto& e: m_##T ) \
for( const auto& e: m_##T ) \
vlist.
push_back( std::make_pair(e.second, std::to_string(*(e.first)
)) );\
vlist.
emplace_back( e.second, std::to_string(*(e.first
)) );\
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#define VMON_MAKE_PAIR_S(vlist, T) \
#define VMON_MAKE_PAIR_S(vlist, T) \
{\
{\
for( const auto& e: m_##T ) \
for( const auto& e: m_##T ) \
vlist.
push_back( std::make_pair(e.second,*e.first)
);\
vlist.
emplace_back( e.second,*e.first
);\
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#define VMON_MAKE_PAIR2(vlist, T) \
#define VMON_MAKE_PAIR2(vlist, T) \
{\
{\
std::ostringstream s;\
std::ostringstream s;\
for( const auto& e: m_##T ) \
for( const auto& e: m_##T ) \
vlist.
push_back( std::make_pair(e.second, std::to_string(*(e.first)
)) );\
vlist.
emplace_back( e.second, std::to_string(*(e.first
)) );\
\
\
for( const auto& e: m_unsigned_##T ) \
for( const auto& e: m_unsigned_##T ) \
vlist.
push_back( std::make_pair(e.second, std::to_string(*(e.first)
)) );\
vlist.
emplace_back( e.second, std::to_string(*(e.first
)) );\
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#define VMON_MAKE_PAIR_CHAR(vlist) \
#define VMON_MAKE_PAIR_CHAR(vlist) \
{\
{\
std::ostringstream s;\
std::ostringstream s;\
for( const auto& e: m_char ) \
for( const auto& e: m_char ) \
vlist.
push_back(std::make_pair(e.second,std::to_string((int)(*(e.first)
))) );\
vlist.
emplace_back( e.second,std::to_string((int)(*(e.first
))) );\
\
\
for( const auto& e: m_unsigned_char ) \
for( const auto& e: m_unsigned_char ) \
vlist.
push_back(std::make_pair(e.second,std::to_string((int)(*(e.first)
))) );\
vlist.
emplace_back( e.second,std::to_string((int)(*(e.first
))) );\
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
VMON_IMPL_ADD2
(
int
)
VMON_IMPL_ADD2
(
int
)
...
...
tests/perf_test.cc
View file @
c966df0d
...
@@ -22,7 +22,7 @@ int main( int argc, char* argv[] )
...
@@ -22,7 +22,7 @@ int main( int argc, char* argv[] )
int
t1
,
t2
;
int
t1
,
t2
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
for
(
int
i
=
0
;
i
<
N
;
i
++
)
values
.
push
_back
(
rand
()
*
rand
()
);
values
.
emplace
_back
(
rand
()
*
rand
()
);
#if 0
#if 0
std::cout << "insert:" << std::endl;
std::cout << "insert:" << std::endl;
...
...
tests/test_mutex.cc
View file @
c966df0d
...
@@ -137,12 +137,12 @@ TEST_CASE("uniset_rwmutex_{wr|r} thread lock", "[mutex][threadlock][basic]" )
...
@@ -137,12 +137,12 @@ TEST_CASE("uniset_rwmutex_{wr|r} thread lock", "[mutex][threadlock][basic]" )
std
::
vector
<
std
::
future
<
bool
>
>
vw
(
3
);
std
::
vector
<
std
::
future
<
bool
>
>
vw
(
3
);
for
(
int
w
=
0
;
w
<
3
;
w
++
)
for
(
int
w
=
0
;
w
<
3
;
w
++
)
vw
.
push
_back
(
std
::
async
(
std
::
launch
::
async
,
writer_thread
,
w
)
);
vw
.
emplace
_back
(
std
::
async
(
std
::
launch
::
async
,
writer_thread
,
w
)
);
std
::
vector
<
std
::
future
<
bool
>
>
vr
(
3
);
std
::
vector
<
std
::
future
<
bool
>
>
vr
(
3
);
for
(
int
r
=
0
;
r
<
5
;
r
++
)
for
(
int
r
=
0
;
r
<
5
;
r
++
)
vr
.
push
_back
(
std
::
async
(
std
::
launch
::
async
,
reader_thread
,
r
)
);
vr
.
emplace
_back
(
std
::
async
(
std
::
launch
::
async
,
reader_thread
,
r
)
);
msleep
(
10
);
msleep
(
10
);
...
...
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