Spicy
Public Member Functions | Public Attributes | List of all members
spicy::type::detail::AssignIndices Struct Reference

#include <unit.h>

Inheritance diagram for spicy::type::detail::AssignIndices:
spicy::type::Unit

Public Member Functions

std::vector< unit::Item > assignIndices (std::vector< unit::Item > items)
 

Public Attributes

uint64_t _next_index = 0
 

Detailed Description

Mixin class to number all fields in sequential order.

This functionality is not implemented in Unit since we want to use assignIndices in a call to a base class's constructor before Unit is fully constructed. Putting the counter _next_index into Unit would lead to it being initialized after Unit's base class TypeBase.

Member Function Documentation

◆ assignIndices()

std::vector< type::unit::Item > type::detail::AssignIndices::assignIndices ( std::vector< unit::Item >  items)

Helper function to recursively number all fields in the passed list in sequential order

Parameters
itemsthe items to number
Returns
a pair of mutated items and the next index

The documentation for this struct was generated from the following files: