20#ifndef LIBREPCB_EDITOR_CMDLISTELEMENTINSERT_H
21#define LIBREPCB_EDITOR_CMDLISTELEMENTINSERT_H
26#include "../undocommand.h"
45template <
typename T,
typename P,
typename... OnEditedArgs>
52 const std::shared_ptr<T>& element,
53 int index = -1) noexcept
int count() const noexcept
Definition: serializableobjectlist.h:199
void remove(int index) noexcept
Definition: serializableobjectlist.h:362
int insert(int index, const std::shared_ptr< T > &obj) noexcept
Definition: serializableobjectlist.h:336
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
void performRedo() override
Redo the command.
Definition: cmdlistelementinsert.h:75
CmdListElementInsert(const CmdListElementInsert &other)=delete
int mIndex
Definition: cmdlistelementinsert.h:80
~CmdListElementInsert() noexcept
Definition: cmdlistelementinsert.h:58
CmdListElementInsert & operator=(const CmdListElementInsert &rhs)=delete
void performUndo() override
Undo the command.
Definition: cmdlistelementinsert.h:72
CmdListElementInsert(SerializableObjectList< T, P, OnEditedArgs... > &list, const std::shared_ptr< T > &element, int index=-1) noexcept
Definition: cmdlistelementinsert.h:51
std::shared_ptr< T > mElement
Definition: cmdlistelementinsert.h:79
SerializableObjectList< T, P, OnEditedArgs... > & mList
Definition: cmdlistelementinsert.h:78
bool performExecute() override
Execute the command the first time.
Definition: cmdlistelementinsert.h:65
CmdListElementInsert()=delete
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77