polserver/pol-core/bscript/bcontinuation.cpp
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

47 lines
1 KiB
C++

#include "bscript/bcontinuation.h"
#include "bscript/bfuncref.h"
#include "bscript/executor.h"
namespace Pol::Bscript
{
BContinuation::BContinuation( BObjectRef funcref, BObjectRefVec args,
ContinuationCallbackWrapper wrapper, void* wrapperData )
: BObjectImp( BObjectImp::OTContinuation ),
funcref_( std::move( funcref ) ),
wrapper_( wrapper ),
wrapperData_( wrapperData ),
args( std::move( args ) )
{
}
BContinuation::~BContinuation()
{
wrapper_.free( wrapperData_ );
}
BObjectImp* BContinuation::continueWith( Executor& exec, BObjectRef result )
{
return wrapper_.call( exec, this, wrapperData_, std::move( result ) );
}
BFunctionRef* BContinuation::func()
{
return funcref_->impptr<BFunctionRef>();
}
BObjectImp* BContinuation::copy() const
{
return nullptr;
}
size_t BContinuation::sizeEstimate() const
{
return sizeof( BContinuation ) + wrapper_.size();
}
std::string BContinuation::getStringRep() const
{
return "<continuation>";
}
} // namespace Pol::Bscript