fiber
Loading...
Searching...
No Matches
fiber Namespace Reference

Namespaces

namespace  ansi
 
namespace  detail
 
namespace  stm32f446
 
namespace  utf8_lines
 

Classes

struct  _FormatUIntParams
 
class  _TryAwait
 Awaits on something that returns an std::optional and throws if it does not have a value. More...
 
class  _TryAwait< T, false >
 Specialisation of fiber::_TryAwait for lvalue-references. More...
 
class  AllocationFailure
 
class  ArrayList
 An array of contiguous memory which is statically allocated. More...
 
class  AssertionFailure
 
class  AssertionFailureCritical
 
class  AssertionFailureFull
 
class  AssertionFailureO1
 
class  AwaitableWrapper
 Wraps awaitables that are not yet derived from fiber::AwaitableNode More...
 
class  AwaitableWrapper< Awaitable, false >
 Wraps awaitables that are not yet derived from fiber::AwaitableNode More...
 
class  AwaitCallable
 Awaitable that waits for a function to return true. More...
 
class  AwaitCallable< Callable, false >
 
class  AwaitMethod
 
class  AwaitMethod< Object, Method, false >
 
class  Coroutine
 Owning handle to a coroutine with a custom promise type. More...
 
struct  CoroutineNode
 Represents a coroutine (node) in a reverse-linked list of nested coroutines. More...
 
class  CoroutinePromise
 Promise type for an fiber::Coroutine. More...
 
class  CoroutinePromise< void >
 Specialisation for ReturnTypes of type void More...
 
class  CoSignal
 A signal that can be sent from an awaitable to the Task and Scheduler. More...
 
class  Delay
 
class  DualArrayList
 Two ArrayLists that share the same memory buffer. More...
 
class  DualPriorityQueue
 
class  Duration
 Overflow aware duration for hardware timers/counters. More...
 
class  Exception
 The base class for exceptions in fiber More...
 
struct  ExecutionTime
 
struct  FormatBool
 formats a bool for use with OStream More...
 
struct  FormatBoolParam
 
struct  FormatFloat
 Formats an floating point for further printing use. More...
 
struct  FormatFloatParams
 
struct  FormatHex
 
struct  FormatHexParams
 
struct  FormatInt
 Formats an unsigned integer (of any size) for use with OStream. More...
 
struct  FormatIntParams
 
struct  FormatIntSuffix
 
struct  FormatIntSuffixParams
 
struct  FormatStr
 Formats a string and allows to pass an additional size parameter. More...
 
struct  FormatStrParams
 
class  Future
 Future and Promise pairs are used to synchronise values between asynchronous tasks. More...
 
struct  FuturePromisePair
 
class  InterruptGuard
 Makes sure that equaly many interrupt disable and enable calls are beingmade. More...
 
class  InvertedPin
 
struct  is_coroutine
 
struct  is_coroutine< Coroutine< T > >
 
struct  is_std_optional
 
struct  is_std_optional< std::optional< T > >
 
class  LCD_HD44780
 driver for a LCD display with 8 data bit interface More...
 
struct  LCD_HD44780_BusyFlagAddress
 
class  LeftDualArrayListConstRef
 A reference to the left side of a DualArrayList. More...
 
class  LeftDualArrayListRef
 A reference to the left side of a DualArrayList. More...
 
struct  make_fast
 
struct  make_fast< SInt >
 
struct  make_fast< UInt >
 
class  NextCycle
 
class  NullLogger
 A default logger that does nothing. More...
 
class  OStream
 Abstract class for an output character stream that offers string and number formating. More...
 
struct  OStreamRef
 
class  OutputLogger
 A logger that will write all loggings directly to an output stream. More...
 
class  PeriodicTask
 
class  PinTuple
 A tuple (heterogenious collection) of pins that can be written together as if it was a port. More...
 
class  PriorityQueue
 
class  Promise
 Promise and Future pairs are used to synchronise values between asynchronous tasks. More...
 
class  RightDualArrayListConstRef
 A reference to the right side of a DualArrayList. More...
 
class  RightDualArrayListRef
 A reference to the right side of a DualArrayList. More...
 
struct  Schedule
 
class  Scheduler
 A real time scheduler that starts tasks once they are ready and schedules them by earliest deadline first. More...
 
class  SoftPeriodicTask
 
class  StackAllocator
 
class  StackAllocatorExtern
 
class  Stage1DualPriorityQueueConstRef
 
class  Stage1DualPriorityQueueRef
 
class  Stage2DualPriorityQueueConstRef
 
class  Stage2DualPriorityQueueRef
 
struct  StaticLinearAllocator
 A linear allocator that uses stack memory and follows std::pmr::memory_resource More...
 
class  StaticLinearAllocatorDebug
 
struct  str_add_float_params
 
class  Task
 
class  TaskBase
 A TaskBase (short for coroutine task) is the root of a linked list of nested coroutines. More...
 
struct  TestResult
 
class  Tick
 An overflow aware integer type for hardware timer/counter that are used as clocks. More...
 
class  TimePoint
 Overflow aware point in time for hardware timers/counters. More...
 
class  VoidPin
 Represents an unconnected pin that does nothing. More...
 
class  VoidPins
 

Concepts

concept  CStringView
 
concept  CRatio
 
concept  CStdDuration
 
concept  CStdOptional
 
concept  AwaitableLike
 
concept  cLCD_HD44780
 Template interface for the 'LCD_HD447080' or compatible version.
 
concept  cAwaitable
 Concept describeing the interface of an object that can be co_awaited.
 
concept  cOutPin
 Concept for a pin that can be immediatly written to.
 
concept  cInPin
 Concept for pin that can be immediatelly read from.
 
concept  cPin
 Concept for tri-state pin (high, low, input) that can be immediatelly read from and written to.
 
concept  cOutPins
 Concept for synchronous output pins.
 
concept  cInPins
 Concept for synchronous output pins.
 
concept  cPins
 Concept for tri-state pin (high, low, input) that can be immediatelly read from and written to.
 
concept  is_power_of_two
 
concept  CSchedulerLogger
 The concept for a logging device that can be passed into the Scheduler.
 

Enumerations

enum class  RoundingMethod { Up , Down , Nearest }
 
enum class  LCD_HD44780_NumberOfLines : unsigned int { One = 0 , Two = 0b00001000 }
 
enum class  LCD_HD44780_Dots : unsigned int { _5x8 = 0 , _5x11 = 0b00000100 }
 
enum class  LCD_HD44780_CursorEntryDirection : unsigned int { Decrement = 0 , Increment = 0b00000010 }
 
