2024-08-25 04:08:24 +00:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QRunnable>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QThread>
|
|
|
|
#include <QThreadPool>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qthreadpool.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qthreadpool.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QThreadPool* QThreadPool_new() {
|
|
|
|
return new QThreadPool();
|
|
|
|
}
|
|
|
|
|
|
|
|
QThreadPool* QThreadPool_new2(QObject* parent) {
|
|
|
|
return new QThreadPool(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QThreadPool_MetaObject(const QThreadPool* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QThreadPool_Metacast(QThreadPool* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QThreadPool* QThreadPool_GlobalInstance() {
|
|
|
|
return QThreadPool::globalInstance();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_Start(QThreadPool* self, QRunnable* runnable) {
|
|
|
|
self->start(runnable);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QThreadPool_TryStart(QThreadPool* self, QRunnable* runnable) {
|
|
|
|
return self->tryStart(runnable);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QThreadPool_ExpiryTimeout(const QThreadPool* self) {
|
|
|
|
return self->expiryTimeout();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_SetExpiryTimeout(QThreadPool* self, int expiryTimeout) {
|
|
|
|
self->setExpiryTimeout(static_cast<int>(expiryTimeout));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QThreadPool_MaxThreadCount(const QThreadPool* self) {
|
|
|
|
return self->maxThreadCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_SetMaxThreadCount(QThreadPool* self, int maxThreadCount) {
|
|
|
|
self->setMaxThreadCount(static_cast<int>(maxThreadCount));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QThreadPool_ActiveThreadCount(const QThreadPool* self) {
|
|
|
|
return self->activeThreadCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_SetStackSize(QThreadPool* self, unsigned int stackSize) {
|
|
|
|
self->setStackSize(static_cast<uint>(stackSize));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QThreadPool_StackSize(const QThreadPool* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
uint _ret = self->stackSize();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_ReserveThread(QThreadPool* self) {
|
|
|
|
self->reserveThread();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_ReleaseThread(QThreadPool* self) {
|
|
|
|
self->releaseThread();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QThreadPool_WaitForDone(QThreadPool* self) {
|
|
|
|
return self->waitForDone();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_Clear(QThreadPool* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QThreadPool_Contains(const QThreadPool* self, QThread* thread) {
|
|
|
|
return self->contains(thread);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_Cancel(QThreadPool* self, QRunnable* runnable) {
|
|
|
|
self->cancel(runnable);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QThreadPool_TryTake(QThreadPool* self, QRunnable* runnable) {
|
|
|
|
return self->tryTake(runnable);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QThreadPool_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QThreadPool::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_Start2(QThreadPool* self, QRunnable* runnable, int priority) {
|
|
|
|
self->start(runnable, static_cast<int>(priority));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QThreadPool_WaitForDone1(QThreadPool* self, int msecs) {
|
|
|
|
return self->waitForDone(static_cast<int>(msecs));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QThreadPool_Delete(QThreadPool* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|