LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
LLU::GenericDataNode Struct Reference

Description

Basic wrapper over DataStoreNode, provides class-like interface and conversion of the underlying value from MArgument to TypedArgument.

#include <DataStore.hpp>

Public Member Functions

GenericDataNode next () const noexcept
 Get GenericDataNode wrapper over the next node. More...
 
MArgumentType type () const noexcept
 Get type of the node value. More...
 
std::string_view name () const noexcept
 Get node name. More...
 
Argument::TypedArgument value () const
 Get value of the node as the variant type. More...
 
template<typename T >
as () const
 Get node value if it is of type T, otherwise throw an exception. More...
 
 operator bool () const
 Bool conversion operator. More...
 
GenericDataNodeoperator-> ()
 Member of pointer operator, used by DataList iterators. More...
 

Public Attributes

DataStoreNode node
 Raw DataStore node. More...
 

Member Function Documentation

◆ as()

template<typename T >
T LLU::GenericDataNode::as

Get node value if it is of type T, otherwise throw an exception.

Template Parameters
T- any type from LLU::NodeType namespace
Returns
node value of type T

◆ name()

std::string_view LLU::GenericDataNode::name ( ) const
noexcept

Get node name.

Returns
string view over the name of the node

◆ next()

GenericDataNode LLU::GenericDataNode::next ( ) const
noexcept

Get GenericDataNode wrapper over the next node.

Returns
next node wrapped in GenericDataNode

◆ operator bool()

LLU::GenericDataNode::operator bool ( ) const
explicit

Bool conversion operator.

Returns
true iff the node is not null

◆ operator->()

GenericDataNode* LLU::GenericDataNode::operator-> ( )
inline

Member of pointer operator, used by DataList iterators.

◆ type()

MArgumentType LLU::GenericDataNode::type ( ) const
noexcept

Get type of the node value.

Returns
type of the node value

◆ value()

Argument::TypedArgument LLU::GenericDataNode::value ( ) const

Get value of the node as the variant type.

Returns
TypedArgument variant holding the value of the node

Member Data Documentation

◆ node

DataStoreNode LLU::GenericDataNode::node

Raw DataStore node.