KiCad PCB EDA Suite
COROUTINE< ReturnType, ArgType >::CALL_CONTEXT Class Reference

Public Member Functions

void SetMainStack (CONTEXT_T *aStack)
 
void RunMainStack (COROUTINE *aCor, std::function< void()> aFunc)
 
void Continue (INVOCATION_ARGS *args)
 

Private Attributes

CONTEXT_Tm_mainStackContext
 
std::function< void()> m_mainStackFunction
 

Detailed Description

template<typename ReturnType, typename ArgType>
class COROUTINE< ReturnType, ArgType >::CALL_CONTEXT

Definition at line 82 of file coroutine.h.

Member Function Documentation

template<typename ReturnType, typename ArgType>
void COROUTINE< ReturnType, ArgType >::CALL_CONTEXT::Continue ( INVOCATION_ARGS args)
inline
template<typename ReturnType, typename ArgType>
void COROUTINE< ReturnType, ArgType >::CALL_CONTEXT::RunMainStack ( COROUTINE aCor,
std::function< void()>  aFunc 
)
inline

Definition at line 90 of file coroutine.h.

References COROUTINE< ReturnType, ArgType >::INVOCATION_ARGS::CONTINUE_AFTER_ROOT, jump_fcontext(), and COROUTINE< ReturnType, ArgType >::m_callee.

Referenced by COROUTINE< int, int >::RunMainStack().

91  {
92  m_mainStackFunction = std::move( aFunc );
93  INVOCATION_ARGS args{ INVOCATION_ARGS::CONTINUE_AFTER_ROOT, aCor, this };
94 
96  reinterpret_cast<intptr_t>( &args ) );
97  }
intptr_t LIBCONTEXT_CALL_CONVENTION jump_fcontext(fcontext_t *ofc, fcontext_t nfc, intptr_t vp, bool preserve_fpu=true)
CONTEXT_T * m_mainStackContext
Definition: coroutine.h:110
std::function< void()> m_mainStackFunction
Definition: coroutine.h:111
CALLEE_STORAGE m_callee
Definition: coroutine.h:383
template<typename ReturnType, typename ArgType>
void COROUTINE< ReturnType, ArgType >::CALL_CONTEXT::SetMainStack ( CONTEXT_T aStack)
inline

Definition at line 85 of file coroutine.h.

Referenced by COROUTINE< int, int >::callerStub(), and COROUTINE< int, int >::jumpOut().

86  {
87  m_mainStackContext = aStack;
88  }
CONTEXT_T * m_mainStackContext
Definition: coroutine.h:110

Member Data Documentation

template<typename ReturnType, typename ArgType>
CONTEXT_T* COROUTINE< ReturnType, ArgType >::CALL_CONTEXT::m_mainStackContext
private

Definition at line 110 of file coroutine.h.

template<typename ReturnType, typename ArgType>
std::function<void()> COROUTINE< ReturnType, ArgType >::CALL_CONTEXT::m_mainStackFunction
private

Definition at line 111 of file coroutine.h.


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