Spicy
Public Types | Public Member Functions | Friends | List of all members
hilti::rt::type_info::detail::IterableType Class Reference

#include <type-info.h>

Inheritance diagram for hilti::rt::type_info::detail::IterableType:
hilti::rt::type_info::Set hilti::rt::type_info::Vector

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 TypeInfodereferencedType () const
 

Friends

class iterable_type::Iterator
 

Detailed Description

Base class for auxiliary type information pertaining to types that contain an iterable sequence of elements of another type.

Member Typedef Documentation

◆ Accessor

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:

  1. 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.
  2. `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 referring to the final location.
  3. deref:: Given a previously created iterator of the internal type, return a pointer to the storage of the element that the iterator refers to.

Constructor & Destructor Documentation

◆ IterableType()

hilti::rt::type_info::detail::IterableType::IterableType ( const TypeInfo etype,
Accessor  accessor 
)
inline

Constructor.

Parameters
etypetype of the sequence's elements
accessorset of functions retrieving and manipulating an iterator to traverse the sequence of contained elements

Member Function Documentation

◆ dereferencedType()

const TypeInfo* hilti::rt::type_info::detail::IterableType::dereferencedType ( ) const
inline

Returns the type of the contained elements, as passed into the constructor.

◆ iterate()

iterable_type::Sequence hilti::rt::type_info::detail::IterableType::iterate ( const Value value) const
inline

Returns a Sequence that can be iterated over to visit all the contained elements.


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