tin  1.5.9
tsm::core::static_path< Capacity > Struct Template Reference

#include <core_algorithms.h>

Collaboration diagram for tsm::core::static_path< Capacity >:
Collaboration graph

Public Member Functions

constexpr void push_back (std::uint16_t value)
 
constexpr std::uint16_t operator[] (std::size_t index) const
 
constexpr bool contains (std::uint16_t value) const
 
constexpr static_path reversed () const
 
constexpr bool operator== (static_path const &other) const
 

Public Attributes

std::array< std::uint16_t, Capacity > values {}
 
std::size_t size {}
 

Detailed Description

template<std::size_t Capacity>
struct tsm::core::static_path< Capacity >

A path is an ordered sequence of states through the hierarchy.

Examples: root-to-leaf: '(Root Motor Idle) leaf-to-root: '(Idle Motor Root) exit-list: '(Idle Motor) entry-list: '(Drive Enabled)

This implementation stores the path as a fixed-capacity sequence of numeric state IDs. The capacity is usually the number of states, which is a conservative maximum depth for a valid tree-shaped hierarchy.

(define-type StateId UInt16) (define-type (Path N) (record (values (Array StateId N)) (size Nat)))

Member Function Documentation

◆ contains()

template<std::size_t Capacity>
constexpr bool tsm::core::static_path< Capacity >::contains ( std::uint16_t  value) const
inlineconstexpr

◆ operator==()

template<std::size_t Capacity>
constexpr bool tsm::core::static_path< Capacity >::operator== ( static_path< Capacity > const &  other) const
inlineconstexpr

◆ operator[]()

template<std::size_t Capacity>
constexpr std::uint16_t tsm::core::static_path< Capacity >::operator[] ( std::size_t  index) const
inlineconstexpr

◆ push_back()

template<std::size_t Capacity>
constexpr void tsm::core::static_path< Capacity >::push_back ( std::uint16_t  value)
inlineconstexpr

◆ reversed()

template<std::size_t Capacity>
constexpr static_path tsm::core::static_path< Capacity >::reversed ( ) const
inlineconstexpr

Member Data Documentation

◆ size

template<std::size_t Capacity>
std::size_t tsm::core::static_path< Capacity >::size {}

◆ values

template<std::size_t Capacity>
std::array<std::uint16_t, Capacity> tsm::core::static_path< Capacity >::values {}

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