enum class  LCD_HD44780_DisplayEntryShift : unsigned int { Off = 0 , On = 0b00000001 }
 
enum class  LCD_HD44780_DisplayControl : unsigned int { Off = 0 , On = 0b00000100 }
 
enum class  LCD_HD44780_CursorControl : unsigned int { Off = 0 , On = 0b00000010 , Blink = 0b00000011 }
 
enum class  LCD_HD44780_CursorDisplayShift : unsigned int { CursorLeft = 0b00000000 , CursorRight = 0b00000100 , DisplayLeft = 0b00001000 , DisplayRight = 0b00001100 }
 
enum class  Exit { Success , Failure }
 
enum class  AlignmentLRC { Left , Right , Center }
 
enum class  FloatRepresentation { Scientific , Engineering , Full }
 Enum to specify the formating of floating point numbers. More...
 

Functions

OStreamoperator<< (OStream &stream, const Duration &duration)
 prints the time duration to the output stream
 
template<class ToDuration, RoundingMethod rounding_type = RoundingMethod::Up, class Rep = unsigned int, fiber::CRatio Period = std::ratio<1>>
constexpr ToDuration rounding_duration_cast (const std::chrono::duration< Rep, Period > &d)
 duration cast that round to the nearest tick of the new ToDuration
 
static fiber::TestResult ClockTick_test_construction ()
 
static fiber::TestResult ClockTick_test_addition ()
 
static fiber::TestResult ClockTick_test_subtraction ()
 
static fiber::TestResult ClockTest_negation ()
 
static fiber::TestResult ClockTick_test_comparison ()
 
static fiber::TestResult Duration_test_construction ()
 
static fiber::TestResult Duration_test_std_integration ()
 
uint32_t get_timer_count ()
 
static fiber::TestResult Clock_template_instantiation_and_time_point ()
 
fiber::TestResult ClockTick_test ()
 Tests Tick and instantiations of derived Duration, TimePoint, CClock and Clock.
 
OStreamoperator<< (OStream &stream, const TimePoint &time)
 prints the time point to the output stream
 
template<class T, std::size_t N, class Function>
auto for_each (const ArrayList< T, N > &list, Function &&function)
 
template<class T, std::size_t N>
OStreamoperator<< (OStream &stream, const ArrayList< T, N > &array)
 prints the array list to the output stream
 
