2009-08-17 02:59:38 +00:00
|
|
|
/*
|
2011-09-30 18:15:37 +00:00
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
2009-08-17 02:59:38 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
|
|
|
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@inpg.fr
|
2020-07-08 18:29:16 +00:00
|
|
|
* Copyright (C) 2009-2020 KiCad Developers, see change_log.txt for contributors.
|
2009-08-17 02:59: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 2
|
|
|
|
* 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
|
|
|
|
*/
|
2009-08-10 02:22:56 +00:00
|
|
|
|
2009-07-18 11:44:19 +00:00
|
|
|
#ifndef CLASS_NETCLASS_H
|
|
|
|
#define CLASS_NETCLASS_H
|
|
|
|
|
2011-09-24 18:33:28 +00:00
|
|
|
|
2020-07-08 02:21:45 +00:00
|
|
|
#include <gal/color4d.h>
|
2020-10-06 09:22:54 +00:00
|
|
|
#include <core/optional.h>
|
2020-10-24 03:33:04 +00:00
|
|
|
#include <macros_swig.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2011-09-24 18:33:28 +00:00
|
|
|
class LINE_READER;
|
2011-09-23 13:57:12 +00:00
|
|
|
class BOARD;
|
2014-05-13 09:22:51 +00:00
|
|
|
class BOARD_DESIGN_SETTINGS;
|
2020-07-08 18:29:16 +00:00
|
|
|
using KIGFX::COLOR4D;
|
2011-09-23 13:57:12 +00:00
|
|
|
|
|
|
|
|
2016-09-20 15:59:43 +00:00
|
|
|
DECL_SET_FOR_SWIG( STRINGSET, wxString )
|
|
|
|
|
|
|
|
|
2009-08-10 02:22:56 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* A collection of nets and the parameters used to route or test these nets.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2009-08-17 02:59:38 +00:00
|
|
|
class NETCLASS
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2020-07-08 18:29:16 +00:00
|
|
|
public:
|
2016-09-20 15:59:43 +00:00
|
|
|
static const char Default[]; ///< the name of the default NETCLASS
|
2009-08-10 02:22:56 +00:00
|
|
|
|
2009-09-10 15:22:26 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Create a NETCLASS instance with \a aName.
|
|
|
|
*
|
|
|
|
* @param aName is the name of this new netclass.
|
2009-09-10 15:22:26 +00:00
|
|
|
*/
|
2014-05-13 09:22:51 +00:00
|
|
|
NETCLASS( const wxString& aName );
|
2009-09-10 15:22:26 +00:00
|
|
|
|
2009-07-18 11:44:19 +00:00
|
|
|
~NETCLASS();
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
wxString GetClass() const
|
|
|
|
{
|
|
|
|
return wxT( "NETCLASS" );
|
|
|
|
}
|
|
|
|
|
2021-08-22 23:56:41 +00:00
|
|
|
const wxString GetName() const { return m_Name; }
|
2011-11-30 07:43:46 +00:00
|
|
|
void SetName( const wxString& aName ) { m_Name = aName; }
|
|
|
|
|
2009-08-10 02:22:56 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Return the number of nets in this NETCLASS, i.e. using these rules.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2009-08-17 02:59:38 +00:00
|
|
|
unsigned GetCount() const
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2009-08-17 02:59:38 +00:00
|
|
|
return m_Members.size();
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Empties the collection of members.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
|
|
|
void Clear()
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2009-08-17 02:59:38 +00:00
|
|
|
m_Members.clear();
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Adds \a aNetname to this NETCLASS if it is not already in this NETCLASS.
|
|
|
|
*
|
2009-08-17 02:59:38 +00:00
|
|
|
* It is harmless to try and add a second identical name.
|
|
|
|
*/
|
|
|
|
void Add( const wxString& aNetname )
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2009-08-17 02:59:38 +00:00
|
|
|
m_Members.insert( aNetname );
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
typedef STRINGSET::iterator iterator;
|
|
|
|
iterator begin() { return m_Members.begin(); }
|
|
|
|
iterator end() { return m_Members.end(); }
|
2009-07-18 11:44:19 +00:00
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
typedef STRINGSET::const_iterator const_iterator;
|
|
|
|
const_iterator begin() const { return m_Members.begin(); }
|
|
|
|
const_iterator end() const { return m_Members.end(); }
|
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Remove NET \a aName from the collection of members.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
|
|
|
void Remove( iterator aName )
|
|
|
|
{
|
|
|
|
m_Members.erase( aName );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Remove NET \a aName from the collection of members.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
|
|
|
void Remove( const wxString& aName )
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2009-08-17 02:59:38 +00:00
|
|
|
m_Members.erase( aName );
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 15:59:43 +00:00
|
|
|
STRINGSET& NetNames() { return m_Members; } ///< for SWIG
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
const wxString& GetDescription() const { return m_Description; }
|
2020-05-29 12:36:45 +00:00
|
|
|
void SetDescription( const wxString& aDesc ) { m_Description = aDesc; }
|
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasClearance() const { return (bool) m_Clearance; }
|
|
|
|
int GetClearance() const { return m_Clearance.value_or(-1); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetClearance( int aClearance ) { m_Clearance = aClearance; }
|
2009-09-10 15:22:26 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasTrackWidth() const { return (bool) m_TrackWidth; }
|
|
|
|
int GetTrackWidth() const { return m_TrackWidth.value_or( -1 ); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
|
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasViaDiameter() const { return (bool) m_ViaDia; }
|
|
|
|
int GetViaDiameter() const { return m_ViaDia.value_or( -1 ); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetViaDiameter( int aDia ) { m_ViaDia = aDia; }
|
2009-08-17 02:59:38 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
int HasViaDrill() const { return (bool) m_ViaDrill; }
|
|
|
|
int GetViaDrill() const { return m_ViaDrill.value_or( -1 ); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetViaDrill( int aSize ) { m_ViaDrill = aSize; }
|
2009-08-17 02:59:38 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasuViaDiameter() const { return (bool) m_uViaDia; }
|
|
|
|
int GetuViaDiameter() const { return m_uViaDia.value_or( -1 ); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetuViaDiameter( int aSize ) { m_uViaDia = aSize; }
|
2009-08-17 02:59:38 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasuViaDrill() const { return (bool) m_uViaDrill; }
|
|
|
|
int GetuViaDrill() const { return m_uViaDrill.value_or( -1 ); }
|
2011-11-24 17:32:51 +00:00
|
|
|
void SetuViaDrill( int aSize ) { m_uViaDrill = aSize; }
|
2011-11-11 17:44:20 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasDiffPairWidth() const { return (bool) m_diffPairWidth; }
|
|
|
|
int GetDiffPairWidth() const { return m_diffPairWidth.value_or( -1 ); }
|
2018-04-28 15:22:25 +00:00
|
|
|
void SetDiffPairWidth( int aSize ) { m_diffPairWidth = aSize; }
|
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasDiffPairGap() const { return (bool) m_diffPairGap; }
|
|
|
|
int GetDiffPairGap() const { return m_diffPairGap.value_or( -1 ); }
|
2018-04-28 15:22:25 +00:00
|
|
|
void SetDiffPairGap( int aSize ) { m_diffPairGap = aSize; }
|
2016-08-15 15:16:49 +00:00
|
|
|
|
2020-10-06 09:22:54 +00:00
|
|
|
bool HasDiffPairViaGap() const { return (bool) m_diffPairViaGap; }
|
|
|
|
int GetDiffPairViaGap() const { return m_diffPairViaGap.value_or( -1 ); }
|
2018-04-28 15:22:25 +00:00
|
|
|
void SetDiffPairViaGap( int aSize ) { m_diffPairViaGap = aSize; }
|
2016-08-15 15:16:49 +00:00
|
|
|
|
2020-07-08 18:29:16 +00:00
|
|
|
COLOR4D GetPcbColor() const { return m_PcbColor; }
|
|
|
|
void SetPcbColor( const COLOR4D& aColor ) { m_PcbColor = aColor; }
|
2020-07-08 02:21:45 +00:00
|
|
|
|
2020-07-08 18:29:16 +00:00
|
|
|
int GetWireWidth() const { return m_wireWidth; }
|
|
|
|
void SetWireWidth( int aWidth ) { m_wireWidth = aWidth; }
|
|
|
|
|
|
|
|
int GetBusWidth() const { return m_busWidth; }
|
|
|
|
void SetBusWidth( int aWidth ) { m_busWidth = aWidth; }
|
2014-05-13 09:22:51 +00:00
|
|
|
|
2020-07-08 18:29:16 +00:00
|
|
|
COLOR4D GetSchematicColor() const { return m_schematicColor; }
|
|
|
|
void SetSchematicColor( COLOR4D aColor ) { m_schematicColor = aColor; }
|
|
|
|
|
|
|
|
int GetLineStyle() const { return m_lineStyle; }
|
|
|
|
void SetLineStyle( int aStyle ) { m_lineStyle = aStyle; }
|
2012-04-01 20:51:56 +00:00
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
#if defined(DEBUG)
|
2017-02-23 19:57:20 +00:00
|
|
|
void Show( int nestLevel, std::ostream& os ) const;
|
2009-08-17 02:59:38 +00:00
|
|
|
#endif
|
2020-12-19 23:29:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
wxString m_Name; ///< Name of the net class
|
|
|
|
wxString m_Description; ///< what this NETCLASS is for.
|
|
|
|
|
|
|
|
STRINGSET m_Members; ///< names of NET members of this class
|
|
|
|
|
|
|
|
/// The units on these parameters is Internal Units (1 nm)
|
|
|
|
|
|
|
|
OPT<int> m_Clearance; ///< clearance when routing
|
|
|
|
|
|
|
|
OPT<int> m_TrackWidth; ///< track width used to route NETs in this NETCLASS
|
|
|
|
OPT<int> m_ViaDia; ///< via diameter
|
|
|
|
OPT<int> m_ViaDrill; ///< via drill hole diameter
|
|
|
|
|
|
|
|
OPT<int> m_uViaDia; ///< microvia diameter
|
|
|
|
OPT<int> m_uViaDrill; ///< microvia drill hole diameter
|
|
|
|
|
|
|
|
OPT<int> m_diffPairWidth;
|
|
|
|
OPT<int> m_diffPairGap;
|
|
|
|
OPT<int> m_diffPairViaGap;
|
|
|
|
|
|
|
|
int m_wireWidth;
|
|
|
|
int m_busWidth;
|
|
|
|
COLOR4D m_schematicColor;
|
|
|
|
int m_lineStyle;
|
|
|
|
|
|
|
|
COLOR4D m_PcbColor; ///< Optional color override for this netclass (PCB context)
|
2009-07-18 11:44:19 +00:00
|
|
|
};
|
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
2016-07-19 20:34:09 +00:00
|
|
|
DECL_SPTR_FOR_SWIG( NETCLASSPTR, NETCLASS )
|
2017-11-02 20:41:29 +00:00
|
|
|
DECL_MAP_FOR_SWIG( NETCLASS_MAP, wxString, NETCLASSPTR )
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
2009-08-10 02:22:56 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* A container for NETCLASS instances.
|
|
|
|
*
|
|
|
|
* It owns all its NETCLASSes. This container will always have a default NETCLASS with the
|
|
|
|
* name given by const NETCLASS::Default.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2009-08-17 02:59:38 +00:00
|
|
|
class NETCLASSES
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-05-13 09:22:51 +00:00
|
|
|
NETCLASSES();
|
2009-08-17 02:59:38 +00:00
|
|
|
~NETCLASSES();
|
2009-08-10 02:22:56 +00:00
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Destroy any contained NETCLASS instances except the default one, and clears any
|
|
|
|
* members from the default one.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
2014-05-20 09:29:37 +00:00
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
m_NetClasses.clear();
|
2020-08-08 14:14:41 +00:00
|
|
|
m_default->Clear();
|
2014-05-20 09:29:37 +00:00
|
|
|
}
|
2009-08-17 02:59:38 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
typedef NETCLASS_MAP::iterator iterator;
|
2009-08-17 02:59:38 +00:00
|
|
|
iterator begin() { return m_NetClasses.begin(); }
|
|
|
|
iterator end() { return m_NetClasses.end(); }
|
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
typedef NETCLASS_MAP::const_iterator const_iterator;
|
2009-08-17 02:59:38 +00:00
|
|
|
const_iterator begin() const { return m_NetClasses.begin(); }
|
|
|
|
const_iterator end() const { return m_NetClasses.end(); }
|
2009-08-10 02:22:56 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* @return the number of netclasses excluding the default one.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2009-08-17 02:59:38 +00:00
|
|
|
unsigned GetCount() const
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2009-08-17 02:59:38 +00:00
|
|
|
return m_NetClasses.size();
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
/**
|
|
|
|
* @return the default net class.
|
|
|
|
*/
|
2017-08-31 15:45:17 +00:00
|
|
|
NETCLASSPTR GetDefault() const
|
2009-07-18 11:44:19 +00:00
|
|
|
{
|
2017-08-31 15:45:17 +00:00
|
|
|
return m_default;
|
2009-07-18 11:44:19 +00:00
|
|
|
}
|
|
|
|
|
2020-05-18 00:20:16 +00:00
|
|
|
NETCLASS* GetDefaultPtr() const
|
|
|
|
{
|
|
|
|
return m_default.get();
|
|
|
|
}
|
|
|
|
|
2009-08-17 02:59:38 +00:00
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Add \a aNetclass and puts it into this NETCLASSES container.
|
|
|
|
*
|
2009-08-17 02:59:38 +00:00
|
|
|
* @param aNetclass is netclass to add
|
2009-09-10 15:22:26 +00:00
|
|
|
* @return true if the name within aNetclass is unique and it could be inserted OK,
|
2020-12-19 23:29:10 +00:00
|
|
|
* else false because the name was not unique.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
2017-09-23 09:20:10 +00:00
|
|
|
bool Add( const NETCLASSPTR& aNetclass );
|
2009-08-17 02:59:38 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Remove a #NETCLASS from this container but does not destroy/delete it.
|
|
|
|
*
|
2009-08-17 02:59:38 +00:00
|
|
|
* @param aNetName is the name of the net to delete, and it may not be NETCLASS::Default.
|
2020-12-19 23:29:10 +00:00
|
|
|
* @return a pointer to the #NETCLASS associated with \a aNetName if found and removed,
|
|
|
|
* else NULL.
|
2009-08-17 02:59:38 +00:00
|
|
|
*/
|
2014-05-20 09:29:37 +00:00
|
|
|
NETCLASSPTR Remove( const wxString& aNetName );
|
2009-08-17 02:59:38 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-19 23:29:10 +00:00
|
|
|
* Search this container for a NETCLASS given by \a aName.
|
|
|
|
*
|
|
|
|
* @param aName is the name of the #NETCLASS to search for.
|
|
|
|
* @return a pointer to the #NETCLASS if found, else NULL.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2014-05-20 09:29:37 +00:00
|
|
|
NETCLASSPTR Find( const wxString& aName ) const;
|
2009-07-18 11:44:19 +00:00
|
|
|
|
2016-09-20 15:59:43 +00:00
|
|
|
/// Provide public access to m_NetClasses so it gets swigged.
|
|
|
|
NETCLASS_MAP& NetClasses() { return m_NetClasses; }
|
2020-12-19 23:29:10 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
NETCLASS_MAP m_NetClasses; // All the netclasses EXCEPT the default one
|
|
|
|
NETCLASSPTR m_default;
|
2009-07-18 11:44:19 +00:00
|
|
|
};
|
|
|
|
|
2009-08-10 02:22:56 +00:00
|
|
|
#endif // CLASS_NETCLASS_H
|