wxMaxima
Public Member Functions | List of all members
CellListBuilder< T > Class Template Reference

Manages building a list of cells, keeping the head and tail of the list. More...

#include <CellList.h>

Inheritance diagram for CellListBuilder< T >:
Inheritance graph
[legend]
Collaboration diagram for CellListBuilder< T >:
Collaboration graph
[legend]

Public Member Functions

 operator bool () const
 Returns true if the tree is non-empty.
 
 operator std::unique_ptr< T > () &&
 Passes on the ownership of the list head.
 
T * ReleaseHead ()
 
std::unique_ptr< T > TakeHead ()
 Passes on the ownership of the list head.
 
T * GetTail () const
 Provides the last cell in the list (if any).
 
T * GetLastAppended () const
 Provides the most cell passed to the most recent Append call.
 
T * Append (T *cells)
 Appends one or more cells.
 
T * DynamicAppend (Cell *cells)
 
T * DynamicAppend (std::unique_ptr< Cell > &&cells)
 
T * Append (std::unique_ptr< T > &&cells)
 Appends one or more cells.
 
void ClearLastAppended ()
 Clears the pointer to the last appended cell. Useful when tree building.
 

Detailed Description

template<typename T = Cell>
class CellListBuilder< T >

Manages building a list of cells, keeping the head and tail of the list.

Member Function Documentation

◆ DynamicAppend() [1/2]

template<typename T = Cell>
T* CellListBuilder< T >::DynamicAppend ( Cell cells)
inline

Appends one or more cells if they are all of the correct type, otherwise deletes them.

Returns
the appended cells, or null if they weren't appended.

◆ DynamicAppend() [2/2]

template<typename T = Cell>
T* CellListBuilder< T >::DynamicAppend ( std::unique_ptr< Cell > &&  cells)
inline

Appends one or more cells if they are all of the correct type, otherwise deletes them.

Returns
the appended cells, or null if they weren't appended.

◆ ReleaseHead()

template<typename T = Cell>
T* CellListBuilder< T >::ReleaseHead ( )
inline

Releases the ownership of the list head of the list to the caller.

Todo:
This function is deprecated. It is provided temporarily to support porting to unique_ptr-based Cell ownership. It should be removed after the porting is done.

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