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 <class_undoredo_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 308 of file class_undoredo_container.h.

Constructor & Destructor Documentation

UNDO_REDO_CONTAINER::UNDO_REDO_CONTAINER ( )

Definition at line 307 of file class_undoredo_container.cpp.

308 {
309 }
UNDO_REDO_CONTAINER::~UNDO_REDO_CONTAINER ( )

Definition at line 312 of file class_undoredo_container.cpp.

References ClearCommandList().

313 {
315 }

Member Function Documentation

void UNDO_REDO_CONTAINER::ClearCommandList ( )

Definition at line 318 of file class_undoredo_container.cpp.

References m_CommandsList.

Referenced by ~UNDO_REDO_CONTAINER().

319 {
320  for( unsigned ii = 0; ii < m_CommandsList.size(); ii++ )
321  delete m_CommandsList[ii];
322 
323  m_CommandsList.clear();
324 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
PICKED_ITEMS_LIST * UNDO_REDO_CONTAINER::PopCommand ( )

Definition at line 333 of file class_undoredo_container.cpp.

References m_CommandsList.

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

334 {
335  if( m_CommandsList.size() != 0 )
336  {
337  PICKED_ITEMS_LIST* item = m_CommandsList.back();
338  m_CommandsList.pop_back();
339  return item;
340  }
341 
342  return NULL;
343 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void UNDO_REDO_CONTAINER::PushCommand ( PICKED_ITEMS_LIST aCommand)

Definition at line 327 of file class_undoredo_container.cpp.

References m_CommandsList.

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

328 {
329  m_CommandsList.push_back( aItem );
330 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList

Member Data Documentation


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