 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
7 #ifndef LLU_CONTAINERS_ITERATORS_DATALIST_HPP
8 #define LLU_CONTAINERS_ITERATORS_DATALIST_HPP
21 struct DataListIteratorPrimitive {
22 using iterator_category = std::input_iterator_tag;
23 using pointer =
void*;
24 using difference_type = mint;
28 explicit DataListIteratorPrimitive(DataStoreNode n) : node{n} {}
30 explicit DataListIteratorPrimitive(
const DataStoreIterator& it) : node{*it} {}
32 friend bool operator==(
const DataListIteratorPrimitive& lhs,
const DataListIteratorPrimitive& rhs) {
33 return lhs.node.node == rhs.node.node;
35 friend bool operator!=(
const DataListIteratorPrimitive& lhs,
const DataListIteratorPrimitive& rhs) {
53 using DataListIteratorPrimitive::DataListIteratorPrimitive;
95 using DataListIteratorPrimitive::DataListIteratorPrimitive;
145 using DataListIteratorPrimitive::DataListIteratorPrimitive;
159 if constexpr (std::is_same_v<T, Argument::Typed::Any>) {
192 auto v = node.value();
193 auto* ptr = std::get_if<U>(std::addressof(v));
197 return std::move(*ptr);
203 #endif // LLU_CONTAINERS_ITERATORS_DATALIST_HPP
NodeIterator & operator++()
Pre-increment operator.
Definition: DataList.hpp:67
const std::string DLInvalidNodeType
DataStoreNode passed to Node wrapper carries data of invalid type.
Wrapper over DataStoreNode structure from LibraryLink.
Definition: DataNode.hpp:22
reference operator*() const
Get name of the currently pointed to node.
Definition: DataList.hpp:109
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
value_type reference
NodeValueIterator is a proxy iterator and so the reference type is the same as value_type.
Definition: DataList.hpp:143
DataNode< T > value_type
This iterator iterates over values of type DataNode<T>
Definition: DataList.hpp:48
Simple proxy input iterator that goes over a DataStore and returns node names when dereferenced.
Definition: DataList.hpp:87
reference operator*() const
Get value of the currently pointed to node Generic node values will be converted to T if it is their ...
Definition: DataList.hpp:158
U as() const
Get current node value if it actually is of type U.
Definition: DataList.hpp:191
NodeValueIterator & operator++()
Pre-increment operator.
Definition: DataList.hpp:170
NodeNameIterator operator++(int)
Post-increment operator.
Definition: DataList.hpp:126
static void throwException(const std::string &errorName, T &&... args)
Throw exception with given name.
Definition: ErrorManager.h:199
T value_type
This iterator iterates over node values of type T.
Definition: DataList.hpp:140
NodeNameIterator & operator++()
Pre-increment operator.
Definition: DataList.hpp:117
std::string_view value_type
This iterator iterates over node names which are represented by std::string_view.
Definition: DataList.hpp:90
NodeValueIterator operator++(int)
Post-increment operator.
Definition: DataList.hpp:179
NodeNameIterator(const NodeIterator< T > &it)
Create NodeNameIterator pointing to the same node as given NodeIterator<T>
Definition: DataList.hpp:103
Template class and utilities to work with MArgument in type-safe manner.
NodeValueIterator(const NodeIterator< T > &it)
Create NodeValueIterator pointing to the same node as given NodeIterator<T>
Definition: DataList.hpp:151
value_type reference
NodeIterator is a proxy iterator and so the reference type is the same as value_type.
Definition: DataList.hpp:93
Simple proxy input iterator that goes over a DataStore and returns proxy DataNodes when dereferenced.
Definition: DataList.hpp:46
Simple proxy input iterator that goes over a DataStore and returns node values of requested type when...
Definition: DataList.hpp:138
NodeIterator operator++(int)
Post-increment operator.
Definition: DataList.hpp:76
reference operator*() const
Get current proxy DataNode.
Definition: DataList.hpp:59