 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
7 #ifndef LLU_CONTAINERS_ITERATORS_DATANODE_HPP
8 #define LLU_CONTAINERS_ITERATORS_DATANODE_HPP
10 #include <type_traits>
23 static constexpr
bool isGeneric = std::is_same_v<T, Argument::TypedArgument>;
24 static_assert(Argument::WrapperQ<T>,
"DataNode type is not a valid MArgument wrapper type.");
31 explicit DataNode(DataStoreNode dsn);
60 std::string_view
name()
const {
69 return static_cast<bool>(node.
next());
93 template <std::
size_t N>
94 decltype(
auto)
get() {
95 static_assert(N < 2,
"Bad structure binding attempt to a DataNode.");
96 if constexpr (N == 0) {
117 if constexpr (isGeneric) {
118 nodeArg = std::move(node.value());
120 nodeArg = std::move(node.as<T>());
129 class tuple_size<
LLU::DataNode<T>> :
public std::integral_constant<std::size_t, 2> {};
131 template<std::
size_t N,
typename T>
132 class tuple_element<N,
LLU::DataNode<T>> {
138 #endif // LLU_CONTAINERS_ITERATORS_DATANODE_HPP
Wrapper over DataStoreNode structure from LibraryLink.
Definition: DataNode.hpp:22
T & value()
Get node value.
Definition: DataNode.hpp:43
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
decltype(auto) get()
Get N-th element of DataNode in a tuple-like way.
Definition: DataNode.hpp:94
const std::string DLNullRawNode
DataStoreNode passed to Node wrapper was null.
Basic wrapper over DataStoreNode, provides class-like interface and conversion of the underlying valu...
Definition: Iterators/DataStore.hpp:22
Definition and implementation of generic DataStore wrapper.
std::string_view name() const noexcept
Get node name.
Definition: DataStore.cpp:20
GenericDataNode next() const noexcept
Get GenericDataNode wrapper over the next node.
Definition: DataStore.cpp:12
MArgumentType type() const noexcept
Get type of the node value.
Definition: DataStore.cpp:16
MArgumentType type() noexcept
Get the actual type of node value.
Definition: DataNode.hpp:84
static void throwException(const std::string &errorName, T &&... args)
Throw exception with given name.
Definition: ErrorManager.h:199
MArgumentType
Strongly type enum with possible types of data stored in MArgument.
Definition: MArgument.h:22
GenericDataNode next() const
Get next node as GenericDataNode (because the next node may not necessarily have value of type T)
Definition: DataNode.hpp:76
DataNode(DataStoreNode dsn)
Create DataNode from raw DataStoreNode structure.
Definition: DataNode.hpp:110
bool hasNext() const
Check if this node has a successor.
Definition: DataNode.hpp:68
const T & value() const
Get node value.
Definition: DataNode.hpp:51
std::string_view name() const
Get node name.
Definition: DataNode.hpp:60