![]() |
Spicy
|
#include <type-info.h>
Public Types | |
using | Accessor = std::tuple< std::optional< hilti::rt::any >(*)(const Value &), std::optional< hilti::rt::any >(*)(const hilti::rt::any &), const void *(*)(const hilti::rt::any &)> |
Public Member Functions | |
IterableType (const TypeInfo *etype, Accessor accessor) | |
iterable_type::Sequence | iterate (const Value &value) const |
const TypeInfo * | dereferencedType () const |
Friends | |
class | iterable_type::Iterator |
Base class for auxiliary type information pertaining to types that contain an iterable sequence of elements of another type.
using hilti::rt::type_info::detail::IterableType::Accessor = std::tuple<std::optional<hilti::rt::any> (*)(const Value&), std::optional<hilti::rt::any> (*)(const hilti::rt::any&), const void* (*)(const hilti::rt::any&)> |
Type defining three functions that retrieve and manipulate an iterator for traversing the sequence of contained elements. The functions are:
begin
: Given the outer value, returns an iterator of an internal type that points the value's first contained element; or an unset optional if the value's sequence is empty.next
: Given a previously created iterator of the internal type, moves the iterator forward to point to the next element; or returns a unset optional if the iterator is already refering to the final location.deref
:: Given a previously created iterator of the internal type, return a pointer to the storage of the element that the iterator refers to.
|
inline |
Constructor.
etype | type of the sequence's elements |
accessor | set of functions retrieving and manipulating an iterator to traverse the sequence of contained elements |
|
inline |
Returns the type of the contained elements, as passed into the constructor.
|
inline |
Returns a Sequence
that can be iterated over to visit all the contained elements.