KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eda_item.h File Reference
#include <deque>
#include <api/serializable.h>
#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...
 
struct  CompareByUuid
 Comparison functor for sorting EDA_ITEM pointers by their UUID. More...
 

Namespaces

namespace  google
 
namespace  google::protobuf
 

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.
 
typedef const INSPECTOR_FUNCINSPECTOR
 
typedef std::vector< EDA_ITEM * > EDA_ITEMS
 Define list of drawing items for screens.
 
typedef std::set< EDA_ITEM *, CompareByUuidEDA_ITEM_SET
 

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.
 

Typedef Documentation

◆ EDA_ITEM_SET

typedef std::set< EDA_ITEM*, CompareByUuid > EDA_ITEM_SET

Definition at line 538 of file eda_item.h.

◆ 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 536 of file eda_item.h.

◆ INSPECTOR

typedef const INSPECTOR_FUNC& INSPECTOR

Definition at line 82 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 79 of file eda_item.h.

Enumeration Type Documentation

◆ INSPECT_RESULT

enum class INSPECT_RESULT
strong
Enumerator
QUIT 
CONTINUE 

Definition at line 42 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 511 of file eda_item.h.

References EDA_ITEM::Clone().