Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Model::List Class Reference
Inheritance diagram for Model::List:
Core::Reflect< Base >

Public Types

using const_iterator = QVector< Node * >::ConstIterator
 
using iterator = QVector< Node * >::Iterator
 

Public Member Functions

 List (::Model::Node *parent, ::Model::PersistentStore &store, bool loadPartially)
 
 List (::Model::Node *parent=nullptr)
 
 List (const List &other)
 
virtual ~List ()
 
void append (Node *node)
 
template<typename T = Node>
T * at (int i) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
virtual QList< Node * > children () const override
 
void clear ()
 
Listclone () const override
 
bool contains (const Node *node) const
 
virtual NodecreateDefaultElement ()
 Creates a new Node that is suitable for inserting in the list. More...
 
iterator end ()
 
const_iterator end () const
 
virtual bool findSymbols (std::unique_ptr< ResolutionRequest > request) const override
 
template<typename T = Node>
T * first () const
 
int indexOf (const Node *item) const
 
int indexToSubnode (const Node *node) const
 
void insert (int position, Node *node)
 
bool isEmpty () const
 
bool isTransparentForNameResolution () const override
 
template<typename T = Node>
T * last () const
 
virtual void load (PersistentStore &store) override
 
virtual int lowerTypeBoundForElements () const
 
const QVector< Node * > & nodes ()
 
void paste (ClipboardStore &clipboard, int position)
 
void prepend (Node *node)
 
void remove (int index)
 Removes the child node at position index. More...
 
void remove (Node *instance)
 Removes the child instance. More...
 
virtual bool replaceChild (Node *child, Node *replacement) override
 
virtual void save (PersistentStore &store) const override
 TODO Document this somewhere useful. More...
 
int size () const
 

Static Public Member Functions

static ListcreateDefaultInstance (Node *parent=nullptr)
 

Private Member Functions

void loadSubNodes (QList< LoadedNode > &nodeList)
 

Private Attributes

QVector< Node * > nodes_
 

Additional Inherited Members

- Protected Types inherited from Core::Reflect< Base >
using Super = Reflect< Base >
 

Member Typedef Documentation

◆ const_iterator

using Model::List::const_iterator = QVector<Node*>::ConstIterator

◆ iterator

using Model::List::iterator = QVector<Node*>::Iterator

Constructor & Destructor Documentation

◆ List() [1/3]

Model::List::List ( ::Model::Node parent = nullptr)

◆ List() [2/3]

Model::List::List ( ::Model::Node parent,
::Model::PersistentStore store,
bool  loadPartially 
)

◆ List() [3/3]

Model::List::List ( const List other)

◆ ~List()

Model::List::~List ( )
virtual

Member Function Documentation

◆ append()

void Model::List::append ( Node node)
inline

◆ at()

template<typename T >
T * Model::List::at ( int  i) const

◆ begin() [1/2]

List::iterator Model::List::begin ( )
inline

◆ begin() [2/2]

List::const_iterator Model::List::begin ( ) const
inline

◆ cbegin()

List::const_iterator Model::List::cbegin ( ) const
inline

◆ cend()

List::const_iterator Model::List::cend ( ) const
inline

◆ children()

QList< Node * > Model::List::children ( ) const
overridevirtual

◆ clear()

void Model::List::clear ( )

◆ clone()

List * Model::List::clone ( ) const
override

◆ contains()

bool Model::List::contains ( const Node node) const
inline

◆ createDefaultElement()

Node * Model::List::createDefaultElement ( )
virtual

Creates a new Node that is suitable for inserting in the list.

The newly created node is not directly inserted into the list.

The default implementation returns nullptr. This behavior is suitable for lists that are not managed by standard interaction handlers or where the creation of item in standard ways is not necessary.

Reimplement this method in derived classes to control what Node is created.

This method is used by higher level abstractions and in TypedList to facilitate the automatic creation of list elements.

◆ createDefaultInstance()

List * Model::List::createDefaultInstance ( Node parent = nullptr)
static

◆ end() [1/2]

List::iterator Model::List::end ( )
inline

◆ end() [2/2]

List::const_iterator Model::List::end ( ) const
inline

◆ findSymbols()

bool Model::List::findSymbols ( std::unique_ptr< ResolutionRequest request) const
overridevirtual

◆ first()

template<typename T >
T * Model::List::first

◆ indexOf()

int Model::List::indexOf ( const Node item) const

◆ indexToSubnode()

int Model::List::indexToSubnode ( const Node node) const

◆ insert()

void Model::List::insert ( int  position,
Node node 
)

◆ isEmpty()

bool Model::List::isEmpty ( ) const
inline

◆ isTransparentForNameResolution()

bool Model::List::isTransparentForNameResolution ( ) const
override

◆ last()

template<typename T >
T * Model::List::last

◆ load()

void Model::List::load ( PersistentStore store)
overridevirtual

◆ loadSubNodes()

void Model::List::loadSubNodes ( QList< LoadedNode > &  nodeList)
private

◆ lowerTypeBoundForElements()

int Model::List::lowerTypeBoundForElements ( ) const
virtual

◆ nodes()

const QVector< Node * > & Model::List::nodes ( )
inline

◆ paste()

void Model::List::paste ( ClipboardStore clipboard,
int  position 
)

◆ prepend()

void Model::List::prepend ( Node node)
inline

◆ remove() [1/2]

void Model::List::remove ( int  index)

Removes the child node at position index.

◆ remove() [2/2]

void Model::List::remove ( Node instance)

Removes the child instance.

◆ replaceChild()

bool Model::List::replaceChild ( Node child,
Node replacement 
)
overridevirtual

◆ save()

void Model::List::save ( PersistentStore store) const
overridevirtual

TODO Document this somewhere useful.

Like in the Persistent store interface. If the node is partially loaded the Store will automatically fill in the missing fields by taking the old version of every subnode whose name is not specified here.

◆ size()

int Model::List::size ( ) const
inline

Member Data Documentation

◆ nodes_

QVector<Node*> Model::List::nodes_
private