Extern support for creating iterators
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2019-08-15 16:58:16 +02:00
parent 0d30d788e9
commit 7523fb4294
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
3 changed files with 19 additions and 1 deletions

View File

@ -1 +1,11 @@
#include "UserDataCollectionIterator.hpp"
namespace Porygon::UserData{
extern "C"{
UserDataCollectionIterator* CreateCollectionIterator(const Evaluation::EvalValue* (*getCurrent)(),
const Evaluation::EvalValue* (*moveNext)(),
const Evaluation::EvalValue* (*reset)()){
return new UserDataCollectionIterator(getCurrent, moveNext, reset);
}
}
}

View File

@ -21,7 +21,7 @@ namespace Porygon::UserData{
return _getCurrent();
}
bool MoveNext() final{
_moveNext();
return _moveNext();
}
void Reset() final{
_reset();

View File

@ -1 +1,9 @@
#include "UserDataCollectionRangeIterator.hpp"
namespace Porygon::UserData{
extern "C"{
UserDataCollectionRangeIterator* CreateCollectionRangeIterator(size_t start, size_t end){
return new UserDataCollectionRangeIterator(start, end);
}
}
}