template<class T, std::size_t N1, std::size_t N2, class F>
ArrayList< bool,(N1< N2) ? N1 :N2 > point_wise_compare (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs, F &&compare)
 performs a point wise comparison of the ArrayList
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_equal (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise equal list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_not_equal (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise un-equal list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_less (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise less list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_greater (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise greater list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_less_equal (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise less equal list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
auto point_wise_greater_equal (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise greater equal list of the left and right hand side
 
template<class T1, class T2, std::size_t N1, std::size_t N2>
bool operator== (const ArrayList< T1, N1 > &lhs, const ArrayList< T2, N2 > &rhs)
 returns the point wise equal list of the left and right hand side
 
template<class T, std::size_t N1, std::size_t N2>
bool operator!= (const ArrayList< T, N1 > &lhs, const ArrayList< T, N2 > &rhs)
 returns the point wise un-equal list of the left and right hand side
 
template<class T1, class T2, std::size_t N1, std::size_t N2>
bool operator< (const ArrayList< T1, N1 > &lhs, const ArrayList< T2, N2 > &rhs)
 returns the point wise less list of the left and right hand side
 
template<class T1, class T2, std::size_t N1, std::size_t N2>
bool operator> (const ArrayList< T1, N1 > &lhs, const ArrayList< T2, N2 > &rhs)
 returns the point wise greater list of the left and right hand side
 
template<class T1, class T2, std::size_t N1, std::size_t N2>
bool operator<= (const ArrayList< T1, N1 > &lhs, const ArrayList< T2, N2 > &rhs)
 returns the point wise less equal list of the left and right hand side
 
template<class T1, class T2, std::size_t N1, std::size_t N2>
bool operator>= (const ArrayList< T1, N1 > &lhs, const ArrayList< T2, N2 > &rhs)
 returns the point wise greater equal list of the left and right hand side
 
template<class T, std::size_t N1>
constexpr bool any (const ArrayList< T, N1 > &list)
 returns true if any (aka. at least one) values from the list (converted to bool) are true
 
template<class T, std::size_t N1>
constexpr bool all (const ArrayList< T, N1 > &lhs)
 returns true if all values from the list (converted to bool) are true
 
template<class T, std::size_t N1>
constexpr bool none (const ArrayList< T, N1 > &lhs)
 returns true if no values from the list (converted to bool) are true
 
template<class T, std::size_t N>
fiber::OStreamoperator<< (OStream &stream, const DualArrayList< T, N > &dlist)
 
fiber::TestResult ArrayList_test ()
 
fiber::TestResult DualArrayList_test ()
 
template<class A, class B>
constexpr bool equal (A a, B b)
 
template<std::integral A, std::integral B>
constexpr bool not_equal (A a, B b)
 
template<std::integral A, std::integral B>
constexpr bool less_equal (A a, B b)
 
template<std::integral A, std::integral B>
constexpr bool less (A a, B b)
 
template<std::integral A, std::integral B>
constexpr bool greater_equal (A a, B b)
 
template<std::integral A, std::integral B>
constexpr bool greater (A a, B b)
 
OStreamoperator<< (OStream &stream, const Exception &e)
 
template<class T>
FuturePromisePair< T > make_future_promise ()
 creates a linked future promise pair
 
template<std::size_t I, class T>
decltype(auto) get (fiber::FuturePromisePair< T > &&p)
 
static fiber::TestResult make_future_promise_test ()
 
static fiber::TestResult promise_set_value_test ()
 
static fiber::TestResult promise_assign_value_test ()
 
static fiber::TestResult handover_test ()
 
static fiber::TestResult broken_promise_test ()
 
fiber::TestResult Future_test ()
 
FIBER_WEAK void disable_interrupts_command ()
 Weak, user overloadable function that provides the command to disable interrupts.
 
FIBER_WEAK void enable_interrupts_command ()
 Weak, user overloadable function that probides the command to enable interrupts.
 
void disable_interrupts ()
 Function that is used to disable the interrupts.
 
void enable_interrupts ()
 Function pointer that is used to enable the interrupts.
 
float frexp10 (float value, int *exp10_out)
 
template<typename Int, typename std::enable_if< std::is_integral< Int >::value, int >::type = 0>
constexpr Int pow (const Int base, const unsigned int exponent)
 
constexpr std::size_t string_length (const char *str)
 returns the length of a terminated c-style string
 
bool is_nan (float value)
 
bool is_pinf (float value)
 
bool is_ninf (float value)
 
bool is_inf (float value)
 
void _memcpy (void *dest, const void *source, size_t count)
 Copies count many bytes from source to dest in a blocking behaviour.
 
void _async_memcpy (void *dest, const void *source, size_t count, Promise< int > promise)
 Copies count many bytes from source to dest in a blocking behaviour.
 
void memcpy_s (void *dest, size_t destSize, const void *source, size_t sourceSize)
 copies from source to dest so that no more bytes than destSize or sourceSize are written
 
void memcpy_s (void *destFirst, void *destLast, const void *sourceFirst, const void *sourceLast)
 Copies data from source to dest, without leaving the closed open range [first, last)
 
void async_memcpy_s (void *dest, size_t destSize, const void *source, size_t sourceSize, Promise< int > promise)
 
void async_memcpy_s (void *destFirst, void *destLast, const void *sourceFirst, const void *sourceLast, Promise< int > promise)
 
template<class Callable>
AwaitCallable< Callable, true > Await (bool expected, const Callable &callable)
 
template<class Callable>
AwaitCallable< Callable, false > Await (bool expected, Callable &&callable)
 
template<class Callable>
auto AwaitTrue (Callable &&callable)
 
template<class Callable>
auto AwaitFalse (Callable &&callable)
 
template<class Object, class Method>
AwaitMethod< Object, Method, true > Await (bool expected, const Object &object, Method method)
 
template<class Object, class Method>
AwaitMethod< Object, Method, true > Await (bool expected, Object &&object, Method method)
 
template<class Object, class Method>
auto AwaitTrue (Object &&object, Method method)
 
template<class Object, class Method>
auto AwaitFalse (Object &&object, Method method)
 
template<class Awaitable>
AwaitableWrapper< Awaitable, std::is_lvalue_reference< Awaitable >::value > wrap_awaitable (Awaitable &&awaitable)
 Construction helper for AwaitableWrapper.
 
fiber::OStreamoperator<< (fiber::OStream &stream, fiber::CoSignal::Type type)
 
OStreamoperator<< (OStream &stream, Exit value)
 
void default_sleep_until (TimePoint time)
 Default implementation for a function that should send the MCU to sleep until time, but does nothing.
 
fiber::TestResult Coroutine_test ()
 
TestResult Scheduler_test ()
 
template<class T>
_TryAwait< T, true > TryAwait (fiber::Future< T > &&future)
 Wraps an awaitable that returns an std::optional conditionally unpacks it or throws if there is no value.
 
template<class T>
_TryAwait< T, false > TryAwait (fiber::Future< T > &future)
 Wraps an awaitable that returns an std::optional conditionally unpacks it or throws if there is no value.
 
OStreamoperator<< (OStream &stream, const FormatStr &fstr)
 Writes a FormatStr to the stream that allows to pass the string length in addition to the const char* type string.
 
OStreamoperator<< (OStream &stream, const FormatBool &value)
 Writes a bool to the output stream and applies custom formating.
 
void print_num_stringified (OStream &stream, std::string_view sign_str, std::string_view num_str, const FormatIntParams &params)
 
void print_num_stringified (OStream &stream, std::string_view sign_str, std::string_view num_str, std::string_view suffix, const FormatIntSuffixParams &params)
 
char * str_add_float (char *first, char *last, const FormatFloat &value)
 
OStreamoperator<< (OStream &stream, FormatFloat value)
 
void newl (OStream &stream)
 Writes a new line character to the stream.
 
void flush (OStream &stream)
 Writes a new line character to the stream.
 
void endl (OStream &stream)
 Writes a new line character to the stream followed by a call to OStream::flush()
 
OStreamoperator<< (OStream &stream, void(*function)(OStream &))
 Calls a function with the stream as the argument.
 
OStreamoperator<< (OStream &stream, char c)
 Writes a char to the stream.
 
OStreamoperator<< (OStream &stream, const char *str)
 writes a terminated c-style string to the stream
 
template<CStringView StringView>
OStreamoperator<< (OStream &stream, const StringView &str)
 
OStreamoperator<< (OStream &stream, bool value)
 Default bool formating, uses the settings of the stream.
 
template<std::unsigned_integral UInt>
std::string_view uint_to_string (char *buffer_first, char *buffer_last, UInt value, bool use_thousands_char=false, char thousands_char=',')
 
template<std::integral Int>
requires (std::same_as<Int, typename fiber::make_fast<Int>::type>)
void print_fast_int (OStream &stream, const Int &value, const FormatIntParams &params)
 
template<std::integral Int>
void print (OStream &stream, const Int &value, const FormatIntParams &params)
 
template<std::integral Int>
OStreamoperator<< (OStream &stream, const FormatInt< Int > &fvalue)
 
template<std::integral Int>
OStreamoperator<< (OStream &stream, const Int &value)
 
template<std::integral Int>
requires (std::same_as<Int, typename fiber::make_fast<Int>::type>)
void print_fast_int (OStream &stream, const Int &value, std::string_view suffix, const FormatIntSuffixParams &params)
 
template<std::integral Int>
void print (OStream &stream, const Int &value, std::string_view suffix, const FormatIntSuffixParams &params)
 
template<std::integral Int>
OStreamoperator<< (OStream &stream, const FormatIntSuffix< Int > &value)
 
template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0>
OStreamoperator<< (OStream &stream, Float value)
 
template<std::unsigned_integral UInt>
OStreamoperator<< (OStream &stream, FormatHex< UInt > hex)
 
template<class T>
OStreamoperator<< (OStream &stream, const T *ptr)
 
OStreamoperator<< (OStream &stream, std::nullptr_t ptr)
 
template<class Rep, class Period = std::ratio<1, 1>>
auto format_chrono (std::chrono::duration< Rep, Period > duration)
 
template<class Rep, class Period = std::ratio<1, 1>>
OStreamoperator<< (OStream &stream, std::chrono::duration< Rep, Period > duration)
 
template<class T>
OStreamoperator<< (OStream &stream, std::reverse_iterator< T > value)
 
template<class T>
OStreamoperator<< (OStreamRef stream, const T &value)
 
void OutputStream_test_string_formating (OStream &stream)
 
void OutputStream_test_bool_formating (OStream &stream)
 
void OutputStream_test_integer_formating (OStream &stream)
 
void OutputStream_test_float_formating (OStream &stream)
 
void OutputStream_test (OStream &stream)
 
int evaluate (TestResult result)
 
void print_failed_function_file_line (const char *signature, const char *file, std::size_t line)
 
void TEST_FUNC_print_1 (const char *signature, const char *file, std::size_t line, const char *test_func, const char *val_str)
 
void TEST_FUNC2_print_1 (const char *signature, const char *file, std::size_t line, const char *test_func, const char *lhs_str, const char *rhs_str)
 
void TEST_BINARY_OPERATOR_print_1 (const char *signature, const char *file, std::size_t line, const char *lhs_str, const char *op, const char *rhs_str)
 
void TEST_NOT_BINARY_OPERATOR_print_1 (const char *signature, const char *file, std::size_t line, const char *lhs_str, const char *op, const char *rhs_str)
 
void TEST_TRUE_print_1 (const char *signature, const char *file, std::size_t line, const char *val)
 
void TEST_FALSE_print_1 (const char *signature, const char *file, std::size_t line, const char *val)
 
void TEST_ERROR_print (const char *signature, const char *file, std::size_t line)
 
template<class T, class R>
void TEST_FUNC_print_2 (const char *test_func, const T &val, const R &result)
 
template<class T1, class T2, class R>
void TEST_FUNC2_print_2 (const char *test_func, const T1 &lhs, const T2 &rhs, const R &result)
 
template<class T1, class T2, class R>
void TEST_BINARY_OPERATOR_print_2 (const T1 &lhs, const char *op, const T2 &rhs, const R &result)
 
template<class T1, class T2, class R>
void TEST_NOT_BINARY_OPERATOR_print_2 (const T1 &lhs, const char *op, const T2 &rhs, const R &result)
 
template<class R>
void TEST_TRUE_print_2 (const R &val)
 
template<class R>
void TEST_FALSE_print_2 (const R &val)
 
constexpr TestResult operator| (TestResult lhs, TestResult rhs)
 
constexpr int operator| (TestResult lhs, int(*f)(TestResult))
 
constexpr TestResult operator| (TestResult lhs, TestResult(*test)(void))
 

Variables

template<typename T>
constexpr bool is_clocktick = false
 
template<typename U, U Max>
constexpr bool is_clocktick< Tick< U, Max > > = true
 
template<class T>
constexpr bool is_std_optional_v = is_std_optional<T>::value
 
static std::atomic< uint32_t > _irq_disable_count {0}
 
void(* memcpy )(void *dest, const void *source, size_t count) = _memcpy
 Function that the fiber:: library uses to copy memory.
 
void(* async_memcpy )(void *dest, const void *source, size_t count, Promise< int > promise) = _async_memcpy
 Function that the fiber library uses to copy memory.
 
template<class T>
constexpr bool is_coroutine_v = is_coroutine<T>::value
 
OStreamRef cout
 
OStreamRef cerr
 
OStreamRef clog
 
static constexpr const char * expected_true_but = " expected `true` but: `"
 
static constexpr const char * expected_false_but = " expected `false` but: `"
 
static constexpr const char * indented_arrow = " --> `"
 

Enumeration Type Documentation

◆ AlignmentLRC

enum class fiber::AlignmentLRC
strong
Enumerator
Left 
Right 
Center 

◆ Exit

enum class fiber::Exit
strong
Enumerator
Success 

Task completed successfully; destroy it.

Failure 

Task failed; notify or destroy.

◆ FloatRepresentation

enum class fiber::FloatRepresentation
strong

Enum to specify the formating of floating point numbers.

Enumerator
Scientific 

numbers are represented, so that there is always only one digit before the comma. E.g.: 1.23, 1.23e+1, 1.23e+2, 1.23e+3

Engineering 

numbers are represented with exponents in order or three. E.g.: 1.23, 12.3, 123e, 1.23e+3

Full 

numbers are represented fully without exponents. E.g.: 1.23, 12.3, 123., 1230

◆ LCD_HD44780_CursorControl

enum class fiber::LCD_HD44780_CursorControl : unsigned int
strong
Enumerator
Off 
On 
Blink 

◆ LCD_HD44780_CursorDisplayShift

enum class fiber::LCD_HD44780_CursorDisplayShift : unsigned int
strong
Enumerator
CursorLeft 
CursorRight 
DisplayLeft 
DisplayRight 

◆ LCD_HD44780_CursorEntryDirection

enum class fiber::LCD_HD44780_CursorEntryDirection : unsigned int
strong
Enumerator
Decrement 
Increment 

◆ LCD_HD44780_DisplayControl

enum class fiber::LCD_HD44780_DisplayControl : unsigned int
strong
Enumerator
Off 
On 

◆ LCD_HD44780_DisplayEntryShift

enum class fiber::LCD_HD44780_DisplayEntryShift : unsigned int
strong
Enumerator
Off 
On 

◆ LCD_HD44780_Dots

enum class fiber::LCD_HD44780_Dots : unsigned int
strong
Enumerator
_5x8 
_5x11 

◆ LCD_HD44780_NumberOfLines

enum class fiber::LCD_HD44780_NumberOfLines : unsigned int
strong
Enumerator
One 
Two 

◆ RoundingMethod

enum class fiber::RoundingMethod
strong
Enumerator
Up 
Down 
Nearest 

Function Documentation

◆ _async_memcpy()

void fiber::_async_memcpy ( void * dest,
const void * source,
size_t count,
Promise< int > promise )

Copies count many bytes from source to dest in a blocking behaviour.

Internal/default implementation for fiber::async_memcpy that the fiber library uses to copy data. Redirect the fiber::memcpy and fiber::async_memcpy function pinters to overload it with your custom copy implementation, that for example uses a direct memory access controller (DMA).

Parameters
destPointer to the destination to which count many bytes will be written
sourcePointer to the source from which count many bytes will be read
countThe number of bytes that will be copied
promiseThe caller will generate a Future that stores a future value. From which this promise is derived. The Promise will signal to the future when the asynchrunous operation completed.

◆ _memcpy()

void fiber::_memcpy ( void * dest,
const void * source,
size_t count )

Copies count many bytes from source to dest in a blocking behaviour.

Internal/default implementation for fiber::memcpy that the fiber library uses to copy data. Redirect the fiber::memcpy and fiber::async_memcpy function pinters to overload it with your custom copy implementation, that for example uses a direct memory access controller (DMA).

Parameters
destPointer to the destination to which count many bytes will be written
sourcePointer to the source from which count many bytes will be read
countThe number of bytes that will be copied

◆ all()

template<class T, std::size_t N1>
bool fiber::all ( const ArrayList< T, N1 > & lhs)
constexpr

returns true if all values from the list (converted to bool) are true

◆ any()

template<class T, std::size_t N1>
bool fiber::any ( const ArrayList< T, N1 > & list)
constexpr

returns true if any (aka. at least one) values from the list (converted to bool) are true

◆ ArrayList_test()

fiber::TestResult fiber::ArrayList_test ( )

◆ async_memcpy_s() [1/2]

void fiber::async_memcpy_s ( void * dest,
size_t destSize,
const void * source,
size_t sourceSize,
Promise< int > promise )
inline

◆ async_memcpy_s() [2/2]

void fiber::async_memcpy_s ( void * destFirst,
void * destLast,
const void * sourceFirst,
const void * sourceLast,
Promise< int > promise )
inline

◆ Await() [1/4]

template<class Callable>
AwaitCallable< Callable, false > fiber::Await ( bool expected,
Callable && callable )

◆ Await() [2/4]

template<class Callable>
AwaitCallable< Callable, true > fiber::Await ( bool expected,
const Callable & callable )

◆ Await() [3/4]

template<class Object, class Method>
AwaitMethod< Object, Method, true > fiber::Await ( bool expected,
const Object & object,
Method method )

◆ Await() [4/4]

template<class Object, class Method>
AwaitMethod< Object, Method, true > fiber::Await ( bool expected,
Object && object,
Method method )

◆ AwaitFalse() [1/2]

template<class Callable>
auto fiber::AwaitFalse ( Callable && callable)

◆ AwaitFalse() [2/2]

template<class Object, class Method>
auto fiber::AwaitFalse ( Object && object,
Method method )

◆ AwaitTrue() [1/2]

template<class Callable>
auto fiber::AwaitTrue ( Callable && callable)

◆ AwaitTrue() [2/2]

template<class Object, class Method>
auto fiber::AwaitTrue ( Object && object,
Method method )

◆ broken_promise_test()

static fiber::TestResult fiber::broken_promise_test ( )
static

◆ Clock_template_instantiation_and_time_point()

static fiber::TestResult fiber::Clock_template_instantiation_and_time_point ( )
static

◆ ClockTest_negation()

static fiber::TestResult fiber::ClockTest_negation ( )
static

◆ ClockTick_test()

fiber::TestResult fiber::ClockTick_test ( )

Tests Tick and instantiations of derived Duration, TimePoint, CClock and Clock.

Depends on OStream, fiber::cerr and fiber::cout.

◆ ClockTick_test_addition()

static fiber::TestResult fiber::ClockTick_test_addition ( )
static

◆ ClockTick_test_comparison()

static fiber::TestResult fiber::ClockTick_test_comparison ( )
static

◆ ClockTick_test_construction()

static fiber::TestResult fiber::ClockTick_test_construction ( )
static

◆ ClockTick_test_subtraction()

static fiber::TestResult fiber::ClockTick_test_subtraction ( )
static

◆ Coroutine_test()

fiber::TestResult fiber::Coroutine_test ( )

◆ default_sleep_until()

void fiber::default_sleep_until ( TimePoint time)

Default implementation for a function that should send the MCU to sleep until time, but does nothing.

◆ disable_interrupts()

void fiber::disable_interrupts ( )

Function that is used to disable the interrupts.

This function disables interrupts in a thread safe manner. It will make sure that in a series of calls to disable_interrupts() and enable_interrupts() only the first will disable it and the last will enable it.

It will internally call the user overloadable weak function:

FIBER_WEAK void disable_interrupts_command()
Weak, user overloadable function that provides the command to disable interrupts.
Definition interrupts.cpp:107

If you are working on a single core machine without peremption, consider defining FIBER_SINGLE_CORE for a simplified and faster version.

◆ disable_interrupts_command()

FIBER_WEAK void fiber::disable_interrupts_command ( )

Weak, user overloadable function that provides the command to disable interrupts.

◆ DualArrayList_test()

fiber::TestResult fiber::DualArrayList_test ( )

◆ Duration_test_construction()

static fiber::TestResult fiber::Duration_test_construction ( )
static

◆ Duration_test_std_integration()

static fiber::TestResult fiber::Duration_test_std_integration ( )
static

◆ enable_interrupts()

void fiber::enable_interrupts ( )

Function pointer that is used to enable the interrupts.

This function enables interrupts in a thread safe manner. It will make sure that in a series of calls to disable_interrupts() and enable_interrupts() only the first will disable it and the last will enable it.

It will internally call the user overloadable weak function:

FIBER_WEAK void enable_interrupts_command()
Weak, user overloadable function that probides the command to enable interrupts.
Definition interrupts.cpp:112

If you are working on a single core machine without peremption, consider defining FIBER_SINGLE_CORE for a simplified and faster version.

◆ enable_interrupts_command()

FIBER_WEAK void fiber::enable_interrupts_command ( )

Weak, user overloadable function that probides the command to enable interrupts.

◆ endl()

void fiber::endl ( OStream & stream)
inline

Writes a new line character to the stream followed by a call to OStream::flush()

Calls OStream::endl(). Uses the new line character set by the stream with OStream::new_line_char().

◆ equal()

template<class A, class B>
bool fiber::equal ( A a,
B b )
constexpr

◆ evaluate()

int fiber::evaluate ( TestResult result)

◆ flush()

void fiber::flush ( OStream & stream)
inline

Writes a new line character to the stream.

Calls OStream::flush().

◆ for_each()

template<class T, std::size_t N, class Function>
auto fiber::for_each ( const ArrayList< T, N > & list,
Function && function )

◆ format_chrono()

template<class Rep, class Period = std::ratio<1, 1>>
auto fiber::format_chrono ( std::chrono::duration< Rep, Period > duration)

◆ frexp10()

float fiber::frexp10 ( float value,
int * exp10_out )

◆ Future_test()

fiber::TestResult fiber::Future_test ( )

◆ get()

template<std::size_t I, class T>
decltype(auto) fiber::get ( fiber::FuturePromisePair< T > && p)

◆ get_timer_count()

uint32_t fiber::get_timer_count ( )

◆ greater()

template<std::integral A, std::integral B>
bool fiber::greater ( A a,
B b )
constexpr

◆ greater_equal()

template<std::integral A, std::integral B>
bool fiber::greater_equal ( A a,
B b )
constexpr

◆ handover_test()

static fiber::TestResult fiber::handover_test ( )
static

◆ is_inf()

bool fiber::is_inf ( float value)
inline

◆ is_nan()

bool fiber::is_nan ( float value)
inline

◆ is_ninf()

bool fiber::is_ninf ( float value)
inline

◆ is_pinf()

bool fiber::is_pinf ( float value)
inline

◆ less()

template<std::integral A, std::integral B>
bool fiber::less ( A a,
B b )
constexpr

◆ less_equal()

template<std::integral A, std::integral B>
bool fiber::less_equal ( A a,
B b )
constexpr

◆ make_future_promise()

template<class T>
FuturePromisePair< T > fiber::make_future_promise ( )

creates a linked future promise pair

Example:

auto [future, promise] = make_future_promise<int>();
FuturePromisePair< T > make_future_promise()
creates a linked future promise pair
Definition Future.hpp:751
Template Parameters
TThe type that is being promised by the promise and awaited by the future
Returns
A linked FuturePromisePair Future promise pair

◆ make_future_promise_test()

static fiber::TestResult fiber::make_future_promise_test ( )
static

◆ memcpy_s() [1/2]

void fiber::memcpy_s ( void * dest,
size_t destSize,
const void * source,
size_t sourceSize )
inline

copies from source to dest so that no more bytes than destSize or sourceSize are written

Parameters
desta pointer to the destination that data should be written to
destSizeThe number of bytes that can be written to dest
sourcea pointer to the source that data should be read from
sourceSizeThe number of bytes that can be read from the source

◆ memcpy_s() [2/2]

void fiber::memcpy_s ( void * destFirst,
void * destLast,
const void * sourceFirst,
const void * sourceLast )
inline

Copies data from source to dest, without leaving the closed open range [first, last)

Parameters
destFirstPointer to the first byte that should be written to
destLastPointer past the last byte that should be written to
sourceFirstPointer to the first byte that should be read from
sourceLastPointer past the last byte that should be read from

◆ newl()

void fiber::newl ( OStream & stream)
inline

Writes a new line character to the stream.

Calls OStream::newl(). Uses the new line character set by the stream with OStream::new_line_char().

◆ none()

template<class T, std::size_t N1>
bool fiber::none ( const ArrayList< T, N1 > & lhs)
constexpr

returns true if no values from the list (converted to bool) are true

◆ not_equal()

template<std::integral A, std::integral B>
bool fiber::not_equal ( A a,
B b )
constexpr

◆ operator!=()

template<class T, std::size_t N1, std::size_t N2>
bool fiber::operator!= ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise un-equal list of the left and right hand side

◆ operator<()

template<class T1, class T2, std::size_t N1, std::size_t N2>
bool fiber::operator< ( const ArrayList< T1, N1 > & lhs,
const ArrayList< T2, N2 > & rhs )
inline

returns the point wise less list of the left and right hand side

◆ operator<<() [1/25]

OStream & fiber::operator<< ( fiber::OStream & stream,
fiber::CoSignal::Type type )

◆ operator<<() [2/25]

OStream & fiber::operator<< ( OStream & stream,
bool value )
inline

Default bool formating, uses the settings of the stream.

◆ operator<<() [3/25]

OStream & fiber::operator<< ( OStream & stream,
char c )
inline

Writes a char to the stream.

◆ operator<<() [4/25]

template<class T, std::size_t N>
OStream & fiber::operator<< ( OStream & stream,
const ArrayList< T, N > & array )

prints the array list to the output stream

◆ operator<<() [5/25]

OStream & fiber::operator<< ( OStream & stream,
const char * str )
inline

writes a terminated c-style string to the stream

◆ operator<<() [6/25]

template<class T, std::size_t N>
fiber::OStream & fiber::operator<< ( OStream & stream,
const DualArrayList< T, N > & dlist )

◆ operator<<() [7/25]

OStream & fiber::operator<< ( OStream & stream,
const Duration & duration )
inline

prints the time duration to the output stream

◆ operator<<() [8/25]

OStream & fiber::operator<< ( OStream & stream,
const Exception & e )

◆ operator<<() [9/25]

OStream & fiber::operator<< ( OStream & stream,
const FormatBool & value )

Writes a bool to the output stream and applies custom formating.

◆ operator<<() [10/25]

template<std::integral Int>
OStream & fiber::operator<< ( OStream & stream,
const FormatInt< Int > & fvalue )
inline

◆ operator<<() [11/25]

template<std::integral Int>
OStream & fiber::operator<< ( OStream & stream,
const FormatIntSuffix< Int > & value )

◆ operator<<() [12/25]

OStream & fiber::operator<< ( OStream & stream,
const FormatStr & fstr )

Writes a FormatStr to the stream that allows to pass the string length in addition to the const char* type string.

◆ operator<<() [13/25]

template<std::integral Int>
OStream & fiber::operator<< ( OStream & stream,
const Int & value )
inline

◆ operator<<() [14/25]

template<CStringView StringView>
OStream & fiber::operator<< ( OStream & stream,
const StringView & str )
inline

◆ operator<<() [15/25]

template<class T>
OStream & fiber::operator<< ( OStream & stream,
const T * ptr )
inline

◆ operator<<() [16/25]

OStream & fiber::operator<< ( OStream & stream,
const TimePoint & time )
inline

prints the time point to the output stream

◆ operator<<() [17/25]

OStream & fiber::operator<< ( OStream & stream,
Exit value )
inline

◆ operator<<() [18/25]

template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0>
OStream & fiber::operator<< ( OStream & stream,
Float value )
inline

◆ operator<<() [19/25]

OStream & fiber::operator<< ( OStream & stream,
FormatFloat value )

◆ operator<<() [20/25]

template<std::unsigned_integral UInt>
OStream & fiber::operator<< ( OStream & stream,
FormatHex< UInt > hex )

◆ operator<<() [21/25]

template<class Rep, class Period = std::ratio<1, 1>>
OStream & fiber::operator<< ( OStream & stream,
std::chrono::duration< Rep, Period > duration )

◆ operator<<() [22/25]

OStream & fiber::operator<< ( OStream & stream,
std::nullptr_t ptr )
inline

◆ operator<<() [23/25]

template<class T>
OStream & fiber::operator<< ( OStream & stream,
std::reverse_iterator< T > value )

◆ operator<<() [24/25]

OStream & fiber::operator<< ( OStream & stream,
void(* function )(OStream &) )
inline

Calls a function with the stream as the argument.

Example:

void function(OStream&){
// do stuff
}
int main(){
stream << function;
// is equivalent to
function(stream)
// Intended usages:
using namespace fiber;
stream << "This is followed by a new line" << newl();
stream << "This line is flushed" << flush();
stream << "This line is followed by a newline and flushed" << endl();
}
Abstract class for an output character stream that offers string and number formating.
Definition OStream.hpp:125
Definition Duration.hpp:17
void endl(OStream &stream)
Writes a new line character to the stream followed by a call to OStream::flush()
Definition OStream.hpp:198
void flush(OStream &stream)
Writes a new line character to the stream.
Definition OStream.hpp:190
void newl(OStream &stream)
Writes a new line character to the stream.
Definition OStream.hpp:183
int main()
Definition test_main.cpp:23

◆ operator<<() [25/25]

template<class T>
OStream & fiber::operator<< ( OStreamRef stream,
const T & value )
inline

◆ operator<=()

template<class T1, class T2, std::size_t N1, std::size_t N2>
bool fiber::operator<= ( const ArrayList< T1, N1 > & lhs,
const ArrayList< T2, N2 > & rhs )
inline

returns the point wise less equal list of the left and right hand side

◆ operator==()

template<class T1, class T2, std::size_t N1, std::size_t N2>
bool fiber::operator== ( const ArrayList< T1, N1 > & lhs,
const ArrayList< T2, N2 > & rhs )
inline

returns the point wise equal list of the left and right hand side

◆ operator>()

template<class T1, class T2, std::size_t N1, std::size_t N2>
bool fiber::operator> ( const ArrayList< T1, N1 > & lhs,
const ArrayList< T2, N2 > & rhs )
inline

returns the point wise greater list of the left and right hand side

◆ operator>=()

template<class T1, class T2, std::size_t N1, std::size_t N2>
bool fiber::operator>= ( const ArrayList< T1, N1 > & lhs,
const ArrayList< T2, N2 > & rhs )
inline

returns the point wise greater equal list of the left and right hand side

◆ operator|() [1/3]

int fiber::operator| ( TestResult lhs,
int(* )(TestResult) )
constexpr

◆ operator|() [2/3]

TestResult fiber::operator| ( TestResult lhs,
TestResult rhs )
constexpr

◆ operator|() [3/3]

TestResult fiber::operator| ( TestResult lhs,
TestResult(* test )(void) )
constexpr

◆ OutputStream_test()

void fiber::OutputStream_test ( OStream & stream)

◆ OutputStream_test_bool_formating()

void fiber::OutputStream_test_bool_formating ( OStream & stream)

◆ OutputStream_test_float_formating()

void fiber::OutputStream_test_float_formating ( OStream & stream)

◆ OutputStream_test_integer_formating()

void fiber::OutputStream_test_integer_formating ( OStream & stream)

◆ OutputStream_test_string_formating()

void fiber::OutputStream_test_string_formating ( OStream & stream)

◆ point_wise_compare()

template<class T, std::size_t N1, std::size_t N2, class F>
ArrayList< bool,(N1< N2) ? N1 :N2 > fiber::point_wise_compare ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs,
F && compare )

performs a point wise comparison of the ArrayList

Returns
a boolean array list of the intersection of both lists with the result of the compare function

◆ point_wise_equal()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_equal ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise equal list of the left and right hand side

◆ point_wise_greater()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_greater ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise greater list of the left and right hand side

◆ point_wise_greater_equal()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_greater_equal ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise greater equal list of the left and right hand side

◆ point_wise_less()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_less ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise less list of the left and right hand side

◆ point_wise_less_equal()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_less_equal ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise less equal list of the left and right hand side

◆ point_wise_not_equal()

template<class T, std::size_t N1, std::size_t N2>
auto fiber::point_wise_not_equal ( const ArrayList< T, N1 > & lhs,
const ArrayList< T, N2 > & rhs )
inline

returns the point wise un-equal list of the left and right hand side

◆ pow()

template<typename Int, typename std::enable_if< std::is_integral< Int >::value, int >::type = 0>
Int fiber::pow ( const Int base,
const unsigned int exponent )
constexpr

◆ print() [1/2]

template<std::integral Int>
void fiber::print ( OStream & stream,
const Int & value,
const FormatIntParams & params )
inline

◆ print() [2/2]

template<std::integral Int>
void fiber::print ( OStream & stream,
const Int & value,
std::string_view suffix,
const FormatIntSuffixParams & params )
inline

◆ print_failed_function_file_line()

void fiber::print_failed_function_file_line ( const char * signature,
const char * file,
std::size_t line )

◆ print_fast_int() [1/2]

template<std::integral Int>
requires (std::same_as<Int, typename fiber::make_fast<Int>::type>)
void fiber::print_fast_int ( OStream & stream,
const Int & value,
const FormatIntParams & params )

◆ print_fast_int() [2/2]

template<std::integral Int>
requires (std::same_as<Int, typename fiber::make_fast<Int>::type>)
void fiber::print_fast_int ( OStream & stream,
const Int & value,
std::string_view suffix,
const FormatIntSuffixParams & params )

◆ print_num_stringified() [1/2]

void fiber::print_num_stringified ( OStream & stream,
std::string_view sign_str,
std::string_view num_str,
const FormatIntParams & params )

◆ print_num_stringified() [2/2]

void fiber::print_num_stringified ( OStream & stream,
std::string_view sign_str,
std::string_view num_str,
std::string_view suffix,
const FormatIntSuffixParams & params )

◆ promise_assign_value_test()

static fiber::TestResult fiber::promise_assign_value_test ( )
static

◆ promise_set_value_test()

static fiber::TestResult fiber::promise_set_value_test ( )
static

◆ rounding_duration_cast()

template<class ToDuration, RoundingMethod rounding_type = RoundingMethod::Up, class Rep = unsigned int, fiber::CRatio Period = std::ratio<1>>
ToDuration fiber::rounding_duration_cast ( const std::chrono::duration< Rep, Period > & d)
constexpr

duration cast that round to the nearest tick of the new ToDuration

◆ Scheduler_test()

fiber::TestResult fiber::Scheduler_test ( )

◆ str_add_float()

char * fiber::str_add_float ( char * first,
char * last,
const FormatFloat & value )

◆ string_length()

std::size_t fiber::string_length ( const char * str)
constexpr

returns the length of a terminated c-style string

◆ TEST_BINARY_OPERATOR_print_1()

void fiber::TEST_BINARY_OPERATOR_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * lhs_str,
const char * op,
const char * rhs_str )

◆ TEST_BINARY_OPERATOR_print_2()

template<class T1, class T2, class R>
void fiber::TEST_BINARY_OPERATOR_print_2 ( const T1 & lhs,
const char * op,
const T2 & rhs,
const R & result )

◆ TEST_ERROR_print()

void fiber::TEST_ERROR_print ( const char * signature,
const char * file,
std::size_t line )

◆ TEST_FALSE_print_1()

void fiber::TEST_FALSE_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * val )

◆ TEST_FALSE_print_2()

template<class R>
void fiber::TEST_FALSE_print_2 ( const R & val)

◆ TEST_FUNC2_print_1()

void fiber::TEST_FUNC2_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * test_func,
const char * lhs_str,
const char * rhs_str )

◆ TEST_FUNC2_print_2()

template<class T1, class T2, class R>
void fiber::TEST_FUNC2_print_2 ( const char * test_func,
const T1 & lhs,
const T2 & rhs,
const R & result )

◆ TEST_FUNC_print_1()

void fiber::TEST_FUNC_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * test_func,
const char * val_str )

◆ TEST_FUNC_print_2()

template<class T, class R>
void fiber::TEST_FUNC_print_2 ( const char * test_func,
const T & val,
const R & result )

◆ TEST_NOT_BINARY_OPERATOR_print_1()

void fiber::TEST_NOT_BINARY_OPERATOR_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * lhs_str,
const char * op,
const char * rhs_str )

