 |
wxMaxima
|
Go to the documentation of this file.
30 #ifndef WXMAXIMA_CELLLIST_H
31 #define WXMAXIMA_CELLLIST_H
39 std::unique_ptr<Cell> m_head;
41 Cell *m_lastAppended = {};
59 static Cell *DynamicCast(
Cell *cell) {
return dynamic_cast<T *
>(cell); }
65 explicit operator bool()
const {
return bool(m_head); }
68 operator std::unique_ptr<T>() && {
return TakeHead(); }
79 T *ptr =
dynamic_cast<T *
>(m_head.get());
87 wxASSERT(!m_head && !m_tail && !m_lastAppended);
96 auto retval = dynamic_unique_ptr_cast<T>(std::move(m_head));
98 wxASSERT(!m_head && !m_tail && !m_lastAppended);
103 T *
GetTail()
const {
return dynamic_cast<T*
>(m_tail); }
121 return static_cast<T *
>(
136 auto *
const retval = cells.get();
157 static std::unique_ptr<Cell>
SetNext(
Cell *cell, std::unique_ptr<Cell> &&next);
172 template <
typename T>
173 static void AppendCell(
const std::unique_ptr<T> &cell, std::unique_ptr<Cell> &&tail)
T * GetLastAppended() const
Provides the most cell passed to the most recent Append call.
Definition: CellList.h:106
T * DynamicAppend(std::unique_ptr< Cell > &&cells)
Definition: CellList.h:128
static TornOut TearOut(Cell *first, Cell *last)
Definition: CellList.cpp:158
std::unique_ptr< Cell > tailOwner
Definition: CellList.h:201
std::unique_ptr< T > TakeHead()
Passes on the ownership of the list head.
Definition: CellList.h:92
T * Append(std::unique_ptr< T > &&cells)
Appends one or more cells.
Definition: CellList.h:134
Manages building a list of cells, keeping the head and tail of the list.
Definition: CellList.h:57
Cell * lastSpliced
Definition: CellList.h:180
Definition: CellList.h:193
Definition: CellList.h:142
std::unique_ptr< Cell > cellOwner
Definition: CellList.h:198
static void Check(const Cell *cell)
Definition: CellList.cpp:55
static void DeleteList(Cell *afterMe)
Definition: CellList.cpp:86
Definition: CellList.h:36
void base_Append(std::unique_ptr< Cell > &&cells)
Appends one or more cells.
Definition: CellList.cpp:25
static SplicedIn SpliceInAfter(Cell *where, std::unique_ptr< Cell > &&head, Cell *last=nullptr)
Definition: CellList.cpp:124
static void AppendCell(Cell *cell, std::unique_ptr< Cell > &&tail)
Definition: CellList.cpp:95
CellPtr< Cell > cell
The first in the torn-out list of cells, or null if the tearing out had failed.
Definition: CellList.h:195
T * GetTail() const
Provides the last cell in the list (if any).
Definition: CellList.h:103
static std::unique_ptr< Cell > SetNext(Cell *cell, std::unique_ptr< Cell > &&next)
Definition: CellList.cpp:62
void ClearLastAppended()
Clears the pointer to the last appended cell. Useful when tree building.
Definition: CellList.h:53
T * Append(T *cells)
Appends one or more cells.
Definition: CellList.h:110
T * DynamicAppend(Cell *cells)
Definition: CellList.h:119
T * ReleaseHead()
Definition: CellList.h:77
Definition: CellList.h:176
Definition: GroupCell.h:68
Cell * base_DynamicAppend(std::unique_ptr< Cell > &&cells, Cell *(*caster)(Cell *))
Definition: CellList.cpp:42