KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board_item_container.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) 2016 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef BOARD_ITEM_CONTAINER_H
24#define BOARD_ITEM_CONTAINER_H
25
26#include <board_item.h>
27
35
36enum class REMOVE_MODE
37{
40};
41
48{
49public:
51 : BOARD_ITEM( aParent, aType )
52 {
53 }
54
61 virtual void Add( BOARD_ITEM* aItem, ADD_MODE aMode = ADD_MODE::INSERT,
62 bool aSkipConnectivity = false ) = 0;
63
67 virtual void Remove( BOARD_ITEM* aItem, REMOVE_MODE aMode = REMOVE_MODE::NORMAL ) = 0;
68
72 virtual void Delete( BOARD_ITEM* aItem )
73 {
74 Remove( aItem );
75 delete aItem;
76 }
77};
78
79#endif /* BOARD_ITEM_CONTAINER_H */
virtual void Delete(BOARD_ITEM *aItem)
Removes an item from the container and deletes it.
BOARD_ITEM_CONTAINER(BOARD_ITEM *aParent, KICAD_T aType)
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
virtual void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false)=0
Adds an item to the container.
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:82
NORMAL
Follows standard pretty-printing rules.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71