KiCad PCB EDA Suite
pin_numbers.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Simon Richter
5  * Copyright (C) 2021 KiCad Developers, see AUTHORS.TXT for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PIN_NUMBERS_H
26 #define PIN_NUMBERS_H
27 
28 #include <wx/string.h>
29 
30 #include <set>
31 
33 {
34 public:
35  wxString GetSummary() const;
36 
37  static int Compare( const wxString& lhs, const wxString& rhs );
38 
39 private:
40  struct less
41  {
42  bool operator()( const wxString& lhs, const wxString& rhs ) const
43  {
44  return Compare( lhs, rhs ) < 0;
45  }
46  };
47 
48  typedef std::set<wxString, less> container_type;
49 
50 public:
51  typedef container_type::value_type value_type;
52  typedef container_type::iterator iterator;
53  typedef container_type::const_iterator const_iterator;
54 
55  void insert( value_type const &v ) { pins.insert( v ); }
56  container_type::size_type size() const { return pins.size(); }
57 
58  iterator begin() { return pins.begin(); }
59  iterator end() { return pins.end(); }
60  const_iterator begin() const { return pins.begin(); }
61  const_iterator end() const { return pins.end(); }
62 
63 private:
65 };
66 
67 #endif
bool operator()(const wxString &lhs, const wxString &rhs) const
Definition: pin_numbers.h:42
const_iterator end() const
Definition: pin_numbers.h:61
container_type::const_iterator const_iterator
Definition: pin_numbers.h:53
container_type::iterator iterator
Definition: pin_numbers.h:52
wxString GetSummary() const
Definition: pin_numbers.cpp:71
static int Compare(const wxString &lhs, const wxString &rhs)
void insert(value_type const &v)
Definition: pin_numbers.h:55
iterator end()
Definition: pin_numbers.h:59
container_type::size_type size() const
Definition: pin_numbers.h:56
container_type::value_type value_type
Definition: pin_numbers.h:51
iterator begin()
Definition: pin_numbers.h:58
std::set< wxString, less > container_type
Definition: pin_numbers.h:48
const_iterator begin() const
Definition: pin_numbers.h:60
container_type pins
Definition: pin_numbers.h:64