2016-01-13 19:13:38 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Simon Richter
|
2021-10-06 02:46:53 +00:00
|
|
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.TXT for contributors.
|
2016-01-13 19:13:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 3
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2021-07-28 18:50:17 +00:00
|
|
|
#ifndef PIN_NUMBERS_H
|
|
|
|
#define PIN_NUMBERS_H
|
2016-01-13 19:13:38 +00:00
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
2021-07-28 18:50:17 +00:00
|
|
|
class PIN_NUMBERS
|
2016-01-13 19:13:38 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-01-13 19:17:54 +00:00
|
|
|
wxString GetSummary() const;
|
|
|
|
|
2021-07-28 18:50:17 +00:00
|
|
|
static int Compare( const wxString& lhs, const wxString& rhs );
|
2016-01-13 19:13:38 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct less
|
|
|
|
{
|
2021-07-28 18:50:17 +00:00
|
|
|
bool operator()( const wxString& lhs, const wxString& rhs ) const
|
2016-01-13 19:13:38 +00:00
|
|
|
{
|
|
|
|
return Compare( lhs, rhs ) < 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-07-28 18:50:17 +00:00
|
|
|
typedef std::set<wxString, less> container_type;
|
2016-01-13 19:13:38 +00:00
|
|
|
|
2022-04-19 21:43:32 +00:00
|
|
|
static wxString getNextSymbol( const wxString& str, wxString::size_type& cursor );
|
|
|
|
|
2016-01-13 19:13:38 +00:00
|
|
|
public:
|
|
|
|
typedef container_type::value_type value_type;
|
|
|
|
typedef container_type::iterator iterator;
|
|
|
|
typedef container_type::const_iterator const_iterator;
|
|
|
|
|
|
|
|
void insert( value_type const &v ) { pins.insert( v ); }
|
|
|
|
container_type::size_type size() const { return pins.size(); }
|
|
|
|
|
|
|
|
iterator begin() { return pins.begin(); }
|
|
|
|
iterator end() { return pins.end(); }
|
|
|
|
const_iterator begin() const { return pins.begin(); }
|
|
|
|
const_iterator end() const { return pins.end(); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
container_type pins;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|