2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qelapsedtimer.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"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QElapsedTimer__ClockType int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QElapsedTimer__SystemTime QElapsedTimer__ClockType = 0
|
|
|
|
QElapsedTimer__MonotonicClock QElapsedTimer__ClockType = 1
|
|
|
|
QElapsedTimer__TickCounter QElapsedTimer__ClockType = 2
|
|
|
|
QElapsedTimer__MachAbsoluteTime QElapsedTimer__ClockType = 3
|
|
|
|
QElapsedTimer__PerformanceCounter QElapsedTimer__ClockType = 4
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QElapsedTimer struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QElapsedTimer
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) cPointer() *C.QElapsedTimer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QElapsedTimer) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQElapsedTimer constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQElapsedTimer(h *C.QElapsedTimer) *QElapsedTimer {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QElapsedTimer{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQElapsedTimer constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQElapsedTimer(h unsafe.Pointer) *QElapsedTimer {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQElapsedTimer((*C.QElapsedTimer)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQElapsedTimer constructs a new QElapsedTimer object.
|
|
|
|
func NewQElapsedTimer() *QElapsedTimer {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQElapsedTimer(C.QElapsedTimer_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QElapsedTimer_ClockType() QElapsedTimer__ClockType {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QElapsedTimer__ClockType)(C.QElapsedTimer_ClockType())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QElapsedTimer_IsMonotonic() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QElapsedTimer_IsMonotonic())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) Start() {
|
|
|
|
C.QElapsedTimer_Start(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) Restart() int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_Restart(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) Invalidate() {
|
|
|
|
C.QElapsedTimer_Invalidate(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QElapsedTimer_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) NsecsElapsed() int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_NsecsElapsed(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) Elapsed() int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_Elapsed(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) HasExpired(timeout int64) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QElapsedTimer_HasExpired(this.h, (C.longlong)(timeout)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) MsecsSinceReference() int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_MsecsSinceReference(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) MsecsTo(other *QElapsedTimer) int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_MsecsTo(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) SecsTo(other *QElapsedTimer) int64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int64)(C.QElapsedTimer_SecsTo(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) OperatorEqual(other *QElapsedTimer) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QElapsedTimer_OperatorEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QElapsedTimer) OperatorNotEqual(other *QElapsedTimer) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QElapsedTimer_OperatorNotEqual(this.h, other.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 *QElapsedTimer) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QElapsedTimer_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
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 *QElapsedTimer) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QElapsedTimer) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|