KiCad PCB EDA Suite
eda_item.h File Reference
#include <deque>
#include <core/typeinfo.h>
#include <eda_item_flags.h>
#include <eda_search_data.h>
#include <view/view_item.h>
#include <kiid.h>

Go to the source code of this file.

Classes

class  EDA_ITEM
 A base class for most all the KiCad significant classes used in schematics and boards. More...
 

Typedefs

typedef std::function< INSPECT_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
 Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T objects. More...
 
typedef const INSPECTOR_FUNCINSPECTOR
 
typedef std::vector< EDA_ITEM * > EDA_ITEMS
 Define list of drawing items for screens. More...
 

Enumerations

enum class  INSPECT_RESULT { QUIT , CONTINUE }
 

Functions

EDA_ITEMnew_clone (const EDA_ITEM &aItem)
 Provide cloning capabilities for all Boost pointer containers of EDA_ITEM pointers. More...
 

Typedef Documentation

◆ EDA_ITEMS

typedef std::vector< EDA_ITEM* > EDA_ITEMS

Define list of drawing items for screens.

The standard C++ container was chosen so the pointer can be removed from a list without it being destroyed.

Definition at line 524 of file eda_item.h.

◆ INSPECTOR

typedef const INSPECTOR_FUNC& INSPECTOR

Definition at line 78 of file eda_item.h.

◆ INSPECTOR_FUNC

typedef std::function< INSPECT_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC

Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T objects.

Provide an implementation as needed to inspect EDA_ITEMs visited via EDA_ITEM::Visit() and EDA_ITEM::IterateForward().

FYI the std::function may hold a lambda, std::bind, pointer to func, or ptr to member function, per modern C++. It is used primarily for searching, but not limited to that. It can also collect or modify the scanned objects. 'Capturing' lambdas are particularly convenient because they can use context and this often means aTestData is not used.

Parameters
aItemAn EDA_ITEM to examine.
aTestDatais arbitrary data needed by the inspector to determine if the EDA_ITEM under test meets its match criteria, and is often NULL with the advent of capturing lambdas.
Returns
A #SEARCH_RESULT type #SEARCH_QUIT if the iterator function is to stop the scan, else #SEARCH_CONTINUE; std::function passed to nested users by ref, avoids copying std::function.

Definition at line 75 of file eda_item.h.

Enumeration Type Documentation

◆ INSPECT_RESULT

enum class INSPECT_RESULT
strong
Enumerator
QUIT 
CONTINUE 

Definition at line 41 of file eda_item.h.

Function Documentation

◆ new_clone()

EDA_ITEM * new_clone ( const EDA_ITEM aItem)
inline

Provide cloning capabilities for all Boost pointer containers of EDA_ITEM pointers.

Parameters
aItemEDA_ITEM to clone.
Returns
Clone of aItem.

Definition at line 515 of file eda_item.h.

515{ return aItem.Clone(); }
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82

References EDA_ITEM::Clone().