KiCad PCB EDA Suite
UNDO_REDO_CONTAINER Class Reference

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

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 321 of file undo_redo_container.h.

Constructor & Destructor Documentation

◆ UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::UNDO_REDO_CONTAINER ( )

Definition at line 298 of file undo_redo_container.cpp.

299 {
300 }

◆ ~UNDO_REDO_CONTAINER()

UNDO_REDO_CONTAINER::~UNDO_REDO_CONTAINER ( )

Definition at line 303 of file undo_redo_container.cpp.

304 {
306 }

References ClearCommandList().

Member Function Documentation

◆ ClearCommandList()

void UNDO_REDO_CONTAINER::ClearCommandList ( )

Definition at line 309 of file undo_redo_container.cpp.

310 {
311  for( unsigned ii = 0; ii < m_CommandsList.size(); ii++ )
312  delete m_CommandsList[ii];
313 
314  m_CommandsList.clear();
315 }
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 324 of file undo_redo_container.cpp.

325 {
326  if( m_CommandsList.size() != 0 )
327  {
328  PICKED_ITEMS_LIST* item = m_CommandsList.back();
329  m_CommandsList.pop_back();
330  return item;
331  }
332 
333  return NULL;
334 }
#define NULL
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.

References m_CommandsList, and NULL.

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

◆ PushCommand()

void UNDO_REDO_CONTAINER::PushCommand ( PICKED_ITEMS_LIST aCommand)

Definition at line 318 of file undo_redo_container.cpp.

319 {
320  m_CommandsList.push_back( aItem );
321 }
std::vector< PICKED_ITEMS_LIST * > m_CommandsList

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: