2024-11-04 09:53:04 +00:00
|
|
|
package network
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qnetworkinterface.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mappu/miqt/qt6"
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QNetworkAddressEntry__DnsEligibilityStatus int8
|
|
|
|
|
|
|
|
const (
|
|
|
|
QNetworkAddressEntry__DnsEligibilityUnknown QNetworkAddressEntry__DnsEligibilityStatus = -1
|
|
|
|
QNetworkAddressEntry__DnsIneligible QNetworkAddressEntry__DnsEligibilityStatus = 0
|
|
|
|
QNetworkAddressEntry__DnsEligible QNetworkAddressEntry__DnsEligibilityStatus = 1
|
|
|
|
)
|
|
|
|
|
|
|
|
type QNetworkInterface__InterfaceFlag int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QNetworkInterface__IsUp QNetworkInterface__InterfaceFlag = 1
|
|
|
|
QNetworkInterface__IsRunning QNetworkInterface__InterfaceFlag = 2
|
|
|
|
QNetworkInterface__CanBroadcast QNetworkInterface__InterfaceFlag = 4
|
|
|
|
QNetworkInterface__IsLoopBack QNetworkInterface__InterfaceFlag = 8
|
|
|
|
QNetworkInterface__IsPointToPoint QNetworkInterface__InterfaceFlag = 16
|
|
|
|
QNetworkInterface__CanMulticast QNetworkInterface__InterfaceFlag = 32
|
|
|
|
)
|
|
|
|
|
|
|
|
type QNetworkInterface__InterfaceType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QNetworkInterface__Loopback QNetworkInterface__InterfaceType = 1
|
|
|
|
QNetworkInterface__Virtual QNetworkInterface__InterfaceType = 2
|
|
|
|
QNetworkInterface__Ethernet QNetworkInterface__InterfaceType = 3
|
|
|
|
QNetworkInterface__Slip QNetworkInterface__InterfaceType = 4
|
|
|
|
QNetworkInterface__CanBus QNetworkInterface__InterfaceType = 5
|
|
|
|
QNetworkInterface__Ppp QNetworkInterface__InterfaceType = 6
|
|
|
|
QNetworkInterface__Fddi QNetworkInterface__InterfaceType = 7
|
|
|
|
QNetworkInterface__Wifi QNetworkInterface__InterfaceType = 8
|
|
|
|
QNetworkInterface__Ieee80211 QNetworkInterface__InterfaceType = 8
|
|
|
|
QNetworkInterface__Phonet QNetworkInterface__InterfaceType = 9
|
|
|
|
QNetworkInterface__Ieee802154 QNetworkInterface__InterfaceType = 10
|
|
|
|
QNetworkInterface__SixLoWPAN QNetworkInterface__InterfaceType = 11
|
|
|
|
QNetworkInterface__Ieee80216 QNetworkInterface__InterfaceType = 12
|
|
|
|
QNetworkInterface__Ieee1394 QNetworkInterface__InterfaceType = 13
|
|
|
|
QNetworkInterface__Unknown QNetworkInterface__InterfaceType = 0
|
|
|
|
)
|
|
|
|
|
|
|
|
type QNetworkAddressEntry struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QNetworkAddressEntry
|
|
|
|
isSubclass bool
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) cPointer() *C.QNetworkAddressEntry {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQNetworkAddressEntry constructs the type using only CGO pointers.
|
2024-11-04 09:53:04 +00:00
|
|
|
func newQNetworkAddressEntry(h *C.QNetworkAddressEntry) *QNetworkAddressEntry {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-11-04 09:53:04 +00:00
|
|
|
return &QNetworkAddressEntry{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQNetworkAddressEntry constructs the type using only unsafe pointers.
|
2024-11-04 09:53:04 +00:00
|
|
|
func UnsafeNewQNetworkAddressEntry(h unsafe.Pointer) *QNetworkAddressEntry {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQNetworkAddressEntry((*C.QNetworkAddressEntry)(h))
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQNetworkAddressEntry constructs a new QNetworkAddressEntry object.
|
|
|
|
func NewQNetworkAddressEntry() *QNetworkAddressEntry {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQNetworkAddressEntry(C.QNetworkAddressEntry_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQNetworkAddressEntry2 constructs a new QNetworkAddressEntry object.
|
|
|
|
func NewQNetworkAddressEntry2(other *QNetworkAddressEntry) *QNetworkAddressEntry {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQNetworkAddressEntry(C.QNetworkAddressEntry_new2(other.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) OperatorAssign(other *QNetworkAddressEntry) {
|
|
|
|
C.QNetworkAddressEntry_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) Swap(other *QNetworkAddressEntry) {
|
|
|
|
C.QNetworkAddressEntry_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) OperatorEqual(other *QNetworkAddressEntry) bool {
|
|
|
|
return (bool)(C.QNetworkAddressEntry_OperatorEqual(this.h, other.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) OperatorNotEqual(other *QNetworkAddressEntry) bool {
|
|
|
|
return (bool)(C.QNetworkAddressEntry_OperatorNotEqual(this.h, other.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) DnsEligibility() QNetworkAddressEntry__DnsEligibilityStatus {
|
|
|
|
return (QNetworkAddressEntry__DnsEligibilityStatus)(C.QNetworkAddressEntry_DnsEligibility(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetDnsEligibility(status QNetworkAddressEntry__DnsEligibilityStatus) {
|
|
|
|
C.QNetworkAddressEntry_SetDnsEligibility(this.h, (C.int8_t)(status))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) Ip() *QHostAddress {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQHostAddress(C.QNetworkAddressEntry_Ip(this.h))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetIp(newIp *QHostAddress) {
|
|
|
|
C.QNetworkAddressEntry_SetIp(this.h, newIp.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) Netmask() *QHostAddress {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQHostAddress(C.QNetworkAddressEntry_Netmask(this.h))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetNetmask(newNetmask *QHostAddress) {
|
|
|
|
C.QNetworkAddressEntry_SetNetmask(this.h, newNetmask.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) PrefixLength() int {
|
|
|
|
return (int)(C.QNetworkAddressEntry_PrefixLength(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetPrefixLength(length int) {
|
|
|
|
C.QNetworkAddressEntry_SetPrefixLength(this.h, (C.int)(length))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) Broadcast() *QHostAddress {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQHostAddress(C.QNetworkAddressEntry_Broadcast(this.h))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetBroadcast(newBroadcast *QHostAddress) {
|
|
|
|
C.QNetworkAddressEntry_SetBroadcast(this.h, newBroadcast.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) IsLifetimeKnown() bool {
|
|
|
|
return (bool)(C.QNetworkAddressEntry_IsLifetimeKnown(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) PreferredLifetime() *qt6.QDeadlineTimer {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := qt6.UnsafeNewQDeadlineTimer(unsafe.Pointer(C.QNetworkAddressEntry_PreferredLifetime(this.h)))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) ValidityLifetime() *qt6.QDeadlineTimer {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := qt6.UnsafeNewQDeadlineTimer(unsafe.Pointer(C.QNetworkAddressEntry_ValidityLifetime(this.h)))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) SetAddressLifetime(preferred qt6.QDeadlineTimer, validity qt6.QDeadlineTimer) {
|
|
|
|
C.QNetworkAddressEntry_SetAddressLifetime(this.h, (*C.QDeadlineTimer)(preferred.UnsafePointer()), (*C.QDeadlineTimer)(validity.UnsafePointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) ClearAddressLifetime() {
|
|
|
|
C.QNetworkAddressEntry_ClearAddressLifetime(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) IsPermanent() bool {
|
|
|
|
return (bool)(C.QNetworkAddressEntry_IsPermanent(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkAddressEntry) IsTemporary() bool {
|
|
|
|
return (bool)(C.QNetworkAddressEntry_IsTemporary(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QNetworkAddressEntry) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QNetworkAddressEntry_Delete(this.h, C.bool(this.isSubclass))
|
2024-11-04 09:53:04 +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 *QNetworkAddressEntry) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QNetworkAddressEntry) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type QNetworkInterface struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QNetworkInterface
|
|
|
|
isSubclass bool
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) cPointer() *C.QNetworkInterface {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQNetworkInterface constructs the type using only CGO pointers.
|
2024-11-04 09:53:04 +00:00
|
|
|
func newQNetworkInterface(h *C.QNetworkInterface) *QNetworkInterface {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-11-04 09:53:04 +00:00
|
|
|
return &QNetworkInterface{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQNetworkInterface constructs the type using only unsafe pointers.
|
2024-11-04 09:53:04 +00:00
|
|
|
func UnsafeNewQNetworkInterface(h unsafe.Pointer) *QNetworkInterface {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQNetworkInterface((*C.QNetworkInterface)(h))
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQNetworkInterface constructs a new QNetworkInterface object.
|
|
|
|
func NewQNetworkInterface() *QNetworkInterface {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQNetworkInterface(C.QNetworkInterface_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQNetworkInterface2 constructs a new QNetworkInterface object.
|
|
|
|
func NewQNetworkInterface2(other *QNetworkInterface) *QNetworkInterface {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQNetworkInterface(C.QNetworkInterface_new2(other.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-11-04 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) OperatorAssign(other *QNetworkInterface) {
|
|
|
|
C.QNetworkInterface_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) Swap(other *QNetworkInterface) {
|
|
|
|
C.QNetworkInterface_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) IsValid() bool {
|
|
|
|
return (bool)(C.QNetworkInterface_IsValid(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) Index() int {
|
|
|
|
return (int)(C.QNetworkInterface_Index(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) MaximumTransmissionUnit() int {
|
|
|
|
return (int)(C.QNetworkInterface_MaximumTransmissionUnit(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) Name() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QNetworkInterface_Name(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) HumanReadableName() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QNetworkInterface_HumanReadableName(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) Flags() QNetworkInterface__InterfaceFlag {
|
|
|
|
return (QNetworkInterface__InterfaceFlag)(C.QNetworkInterface_Flags(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) Type() QNetworkInterface__InterfaceType {
|
|
|
|
return (QNetworkInterface__InterfaceType)(C.QNetworkInterface_Type(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) HardwareAddress() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QNetworkInterface_HardwareAddress(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QNetworkInterface) AddressEntries() []QNetworkAddressEntry {
|
|
|
|
var _ma C.struct_miqt_array = C.QNetworkInterface_AddressEntries(this.h)
|
|
|
|
_ret := make([]QNetworkAddressEntry, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QNetworkAddressEntry)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_goptr := newQNetworkAddressEntry(_outCast[i])
|
2024-11-04 09:53:04 +00:00
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_InterfaceIndexFromName(name string) int {
|
|
|
|
name_ms := C.struct_miqt_string{}
|
|
|
|
name_ms.data = C.CString(name)
|
|
|
|
name_ms.len = C.size_t(len(name))
|
|
|
|
defer C.free(unsafe.Pointer(name_ms.data))
|
|
|
|
return (int)(C.QNetworkInterface_InterfaceIndexFromName(name_ms))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_InterfaceFromName(name string) *QNetworkInterface {
|
|
|
|
name_ms := C.struct_miqt_string{}
|
|
|
|
name_ms.data = C.CString(name)
|
|
|
|
name_ms.len = C.size_t(len(name))
|
|
|
|
defer C.free(unsafe.Pointer(name_ms.data))
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQNetworkInterface(C.QNetworkInterface_InterfaceFromName(name_ms))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_InterfaceFromIndex(index int) *QNetworkInterface {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQNetworkInterface(C.QNetworkInterface_InterfaceFromIndex((C.int)(index)))
|
2024-11-04 09:53:04 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_InterfaceNameFromIndex(index int) string {
|
|
|
|
var _ms C.struct_miqt_string = C.QNetworkInterface_InterfaceNameFromIndex((C.int)(index))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_AllInterfaces() []QNetworkInterface {
|
|
|
|
var _ma C.struct_miqt_array = C.QNetworkInterface_AllInterfaces()
|
|
|
|
_ret := make([]QNetworkInterface, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QNetworkInterface)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_goptr := newQNetworkInterface(_outCast[i])
|
2024-11-04 09:53:04 +00:00
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QNetworkInterface_AllAddresses() []QHostAddress {
|
|
|
|
var _ma C.struct_miqt_array = C.QNetworkInterface_AllAddresses()
|
|
|
|
_ret := make([]QHostAddress, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QHostAddress)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_lv_goptr := newQHostAddress(_outCast[i])
|
2024-11-04 09:53:04 +00:00
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QNetworkInterface) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QNetworkInterface_Delete(this.h, C.bool(this.isSubclass))
|
2024-11-04 09:53:04 +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 *QNetworkInterface) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QNetworkInterface) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|