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

#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 &), std::pair< const void *, const void * >(*)(const hilti::rt::any &)>
 
template<typename K , typename V >
using iterator_pair = std::pair< typename hilti::rt::Map< K, V >::const_iterator, typename hilti::rt::Map< K, V >::const_iterator >
 

Public Member Functions

 Map (const TypeInfo *ktype, const TypeInfo *vtype, Accessor accessor)
 
map::Sequence iterate (const Value &value) const
 
const TypeInfokeyType () const
 
const TypeInfovalueType () const
 

Static Public Member Functions

template<typename K , typename V >
static Accessor accessor ()
 

Friends

class map::Iterator
 

Detailed Description

Auxiliary type information for type `map.

Member Typedef Documentation

◆ Accessor

using hilti::rt::type_info::Map::Accessor = std::tuple<std::optional<hilti::rt::any> (*)(const Value&), std::optional<hilti::rt::any> (*)(const hilti::rt::any&), std::pair<const void*, const void*> (*)(const hilti::rt::any&)>

Similar semantics as with IterableType, but with different type for dereferenced value.

Constructor & Destructor Documentation

◆ Map()

hilti::rt::type_info::Map::Map ( const TypeInfo ktype,
const TypeInfo vtype,
Accessor  accessor 
)
inline

Constructor.

Parameters
ktypetype of the keys of the contained elements
vtypetype of the values of the contained elements
accessorset of functions retrieving and manipulating an iterator to traverse the sequence of contained elements

Member Function Documentation

◆ iterate()

map::Sequence hilti::rt::type_info::Map::iterate ( const Value value) const
inline

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

◆ keyType()

const TypeInfo* hilti::rt::type_info::Map::keyType ( ) const
inline

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

◆ valueType()

const TypeInfo* hilti::rt::type_info::Map::valueType ( ) const
inline

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


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