KiCad PCB EDA Suite
eda_item.h File Reference
#include <deque>
#include <core/typeinfo.h>
#include <eda_item_flags.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< SEARCH_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  SEARCH_RESULT { SEARCH_RESULT::QUIT, SEARCH_RESULT::CONTINUE }
 
enum  FIND_REPLACE_FLAGS {
  FR_CURRENT_SHEET_ONLY = 0x4 << 1, FR_SEARCH_ALL_FIELDS = 0x4 << 2, FR_SEARCH_ALL_PINS = 0x4 << 3, FR_MATCH_WILDCARD = 0x4 << 4,
  FR_SEARCH_WRAP = 0x4 << 5, FR_SEARCH_REPLACE = 0x4 << 7, FR_REPLACE_ITEM_FOUND = 0x4 << 8, FR_REPLACE_REFERENCES = 0x4 << 9
}
 Additional flag values wxFindReplaceData::m_Flags. More...
 

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

◆ INSPECTOR

typedef const INSPECTOR_FUNC& INSPECTOR

Definition at line 94 of file eda_item.h.

◆ INSPECTOR_FUNC

typedef std::function< SEARCH_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 69 of file eda_item.h.

Enumeration Type Documentation

◆ FIND_REPLACE_FLAGS

Additional flag values wxFindReplaceData::m_Flags.

Enumerator
FR_CURRENT_SHEET_ONLY 
FR_SEARCH_ALL_FIELDS 
FR_SEARCH_ALL_PINS 
FR_MATCH_WILDCARD 
FR_SEARCH_WRAP 
FR_SEARCH_REPLACE 
FR_REPLACE_ITEM_FOUND 
FR_REPLACE_REFERENCES 

Definition at line 51 of file eda_item.h.

52 {
53  // The last wxFindReplaceFlag enum is wxFR_MATCHCASE = 0x4.
54  FR_CURRENT_SHEET_ONLY = 0x4 << 1, // Search the current sheet only.
55  FR_SEARCH_ALL_FIELDS = 0x4 << 2, // Search hidden fields too.
56  FR_SEARCH_ALL_PINS = 0x4 << 3, // Search pin name and number.
57  FR_MATCH_WILDCARD = 0x4 << 4, // Use simple wild card matching (* & ?).
58  FR_SEARCH_WRAP = 0x4 << 5, // Wrap around the start or end of search.
59  FR_SEARCH_REPLACE = 0x4 << 7, // Search for a item that has replaceable text.
60  FR_REPLACE_ITEM_FOUND = 0x4 << 8, // Indicates an item with replaceable text has
61  // been found.
62  FR_REPLACE_REFERENCES = 0x4 << 9 // Don't replace in references.
63 };

◆ SEARCH_RESULT

enum SEARCH_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 498 of file eda_item.h.

498 { 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:83

References EDA_ITEM::Clone().