![]() |
KiCad PCB EDA Suite
|
Functions | |
template<typename _Type , typename _Function > | |
void | run_on_pair (std::pair< _Type, _Type > &__pair, _Function __f) |
Apply a function to the first and second element of a std::pair. More... | |
template<typename _InputIterator , typename _Function > | |
void | adjacent_pairs (_InputIterator __first, _InputIterator __last, _Function __f) |
Apply a function to every sequential pair of elements of a sequence. More... | |
template<typename _InputIterator , typename _Function > | |
void | for_all_pairs (_InputIterator __first, _InputIterator __last, _Function __f) |
Apply a function to every possible pair of elements of a sequence. More... | |
template<class _Container , typename _Value > | |
bool | contains (const _Container &__container, _Value __value) |
Returns true if the container contains the given value. More... | |
template<typename _Type , typename _Value > | |
bool | pair_contains (const std::pair< _Type, _Type > __pair, _Value __value) |
Returns true if either of the elements in an std::pair contains the given value. More... | |
template<class T > | |
bool | within_wrapped_range (T __val, T __minval, T __maxval, T __wrap) |
Test if __val lies within __minval and __maxval in a wrapped range. More... | |
template<class _Container , typename _Value > | |
void | delete_matching (_Container &__c, _Value __value) |
Covers for the horrifically named std::remove and std::remove_if (neither of which remove anything). More... | |
template<class _Container , class _Function > | |
void | delete_if (_Container &__c, _Function &&__f) |
Deletes all values from __c for which __f returns true. More... | |
void alg::adjacent_pairs | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Function | __f | ||
) |
Apply a function to every sequential pair of elements of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__f | A unary function object. |
Applies the function object __f
to each sequential pair of elements in the range [first,last).
__f
must not modify the order of the sequence. If __f
has a return value it is ignored.
Definition at line 61 of file kicad_algo.h.
bool alg::contains | ( | const _Container & | __container, |
_Value | __value | ||
) |
Returns true if the container contains the given value.
Definition at line 99 of file kicad_algo.h.
Referenced by PROJECT_TREE_PANE::addItemToProjectTree(), BOARD::AddListener(), BUS_ALIAS::Contains(), PNS::ITEM_SET::Contains(), CN_CLUSTER::Contains(), PNS::LINK_HOLDER::ContainsLink(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_TOOL::DoDelete(), EDIT_TOOL::Drag(), PANEL_SETUP_LAYERS::getNonRemovableLayers(), PANEL_SETUP_LAYERS::getRemovedLayersWithItems(), GRAPHICS_IMPORT_MGR::GRAPHICS_IMPORT_MGR(), SYMBOL_EDIT_FRAME::HardRedraw(), DIALOG_EXPORT_SVG::initDialog(), TOOL_MANAGER::isActive(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), PNS::TOOL_BASE::pickSingleItem(), PCB_CONTROL::placeBoardItems(), DIALOG_CHANGE_SYMBOLS::processSymbol(), EE_SELECTION_TOOL::RemoveItemsFromSel(), PCB_SELECTION_TOOL::selectAllItemsOnSheet(), and DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow().
void alg::delete_if | ( | _Container & | __c, |
_Function && | __f | ||
) |
Deletes all values from __c for which __f returns true.
Definition at line 173 of file kicad_algo.h.
Referenced by CONNECTION_GRAPH::buildConnectionGraph(), FABMASTER::detectType(), ZONE_FILLER::Fill(), FABMASTER::getColFromName(), COMMIT::makeEntry(), DIALOG_CHOOSE_SYMBOL::OnFootprintSelected(), SCH_BASE_FRAME::PickSymbolFromLibTree(), COLLECTOR::Remove(), and DIALOG_SPICE_MODEL::TransferDataFromWindow().
void alg::delete_matching | ( | _Container & | __c, |
_Value | __value | ||
) |
Covers for the horrifically named std::remove and std::remove_if (neither of which remove anything).
Deletes all values from __c which match __value.
Definition at line 164 of file kicad_algo.h.
Referenced by DIALOG_NET_INSPECTOR::buildNetsList(), SCH_FIELD::DoHypertextMenu(), CONNECTION_GRAPH::processSubGraphs(), CONNECTION_GRAPH::recacheSubgraphName(), KIGFX::VIEW_GROUP::Remove(), BOARD::Remove(), and SCH_GLOBALLABEL::ResolveTextVar().
void alg::for_all_pairs | ( | _InputIterator | __first, |
_InputIterator | __last, | ||
_Function | __f | ||
) |
Apply a function to every possible pair of elements of a sequence.
__first | An input iterator. |
__last | An input iterator. |
__f | A unary function object. |
Applies the function object __f
to every possible pair of elements in the range [first,last).
__f
must not modify the order of the sequence. If __f
has a return value it is ignored.
Definition at line 83 of file kicad_algo.h.
Referenced by SCH_EDIT_FRAME::DeleteJunction(), and SCH_EDIT_FRAME::SchematicCleanUp().
bool alg::pair_contains | ( | const std::pair< _Type, _Type > | __pair, |
_Value | __value | ||
) |
Returns true if either of the elements in an std::pair contains the given value.
__value
is contained in __pair
Definition at line 112 of file kicad_algo.h.
Referenced by SHAPE_LINE_CHAIN::NextShape().
void alg::run_on_pair | ( | std::pair< _Type, _Type > & | __pair, |
_Function | __f | ||
) |
Apply a function to the first and second element of a std::pair.
__pair | A pair of elements (both elements must be the same type). |
__f | A unary function object. |
Applies the function object __f
to __pair.first
and __pair.second
If __f
has a return value it is ignored.
Definition at line 44 of file kicad_algo.h.
Referenced by SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::convertArc(), SHAPE_LINE_CHAIN::Insert(), SHAPE_LINE_CHAIN::Remove(), SHAPE_LINE_CHAIN::Replace(), SHAPE_LINE_CHAIN::Reverse(), SHAPE_LINE_CHAIN::SetPoint(), and SHAPE_LINE_CHAIN::splitArc().
bool alg::within_wrapped_range | ( | T | __val, |
T | __minval, | ||
T | __maxval, | ||
T | __wrap | ||
) |
Test if __val lies within __minval and __maxval in a wrapped range.
__val | A value to test |
__minval | Lowest permissible value within the wrapped range |
__maxval | Highest permissible value within the wrapped range |
__wrap | Value at which the range wraps around itself (must be positive) |
__val
lies in the wrapped range Definition at line 128 of file kicad_algo.h.
Referenced by SHAPE_ARC::sliceContainsPoint().