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
6c151936
Commit
6c151936
authored
Sep 20, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Небольшая оптимизация, где можно перевёл std::map --> std::unordered_map
parent
e3c855c5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
12 deletions
+13
-12
MBSlave.h
Utilities/MBTester/MBSlave.h
+2
-2
MBTCPServer.h
Utilities/MBTester/MBTCPServer.h
+2
-2
DBServer_MySQL.h
extensions/DBServer-MySQL/DBServer_MySQL.h
+2
-2
DBServer_PostgreSQL.h
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
+2
-2
DBServer_SQLite.h
extensions/DBServer-SQLite/DBServer_SQLite.h
+2
-2
MBExchange.h
extensions/ModbusMaster/MBExchange.h
+1
-1
MTR.h
extensions/include/MTR.h
+2
-1
No files found.
Utilities/MBTester/MBSlave.h
View file @
6c151936
...
...
@@ -100,7 +100,7 @@ class MBSlave
bool
verbose
;
#if 0
typedef std::map<ModbusRTU::mbErrCode, unsigned int> ExchangeErrorMap;
typedef std::
unordered_
map<ModbusRTU::mbErrCode, unsigned int> ExchangeErrorMap;
ExchangeErrorMap errmap; /*!< статистика обмена */
ModbusRTU::mbErrCode prev;
...
...
@@ -110,7 +110,7 @@ class MBSlave
long askCount; /*!< количество принятых запросов */
typedef std::map<int, std::string> FileList;
typedef std::
unordered_
map<int, std::string> FileList;
FileList flist;
#endif
long
replyVal
;
...
...
Utilities/MBTester/MBTCPServer.h
View file @
6c151936
...
...
@@ -98,7 +98,7 @@ class MBTCPServer
bool
verbose
;
long
replyVal
;
#if 0
typedef std::map<ModbusRTU::mbErrCode, unsigned int> ExchangeErrorMap;
typedef std::
unordered_
map<ModbusRTU::mbErrCode, unsigned int> ExchangeErrorMap;
ExchangeErrorMap errmap; /*!< статистика обмена */
ModbusRTU::mbErrCode prev;
...
...
@@ -108,7 +108,7 @@ class MBTCPServer
long askCount; /*!< количество принятых запросов */
typedef std::map<int, std::string> FileList;
typedef std::
unordered_
map<int, std::string> FileList;
FileList flist;
#endif
...
...
extensions/DBServer-MySQL/DBServer_MySQL.h
View file @
6c151936
...
...
@@ -24,7 +24,7 @@
#ifndef DBServer_MySQL_H_
#define DBServer_MySQL_H_
// --------------------------------------------------------------------------
#include <map>
#include <
unordered_
map>
#include <queue>
#include "UniSetTypes.h"
#include "MySQLInterface.h"
...
...
@@ -155,7 +155,7 @@ class DBServer_MySQL:
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
typedef
std
::
unordered_
map
<
int
,
std
::
string
>
DBTableMap
;
virtual
void
initDBServer
()
override
;
virtual
void
initDB
(
std
::
shared_ptr
<
MySQLInterface
>&
db
)
{};
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
View file @
6c151936
#ifndef DBServer_PostgreSQL_H_
#define DBServer_PostgreSQL_H_
// --------------------------------------------------------------------------
#include <map>
#include <
unordered_
map>
#include <queue>
#include "UniSetTypes.h"
#include "PostgreSQLInterface.h"
...
...
@@ -31,7 +31,7 @@ class DBServer_PostgreSQL:
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
typedef
std
::
unordered_
map
<
int
,
std
::
string
>
DBTableMap
;
virtual
void
initDBServer
()
override
;
virtual
void
initDB
(
std
::
shared_ptr
<
PostgreSQLInterface
>&
db
)
{};
...
...
extensions/DBServer-SQLite/DBServer_SQLite.h
View file @
6c151936
...
...
@@ -24,7 +24,7 @@
#ifndef DBServer_SQLite_H_
#define DBServer_SQLite_H_
// --------------------------------------------------------------------------
#include <map>
#include <
unordered_
map>
#include <queue>
#include "UniSetTypes.h"
#include "SQLiteInterface.h"
...
...
@@ -155,7 +155,7 @@ class DBServer_SQLite:
}
protected
:
typedef
std
::
map
<
int
,
std
::
string
>
DBTableMap
;
typedef
std
::
unordered_
map
<
int
,
std
::
string
>
DBTableMap
;
virtual
void
initDBServer
()
override
;
virtual
void
initDB
(
std
::
shared_ptr
<
SQLiteInterface
>&
db
)
{};
...
...
extensions/ModbusMaster/MBExchange.h
View file @
6c151936
...
...
@@ -210,7 +210,7 @@ class MBExchange:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
RTUDevice
&
d
);
typedef
std
::
map
<
ModbusRTU
::
ModbusAddr
,
std
::
shared_ptr
<
RTUDevice
>>
RTUDeviceMap
;
typedef
std
::
unordered_
map
<
ModbusRTU
::
ModbusAddr
,
std
::
shared_ptr
<
RTUDevice
>>
RTUDeviceMap
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
RTUDeviceMap
&
d
);
void
printMap
(
RTUDeviceMap
&
d
);
...
...
extensions/include/MTR.h
View file @
6c151936
...
...
@@ -4,6 +4,7 @@
// -----------------------------------------------------------------------------
#include <string>
#include <map>
#include <unordered_map>
#include <list>
#include <ostream>
#include <cstring>
...
...
@@ -103,7 +104,7 @@ namespace MTR
// ---------------------------
// вспомогательные функции и типы данных
typedef
std
::
list
<
ModbusRTU
::
ModbusData
>
DataList
;
typedef
std
::
map
<
ModbusRTU
::
ModbusData
,
DataList
>
DataMap
;
typedef
std
::
unordered_
map
<
ModbusRTU
::
ModbusData
,
DataList
>
DataMap
;
const
int
attempts
=
3
;
//
static
const
ModbusRTU
::
ModbusData
skip
[]
=
{
48
,
49
,
59
};
// registers which should not write
...
...
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