score::VariantBasedNode< Args > Class Template Reference

The VariantBasedNode class. More...

Detailed Description

template<typename... Args>
class score::VariantBasedNode< Args >

The VariantBasedNode class.

A node which can hold a single data element at the time. All the arguments passed to Args are potential data member.

Additionally, a special tag InvisibleRootNodeTag is added to serve as root element, since this is necessary in the case of QAbstractItemModel.

For instance, VariantBasedNode<int, QString> will have three possible data types: InvisibleRootNode, int, QString.

Public Types

using variant_type = ossia::nullable_variant< InvisibleRootNode, Args... >
 

Public Member Functions

 VariantBasedNode (const VariantBasedNode &t)=default
 
 VariantBasedNode (VariantBasedNode &&t) noexcept=default
 
VariantBasedNodeoperator= (const VariantBasedNode &t)=default
 
template<typename T >
 VariantBasedNode (const T &t)
 
template<typename T >
bool is () const
 is Checks the type of the node. More...
 
template<typename T >
const T * target () const
 
template<typename T >
T * target ()
 
template<typename T >
void set (const T &t)
 
template<typename T >
const T & get () const
 
template<typename T >
T & get ()
 
auto which () const
 
auto & impl () const
 
auto & impl ()
 
bool operator== (const VariantBasedNode &other) const
 

Protected Attributes

ossia::nullable_variant< InvisibleRootNode, Args... > m_data
 

Member Function Documentation

◆ is()

template<typename... Args>
template<typename T >
bool score::VariantBasedNode< Args >::is ( ) const
inline

is Checks the type of the node.

Returns
true if T is the currently stored type.

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