◆ TEST_NOT_BINARY_OPERATOR_print_2()

template<class T1, class T2, class R>
void fiber::TEST_NOT_BINARY_OPERATOR_print_2 ( const T1 & lhs,
const char * op,
const T2 & rhs,
const R & result )

◆ TEST_TRUE_print_1()

void fiber::TEST_TRUE_print_1 ( const char * signature,
const char * file,
std::size_t line,
const char * val )

◆ TEST_TRUE_print_2()

template<class R>
void fiber::TEST_TRUE_print_2 ( const R & val)

◆ TryAwait() [1/2]

template<class T>
_TryAwait< T, true > fiber::TryAwait ( fiber::Future< T > && future)

Wraps an awaitable that returns an std::optional conditionally unpacks it or throws if there is no value.

Example:

Future<int> async_func(); // returns `std::optional<int>` in `co_await`
// TryAwait unpacks the int and throws if the optional does not hold a value
int result = co_await TryAwait(async_func());
}
Owning handle to a coroutine with a custom promise type.
Definition Coroutine.hpp:135
Future and Promise pairs are used to synchronise values between asynchronous tasks.
Definition Future.hpp:62
_TryAwait< T, true > TryAwait(fiber::Future< T > &&future)
Wraps an awaitable that returns an std::optional conditionally unpacks it or throws if there is no va...
Definition TryAwait.hpp:144

