polserver/pol-core/bscript/bcontinuation.h
turleypol 1463b76c7c
Includes are now all relative to pol-core basefolder (#906)
* all except pol

* pol and includes under defines

* something weird has happened

* remove own folder from include searchpath

* fixed remaining, adapted include style for external headers

* missing include
2026-07-25 23:01:18 +02:00

43 lines
963 B
C++

#pragma once
#include "bscript/bobject.h"
#include "bscript/bobjectimp.h"
#include "bscript/exectype.h"
namespace Pol::Bscript
{
class Executor;
class BContinuation;
class BFunctionRef;
struct ContinuationCallbackWrapper
{
BObjectImp* ( *call )( Executor&, BContinuation*, void* /*wrapper data*/, BObjectRef /*result*/ );
void ( *free )( void* );
size_t ( *size )();
};
class BContinuation : public BObjectImp
{
public:
BContinuation( BObjectRef funcref, BObjectRefVec args, ContinuationCallbackWrapper wrapper,
void* wrapperData );
~BContinuation() override;
BObjectImp* continueWith( Executor& exec, BObjectRef result );
BFunctionRef* func();
BObjectImp* copy() const override;
size_t sizeEstimate() const override;
std::string getStringRep() const override;
private:
BObjectRef funcref_;
ContinuationCallbackWrapper wrapper_;
void* wrapperData_;
public:
BObjectRefVec args;
};
} // namespace Pol::Bscript