KiCad PCB EDA Suite
UNDO_REDO_CONTAINER Class Reference

Class UNDO_REDO_CONTAINER is a holder to handle alist of undo (or redo) command. 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

Class UNDO_REDO_CONTAINER is a holder to handle alist of undo (or redo) command.

this class handles a list of ITEM_PICKER (each manage one schematic or board item).

Definition at line 304 of file undo_redo_container.h.

Constructor & Destructor Documentation

◆ UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::UNDO_REDO_CONTAINER ( )

Definition at line 268 of file undo_redo_container.cpp.

269 {
270 }

◆ ~UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::~UNDO_REDO_CONTAINER ( )

Definition at line 273 of file undo_redo_container.cpp.

274 {
276 }

References ClearCommandList().

Member Function Documentation

◆ ClearCommandList()

void UNDO_REDO_CONTAINER::ClearCommandList ( )

Definition at line 279 of file undo_redo_container.cpp.

280 {
281  for( unsigned ii = 0; ii < m_CommandsList.size(); ii++ )
282  delete m_CommandsList[ii];
283 
284  m_CommandsList.clear();
285 }
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 294 of file undo_redo_container.cpp.

295 {
296  if( m_CommandsList.size() != 0 )
297  {
298  PICKED_ITEMS_LIST* item = m_CommandsList.back();
299  m_CommandsList.pop_back();
300  return item;
301  }
302 
303  return NULL;
304 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.

References m_CommandsList.

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

◆ PushCommand()

void UNDO_REDO_CONTAINER::PushCommand ( PICKED_ITEMS_LIST aCommand)

Definition at line 288 of file undo_redo_container.cpp.

289 {
290  m_CommandsList.push_back( aItem );
291 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList

References m_CommandsList.

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

Member Data Documentation

◆ m_CommandsList


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