2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qwaitcondition.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QWaitCondition struct {
|
|
|
|
h *C.QWaitCondition
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) cPointer() *C.QWaitCondition {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QWaitCondition) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQWaitCondition(h *C.QWaitCondition) *QWaitCondition {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QWaitCondition{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQWaitCondition(h unsafe.Pointer) *QWaitCondition {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQWaitCondition((*C.QWaitCondition)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQWaitCondition constructs a new QWaitCondition object.
|
|
|
|
func NewQWaitCondition() *QWaitCondition {
|
|
|
|
ret := C.QWaitCondition_new()
|
|
|
|
return newQWaitCondition(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) Wait(lockedMutex *QMutex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_Wait(this.h, lockedMutex.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) Wait2(lockedMutex *QMutex, time uint64) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_Wait2(this.h, lockedMutex.cPointer(), (C.ulong)(time)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) WaitWithLockedReadWriteLock(lockedReadWriteLock *QReadWriteLock) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_WaitWithLockedReadWriteLock(this.h, lockedReadWriteLock.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) Wait3(lockedReadWriteLock *QReadWriteLock, time uint64) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_Wait3(this.h, lockedReadWriteLock.cPointer(), (C.ulong)(time)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) WakeOne() {
|
|
|
|
C.QWaitCondition_WakeOne(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) WakeAll() {
|
|
|
|
C.QWaitCondition_WakeAll(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) NotifyOne() {
|
|
|
|
C.QWaitCondition_NotifyOne(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) NotifyAll() {
|
|
|
|
C.QWaitCondition_NotifyAll(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) Wait22(lockedMutex *QMutex, deadline QDeadlineTimer) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_Wait22(this.h, lockedMutex.cPointer(), deadline.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWaitCondition) Wait23(lockedReadWriteLock *QReadWriteLock, deadline QDeadlineTimer) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWaitCondition_Wait23(this.h, lockedReadWriteLock.cPointer(), deadline.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QWaitCondition) Delete() {
|
|
|
|
C.QWaitCondition_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QWaitCondition) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QWaitCondition) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|