20#ifndef GENERATED_TABLE_REFRESH_H
21#define GENERATED_TABLE_REFRESH_H
65 static_assert( std::is_base_of_v<GENERATED_TABLE_PENDING, T>,
66 "Pending state must derive from GENERATED_TABLE_PENDING" );
68 const std::type_index type(
typeid(
T ) );
70 for(
auto& [pendingType, pending] :
m_pending )
72 if( pendingType == type )
73 return static_cast<T&
>( *pending );
78 return static_cast<T&
>( *
m_pending.back().second );
89 std::vector<std::pair<std::type_index, std::unique_ptr<GENERATED_TABLE_PENDING>>>
m_pending;
Information pertinent to a Pcbnew printed circuit board.
Board state a table rebuild wants to change, held back until the whole refresh has succeeded.
virtual void Commit(BOARD &aBoard)=0
virtual ~GENERATED_TABLE_PENDING()=default
void Commit()
Write every pending state back to the board, in the order it was first asked for.
T & Pending()
The pass's T, created from the board on first use.
GENERATED_TABLE_REFRESH(BOARD &aBoard)
std::vector< std::pair< std::type_index, std::unique_ptr< GENERATED_TABLE_PENDING > > > m_pending
GENERATED_TABLE_REFRESH(const GENERATED_TABLE_REFRESH &)=delete
GENERATED_TABLE_REFRESH & operator=(const GENERATED_TABLE_REFRESH &)=delete
int RefreshGeneratedTables(BOARD &aBoard)
Bring every generated table on the board up to date and return how many were rebuilt.