◆ TryAwait() [2/2]

template<class T>
_TryAwait< T, false > fiber::TryAwait ( fiber::Future< T > & future)

Wraps an awaitable that returns an std::optional conditionally unpacks it or throws if there is no value.

Example:

Future<int> async_func(); // returns `std::optional<int>` in `co_await`
// TryAwait unpacks the int and throws if the optional does not hold a value
int result = co_await TryAwait(async_func());
}

◆ uint_to_string()

template<std::unsigned_integral UInt>
std::string_view fiber::uint_to_string ( char * buffer_first,
char * buffer_last,
UInt value,
bool use_thousands_char = false,
char thousands_char = ',' )

◆ wrap_awaitable()

template<class Awaitable>
AwaitableWrapper< Awaitable, std::is_lvalue_reference< Awaitable >::value > fiber::wrap_awaitable ( Awaitable && awaitable)

Construction helper for AwaitableWrapper.

AwaitableWrapper has two specialisations: awaitables passed as lvalue- and rvalue-references. Depending on how the awaitable is passed to wrap_awaitable() the corresponding specialisation is instantiated.

Template Parameters
Awaitableand awaitable that does not derive from AwaitableNode
Parameters
awaitablethe awaitable object as lvalue- or rvalue-reference
See also
fiber::AwaitableWrapper
fiber::AwaitableNode

