Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
f7ecc749
Commit
f7ecc749
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restored std::map in TOOL_MANAGER.
parent
5ce29330
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
tool_manager.cpp
common/tool/tool_manager.cpp
+3
-3
tool_manager.h
include/tool/tool_manager.h
+6
-6
No files found.
common/tool/tool_manager.cpp
View file @
f7ecc749
...
...
@@ -109,7 +109,7 @@ TOOL_MANAGER::TOOL_MANAGER() :
TOOL_MANAGER
::~
TOOL_MANAGER
()
{
boost
::
unordered_
map
<
TOOL_BASE
*
,
TOOL_STATE
*>::
iterator
it
,
it_end
;
std
::
map
<
TOOL_BASE
*
,
TOOL_STATE
*>::
iterator
it
,
it_end
;
for
(
it
=
m_toolState
.
begin
(),
it_end
=
m_toolState
.
end
();
it
!=
it_end
;
++
it
)
{
...
...
@@ -276,7 +276,7 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
TOOL_BASE
*
TOOL_MANAGER
::
FindTool
(
int
aId
)
const
{
boost
::
unordered_
map
<
TOOL_ID
,
TOOL_STATE
*>::
const_iterator
it
=
m_toolIdIndex
.
find
(
aId
);
std
::
map
<
TOOL_ID
,
TOOL_STATE
*>::
const_iterator
it
=
m_toolIdIndex
.
find
(
aId
);
if
(
it
!=
m_toolIdIndex
.
end
()
)
return
it
->
second
->
theTool
;
...
...
@@ -287,7 +287,7 @@ TOOL_BASE* TOOL_MANAGER::FindTool( int aId ) const
TOOL_BASE
*
TOOL_MANAGER
::
FindTool
(
const
std
::
string
&
aName
)
const
{
boost
::
unordered_
map
<
std
::
string
,
TOOL_STATE
*>::
const_iterator
it
=
m_toolNameIndex
.
find
(
aName
);
std
::
map
<
std
::
string
,
TOOL_STATE
*>::
const_iterator
it
=
m_toolNameIndex
.
find
(
aName
);
if
(
it
!=
m_toolNameIndex
.
end
()
)
return
it
->
second
->
theTool
;
...
...
include/tool/tool_manager.h
View file @
f7ecc749
...
...
@@ -28,7 +28,7 @@
#include <deque>
#include <typeinfo>
#include <
boost/unordered_map.hp
p>
#include <
ma
p>
#include <math/vector2d.h>
...
...
@@ -143,7 +143,7 @@ public:
template
<
typename
T
>
T
*
GetTool
()
{
boost
::
unordered_
map
<
const
char
*
,
TOOL_BASE
*>::
iterator
tool
=
m_toolTypes
.
find
(
typeid
(
T
).
name
()
);
std
::
map
<
const
char
*
,
TOOL_BASE
*>::
iterator
tool
=
m_toolTypes
.
find
(
typeid
(
T
).
name
()
);
if
(
tool
!=
m_toolTypes
.
end
()
)
return
static_cast
<
T
*>
(
tool
->
second
);
...
...
@@ -360,16 +360,16 @@ private:
bool
isActive
(
TOOL_BASE
*
aTool
);
/// Index of registered tools current states, associated by tools' objects.
boost
::
unordered_
map
<
TOOL_BASE
*
,
TOOL_STATE
*>
m_toolState
;
std
::
map
<
TOOL_BASE
*
,
TOOL_STATE
*>
m_toolState
;
/// Index of the registered tools current states, associated by tools' names.
boost
::
unordered_
map
<
std
::
string
,
TOOL_STATE
*>
m_toolNameIndex
;
std
::
map
<
std
::
string
,
TOOL_STATE
*>
m_toolNameIndex
;
/// Index of the registered tools to easily lookup by their type.
boost
::
unordered_
map
<
const
char
*
,
TOOL_BASE
*>
m_toolTypes
;
std
::
map
<
const
char
*
,
TOOL_BASE
*>
m_toolTypes
;
/// Index of the registered tools current states, associated by tools' ID numbers.
boost
::
unordered_
map
<
TOOL_ID
,
TOOL_STATE
*>
m_toolIdIndex
;
std
::
map
<
TOOL_ID
,
TOOL_STATE
*>
m_toolIdIndex
;
/// Stack of the active tools
std
::
deque
<
TOOL_ID
>
m_activeTools
;
...
...
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