Skip to content

API ​

cpp
#include <VAmiga.h>
cpp
class API

Defined in VAmiga.h:83

Base class of all APIs.

Public Methods ​

ReturnNameDescription
API inlineCreates an API object that operates on the given emulator.
voidsuspend constSuspends the emulator thread.
voidresume constResumes the emulator thread after a call to suspend().

API ​

inline

cpp
inline API(Emulator * emu)

Defined in VAmiga.h:97

Creates an API object that operates on the given emulator.


suspend ​

const

cpp
void suspend() const

Defined in VAmiga.h:114

Suspends the emulator thread.

Blocks until the emulator thread has stopped at a safe point, i.e., it is neither computing a frame nor processing its command queue. The call can be nested: the thread continues once resume() has been called as often as suspend(). Use it to read or modify the state of a component that is not protected by the API itself.

Only one thread can hold a suspension at a time. Another thread that calls suspend(), or a blocking API function that waits for the emulator thread, waits until the holder has resumed the emulator. The holder itself must not call such a function, because it would wait for itself: they throw a CoreError, and so does halt(). Do not call suspend() from the emulator thread.


resume ​

const

cpp
void resume() const

Defined in VAmiga.h:118

Resumes the emulator thread after a call to suspend().

Protected Attributes ​

ReturnNameDescription
class Emulator *emuPointer to the emulator instance this API object operates on.

emu ​

cpp
class Emulator * emu = nullptr

Defined in VAmiga.h:91

Pointer to the emulator instance this API object operates on.