polserver/pol-core/bscript/continueimp.h
turleypol 21577d8e5b
Clang Tidy concat namespaces (#855)
* tidy

* Automated clang-tidy change: modernize-concat-nested-namespaces

* compile test

* fix namespace

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>
2026-01-17 10:30:21 +01:00

42 lines
915 B
C++

#pragma once
#include "bobject.h"
#include "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