KiCad PCB EDA Suite
cmp_tree_model_adapter.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) 2017 Chris Pavlina <pavlina.chris@gmail.com>
5  * Copyright (C) 2014 Henner Zeller <h.zeller@acm.org>
6  * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef _CMP_TREE_MODEL_ADAPTER_H
23 #define _CMP_TREE_MODEL_ADAPTER_H
24 
26 
27 class SYMBOL_LIB_TABLE;
28 
30 {
31 public:
32 
36  //typedef wxObjectDataPtr<CMP_TREE_MODEL_ADAPTER> PTR;
37 
43 
50  static PTR Create( SYMBOL_LIB_TABLE* aLibs );
51 
58  void AddLibrary( wxString const& aLibNickname ) override;
59 
67  void AddAliasList(
68  wxString const& aNodeName,
69  wxArrayString const& aAliasNameList ) override;
70 
72 protected:
73 
78 
79 private:
81 };
82 
83 #endif // _CMP_TREE_MODEL_ADAPTER_H
Adapter class in the component selector Model-View-Adapter (mediated MVC) architecture.
void AddLibrary(wxString const &aLibNickname) override
Add all the components and their aliases in this library.
~CMP_TREE_MODEL_ADAPTER()
Reference-counting container for a pointer to CMP_TREE_MODEL_ADAPTER.
static PTR Create(SYMBOL_LIB_TABLE *aLibs)
Factory function: create a model adapter in a reference-counting container.
wxObjectDataPtr< CMP_TREE_MODEL_ADAPTER_BASE > PTR
Reference-counting container for a pointer to CMP_TREE_MODEL_ADAPTER_BASE.
virtual void AddAliasList(wxString const &aNodeName, wxArrayString const &aAliasNameList)=0
Add the given list of components, by name.
void AddAliasList(wxString const &aNodeName, wxArrayString const &aAliasNameList) override
Add the given list of components, by name.
CMP_TREE_MODEL_ADAPTER(SYMBOL_LIB_TABLE *aLibs)
Constructor; takes a set of libraries to be included in the search.