KiCad PCB EDA Suite
Loading...
Searching...
No Matches
from_to_cache.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 The KiCad Developers.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef FROM_TO_CACHE_H
21#define FROM_TO_CACHE_H
22
23#include <list>
24#include <mutex>
25#include <set>
26
27class PAD;
29
31{
32public:
33
35 {
36 wxString name;
38 };
39
40 struct FT_PATH
41 {
42 int net;
45 wxString fromName, toName;
48 std::set<BOARD_CONNECTED_ITEM*> pathItems;
49 };
50
51 FROM_TO_CACHE( BOARD* aBoard = nullptr ) :
52 m_board( aBoard )
53 {
54 }
55
57 {
58 }
59
60 void Rebuild( BOARD* aBoard );
61 bool IsOnFromToPath( BOARD_CONNECTED_ITEM* aItem, const wxString& aFrom, const wxString& aTo );
62
63 FT_PATH* QueryFromToPath( const std::set<BOARD_CONNECTED_ITEM*>& aItems );
64
65private:
66 int cacheFromToPaths( const wxString& aFrom, const wxString& aTo );
67 void buildEndpointList();
68
69private:
70 std::vector<FT_ENDPOINT> m_ftEndpoints;
71 std::list<FT_PATH> m_ftPaths;
72 std::recursive_mutex m_mutex;
73
75};
76
77#endif
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:411
int cacheFromToPaths(const wxString &aFrom, const wxString &aTo)
FROM_TO_CACHE(BOARD *aBoard=nullptr)
FT_PATH * QueryFromToPath(const std::set< BOARD_CONNECTED_ITEM * > &aItems)
std::recursive_mutex m_mutex
bool IsOnFromToPath(BOARD_CONNECTED_ITEM *aItem, const wxString &aFrom, const wxString &aTo)
std::vector< FT_ENDPOINT > m_ftEndpoints
void buildEndpointList()
void Rebuild(BOARD *aBoard)
std::list< FT_PATH > m_ftPaths
Definition pad.h:61
std::set< BOARD_CONNECTED_ITEM * > pathItems