KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::COMPLEX_FIRST_FILL_TASK Class Reference

Priority task dispatcher for zone fills - we want to do the biggest ones first. More...

Inheritance diagram for ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::COMPLEX_FIRST_FILL_TASK:
PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >

Public Types

using ItemT
 

Public Member Functions

 COMPLEX_FIRST_FILL_TASK (bool aSimplify)
 
void SetReporter (PROGRESS_REPORTER *aReporter)
 
size_t Execute (std::vector< FILL_INFO > &aItems)
 Call this to execute the task on all items in aItems, using the thread pool and dispatching the tasks in order of descending priority as determined by computePriorityKey() implemented by the derived class.
 

Protected Attributes

PROGRESS_REPORTER * m_reporter
 

Private Member Functions

int computePriorityKey (const FILL_INFO &a) const override
 
size_t task (FILL_INFO &fillInfo) override
 

Private Attributes

bool m_simplify
 
BS::priority_t m_highestPriority
 
std::chrono::milliseconds m_reporterInterval
 
std::atomic< bool > m_abort
 Set when a task throws, so tasks that have not started yet skip their item.
 

Detailed Description

Priority task dispatcher for zone fills - we want to do the biggest ones first.

On average, sorting the largest zones first is slightly faster (5-10%) on large boards.

However, if you allow the large zones to be assigned at random, as they basically will be if they are handled later in the process, there's a chance the very biggest zones will end up consecutive in the same thread which could be a substantial penalty.

Definition at line 1052 of file allegro_builder.cpp.

Member Typedef Documentation

◆ ItemT

using PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::ItemT
inherited

Definition at line 36 of file priority_thread_pool_task.h.

Constructor & Destructor Documentation

◆ COMPLEX_FIRST_FILL_TASK()

ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::COMPLEX_FIRST_FILL_TASK::COMPLEX_FIRST_FILL_TASK ( bool aSimplify)
inline

Definition at line 1055 of file allegro_builder.cpp.

References m_simplify.

Member Function Documentation

◆ computePriorityKey()

int ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::COMPLEX_FIRST_FILL_TASK::computePriorityKey ( const FILL_INFO & a) const
inlineoverrideprivate

◆ Execute()

size_t PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::Execute ( std::vector< FILL_INFO > & aItems)
inlineinherited

Call this to execute the task on all items in aItems, using the thread pool and dispatching the tasks in order of descending priority as determined by computePriorityKey() implemented by the derived class.

This method blocks until all tasks are complete, and then re-throws the first exception thrown by a task (if any). If a task throws, later tasks that have not started yet are skipped; tasks already running are not interrupted.

It never returns while any task is still queued or running.

Parameters
aItemsThe container of items to process.
Returns
The total number of subitems processed (sum of the return values of task() for each item)

Definition at line 66 of file priority_thread_pool_task.h.

◆ SetReporter()

void PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::SetReporter ( PROGRESS_REPORTER * aReporter)
inlineinherited

Definition at line 49 of file priority_thread_pool_task.h.

◆ task()

Member Data Documentation

◆ m_abort

std::atomic<bool> PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::m_abort
privateinherited

Set when a task throws, so tasks that have not started yet skip their item.

Definition at line 187 of file priority_thread_pool_task.h.

◆ m_highestPriority

BS::priority_t PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::m_highestPriority
privateinherited

Definition at line 181 of file priority_thread_pool_task.h.

◆ m_reporter

PROGRESS_REPORTER* PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::m_reporter
protectedinherited

Definition at line 157 of file priority_thread_pool_task.h.

◆ m_reporterInterval

std::chrono::milliseconds PRIORITY_THREAD_POOL_TASK< std::vector< FILL_INFO > >::m_reporterInterval
privateinherited

Definition at line 182 of file priority_thread_pool_task.h.

◆ m_simplify

bool ALLEGRO::BOARD_BUILDER::ZONE_FILL_HANDLER::COMPLEX_FIRST_FILL_TASK::m_simplify
private

Definition at line 1080 of file allegro_builder.cpp.

Referenced by COMPLEX_FIRST_FILL_TASK(), and task().


The documentation for this class was generated from the following file: