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
da8e9e9b
Commit
da8e9e9b
authored
Feb 17, 2015
by
Tomasz Włostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Remove() and CountTypes() methods in COLLECTOR class
parent
f0c913c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
class_collector.h
include/class_collector.h
+34
-0
No files found.
include/class_collector.h
View file @
da8e9e9b
...
...
@@ -129,6 +129,23 @@ public:
m_List
.
erase
(
m_List
.
begin
()
+
aIndex
);
}
/**
* Function Remove
* removes the item aItem (if exists in the collector).
* @param aItem the item to be removed.
*/
void
Remove
(
const
EDA_ITEM
*
aItem
)
{
for
(
size_t
i
=
0
;
i
<
m_List
.
size
();
i
++
)
{
if
(
m_List
[
i
]
==
aItem
)
{
m_List
.
erase
(
m_List
.
begin
()
+
i
);
return
;
}
}
}
/**
* Function operator[int]
* is used for read only access and returns the object at \a aIndex.
...
...
@@ -223,6 +240,23 @@ public:
else
return
false
;
}
/**
* Function CountType
* counts the number of items matching aType
* @param aType type we are interested in
* @return number of occurences
*/
int
CountType
(
KICAD_T
aType
)
{
int
cnt
=
0
;
for
(
size_t
i
=
0
;
i
<
m_List
.
size
();
i
++
)
{
if
(
m_List
[
i
]
->
Type
()
==
aType
)
cnt
++
;
}
return
cnt
;
}
/**
* Function Collect
...
...
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