ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

coroutines.h File Reference

#include "common/scummsys.h"
#include "common/util.h"
#include "common/list.h"
#include "common/singleton.h"
Include dependency graph for coroutines.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Common::CoroBaseContext
 The core of any coroutine context which captures the 'state' of a coroutine. More...
class  Common::CoroContextHolder
 Wrapper class which holds a pointer to a pointer to a CoroBaseContext. More...
struct  Common::PROCESS
 process structure More...
struct  Common::EVENT
 Event structure. More...
class  Common::CoroutineScheduler
 Creates and manages "processes" (really coroutines). More...

Namespaces

namespace  Common
 

Internal interface to the QuickTime audio decoder.


Defines

#define CoroScheduler   (Common::CoroutineScheduler::instance())
#define CORO_PARAM   Common::CoroContext &coroParam
 Methods that have been converted to being a coroutine should have this as the first parameter.
#define CORO_BEGIN_CONTEXT
 Begin the declaration of a coroutine context.
#define CORO_END_CONTEXT(x)   } *x = (CoroContextTag *)coroParam
 End the declaration of a coroutine context.
#define CORO_BEGIN_CODE(x)
 Begin the code section of a coroutine.
#define CORO_END_CODE
 End the code section of a coroutine.
#define CORO_SLEEP(delay)
 Sleep for the specified number of scheduler cycles.
#define CORO_GIVE_WAY   do { CoroScheduler.giveWay(); CORO_SLEEP(1); } while (0)
#define CORO_RESCHEDULE   do { CoroScheduler.reschedule(); CORO_SLEEP(1); } while (0)
#define CORO_KILL_SELF()   do { if (&coroParam != &Common::nullContext) { coroParam->_sleep = -1; } return; } while (0)
 Stop the currently running coroutine and all calling coroutines.
#define CORO_SUBCTX   coroParam->_subctx
 This macro is to be used in conjunction with CORO_INVOKE_ARGS and similar macros for calling coroutines-enabled subroutines.
#define CORO_INVOKE_ARGS(subCoro, ARGS)
 Invoke another coroutine.
#define CORO_INVOKE_ARGS_V(subCoro, RESULT, ARGS)
 Invoke another coroutine.
#define CORO_INVOKE_0(subCoroutine)   CORO_INVOKE_ARGS(subCoroutine, (CORO_SUBCTX))
 Convenience wrapper for CORO_INVOKE_ARGS for invoking a coroutine with no parameters.
#define CORO_INVOKE_1(subCoroutine, a0)   CORO_INVOKE_ARGS(subCoroutine, (CORO_SUBCTX, a0))
 Convenience wrapper for CORO_INVOKE_ARGS for invoking a coroutine with one parameter.
#define CORO_INVOKE_2(subCoroutine, a0, a1)   CORO_INVOKE_ARGS(subCoroutine, (CORO_SUBCTX, a0, a1))
 Convenience wrapper for CORO_INVOKE_ARGS for invoking a coroutine with two parameters.
#define CORO_INVOKE_3(subCoroutine, a0, a1, a2)   CORO_INVOKE_ARGS(subCoroutine, (CORO_SUBCTX, a0, a1, a2))
 Convenience wrapper for CORO_INVOKE_ARGS for invoking a coroutine with three parameters.
#define CORO_INVOKE_4(subCoroutine, a0, a1, a2, a3)   CORO_INVOKE_ARGS(subCoroutine, (CORO_SUBCTX, a0, a1, a2, a3))
 Convenience wrapper for CORO_INVOKE_ARGS for invoking a coroutine with four parameters.
#define CORO_PARAM_SIZE   32
#define CORO_NUM_PROCESS   100
#define CORO_MAX_PROCESSES   100
#define CORO_MAX_PID_WAITING   5
#define CORO_INFINITE   0xffffffff
#define CORO_INVALID_PID_VALUE   0

Typedefs

typedef CoroBaseContext * Common::CoroContext
typedef void(* Common::CORO_ADDR )(CoroContext &, const void *)
 Coroutine parameter for methods converted to coroutines.
typedef PROCESS * Common::PPROCESS


Generated on Sat Mar 23 2019 05:02:54 for ResidualVM by doxygen 1.7.1
curved edge   curved edge