Variable Documentation

◆ _irq_disable_count

std::atomic<uint32_t> fiber::_irq_disable_count {0}
static

◆ async_memcpy

void(* fiber::async_memcpy)(void *dest, const void *source, size_t count, Promise< int > promise) ( void * dest,
const void * source,
size_t count,
Promise< int > promise ) = _async_memcpy

Function that the fiber library uses to copy memory.

The expected behaviour of memcpy is to copy count many bytes from source to dest in a non-blocking behaviour, aka. the function returns immediately after it has beed called which might happen before the copy finished.

This function pointer can be overloaded by the user for a concrete implementation that uses hardware acceleration, like f.e. a DMA controller that can copy data independently of the main prozessing thread.

Note: the default implementation is a blocking one.

Parameters
destPointer to the destination to which count many bytes will be written
sourcePointer to the source from which count many bytes will be read
countThe number of bytes that will be copied
promiseA promise of a future result derived from a Future type. So: pass a Future in here.

◆ cerr

OStreamRef fiber::cerr

◆ clog

OStreamRef fiber::clog

◆ cout

OStreamRef fiber::cout

◆ expected_false_but

const char* fiber::expected_false_but = " expected `false` but: `"
staticconstexpr

◆ expected_true_but

const char* fiber::expected_true_but = " expected `true` but: `"
staticconstexpr

◆ indented_arrow

const char* fiber::indented_arrow = " --> `"
staticconstexpr

◆ is_clocktick

template<typename T>
bool fiber::is_clocktick = false
inlineconstexpr

◆ is_clocktick< Tick< U, Max > >

template<typename U, U Max>
bool fiber::is_clocktick< Tick< U, Max > > = true
inlineconstexpr

◆ is_coroutine_v

template<class T>
bool fiber::is_coroutine_v = is_coroutine<T>::value
constexpr

◆ is_std_optional_v

template<class T>
bool fiber::is_std_optional_v = is_std_optional<T>::value
inlineconstexpr

◆ memcpy

void(* fiber::memcpy)(void *dest, const void *source, size_t count) ( void * dest,
const void * source,
size_t count ) = _memcpy

Function that the fiber:: library uses to copy memory.

The expected behaviour of memcpy is to copy count many bytes from source to dest in a blocking behaviour, aka. the function returns once the copy has completed.

This function pointer can be overloaded by the user for a concrete implementation that uses hardware acceleration.

Parameters
destPointer to the destination to which count many bytes will be written
sourcePointer to the source from which count many bytes will be read
countThe number of bytes that will be copied