KiCad PCB EDA Suite
UNDO_REDO_CONTAINER Class Reference

A holder to handle a list of undo (or redo) commands. More...

#include <undo_redo_container.h>

Public Member Functions

 UNDO_REDO_CONTAINER ()
 
 ~UNDO_REDO_CONTAINER ()
 
void PushCommand (PICKED_ITEMS_LIST *aCommand)
 
PICKED_ITEMS_LISTPopCommand ()
 
void ClearCommandList ()
 

Public Attributes

std::vector< PICKED_ITEMS_LIST * > m_CommandsList
 

Detailed Description

A holder to handle a list of undo (or redo) commands.

Definition at line 297 of file undo_redo_container.h.

Constructor & Destructor Documentation

◆ UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::UNDO_REDO_CONTAINER ( )

Definition at line 291 of file undo_redo_container.cpp.

292{
293}

◆ ~UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::~UNDO_REDO_CONTAINER ( )

Definition at line 296 of file undo_redo_container.cpp.

297{
299}

References ClearCommandList().

Member Function Documentation

◆ ClearCommandList()

void UNDO_REDO_CONTAINER::ClearCommandList ( )

Definition at line 302 of file undo_redo_container.cpp.

303{
304 for( unsigned ii = 0; ii < m_CommandsList.size(); ii++ )
305 delete m_CommandsList[ii];
306
307 m_CommandsList.clear();
308}
std::vector< PICKED_ITEMS_LIST * > m_CommandsList

References m_CommandsList.

Referenced by ~UNDO_REDO_CONTAINER().

◆ PopCommand()

PICKED_ITEMS_LIST * UNDO_REDO_CONTAINER::PopCommand ( )

Definition at line 317 of file undo_redo_container.cpp.

318{
319 if( m_CommandsList.size() != 0 )
320 {
321 PICKED_ITEMS_LIST* item = m_CommandsList.back();
322 m_CommandsList.pop_back();
323 return item;
324 }
325
326 return nullptr;
327}
A holder to handle information on schematic or board items.

References m_CommandsList.

Referenced by EDA_BASE_FRAME::PopCommandFromRedoList(), and EDA_BASE_FRAME::PopCommandFromUndoList().

◆ PushCommand()

void UNDO_REDO_CONTAINER::PushCommand ( PICKED_ITEMS_LIST aCommand)

Definition at line 311 of file undo_redo_container.cpp.

312{
313 m_CommandsList.push_back( aItem );
314}

References m_CommandsList.

Referenced by EDA_BASE_FRAME::PushCommandToRedoList(), and EDA_BASE_FRAME::PushCommandToUndoList().

Member Data Documentation

◆ m_CommandsList


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