package reflect2

import (
	
	
)

type UnsafeMapType struct {
	unsafeType
	pKeyRType  unsafe.Pointer
	pElemRType unsafe.Pointer
}

func newUnsafeMapType( *frozenConfig,  reflect.Type) MapType {
	return &UnsafeMapType{
		unsafeType: *newUnsafeType(, ),
		pKeyRType:  unpackEFace(reflect.PtrTo(.Key())).data,
		pElemRType: unpackEFace(reflect.PtrTo(.Elem())).data,
	}
}

func ( *UnsafeMapType) ( interface{}) bool {
	if  == nil {
		return true
	}
	 := unpackEFace()
	assertType("Type.IsNil argument 1", .ptrRType, .rtype)
	return .UnsafeIsNil(.data)
}

func ( *UnsafeMapType) ( unsafe.Pointer) bool {
	if  == nil {
		return true
	}
	return *(*unsafe.Pointer)() == nil
}

func ( *UnsafeMapType) () bool {
	return true
}

func ( *UnsafeMapType) ( interface{}) interface{} {
	 := unpackEFace()
	assertType("MapType.Indirect argument 1", .ptrRType, .rtype)
	return .UnsafeIndirect(.data)
}

func ( *UnsafeMapType) ( unsafe.Pointer) interface{} {
	return packEFace(.rtype, *(*unsafe.Pointer)())
}

func ( *UnsafeMapType) () Type {
	return .cfg.Type2(.Type.Key())
}

func ( *UnsafeMapType) ( int) interface{} {
	return packEFace(.ptrRType, .UnsafeMakeMap())
}

func ( *UnsafeMapType) ( int) unsafe.Pointer {
	 := makeMapWithSize(.rtype, )
	return unsafe.Pointer(&)
}

func ( *UnsafeMapType) ( interface{},  interface{},  interface{}) {
	 := unpackEFace()
	assertType("MapType.SetIndex argument 1", .ptrRType, .rtype)
	 := unpackEFace()
	assertType("MapType.SetIndex argument 2", .pKeyRType, .rtype)
	 := unpackEFace()
	assertType("MapType.SetIndex argument 3", .pElemRType, .rtype)
	.UnsafeSetIndex(.data, .data, .data)
}

func ( *UnsafeMapType) ( unsafe.Pointer,  unsafe.Pointer,  unsafe.Pointer) {
	mapassign(.rtype, *(*unsafe.Pointer)(), , )
}

func ( *UnsafeMapType) ( interface{},  interface{}) (interface{}, bool) {
	 := unpackEFace()
	assertType("MapType.TryGetIndex argument 1", .ptrRType, .rtype)
	 := unpackEFace()
	assertType("MapType.TryGetIndex argument 2", .pKeyRType, .rtype)
	 := .UnsafeGetIndex(.data, .data)
	if  == nil {
		return nil, false
	}
	return packEFace(.pElemRType, ), true
}

func ( *UnsafeMapType) ( interface{},  interface{}) interface{} {
	 := unpackEFace()
	assertType("MapType.GetIndex argument 1", .ptrRType, .rtype)
	 := unpackEFace()
	assertType("MapType.GetIndex argument 2", .pKeyRType, .rtype)
	 := .UnsafeGetIndex(.data, .data)
	return packEFace(.pElemRType, )
}

func ( *UnsafeMapType) ( unsafe.Pointer,  unsafe.Pointer) unsafe.Pointer {
	return mapaccess(.rtype, *(*unsafe.Pointer)(), )
}

func ( *UnsafeMapType) ( interface{}) MapIterator {
	 := unpackEFace()
	assertType("MapType.Iterate argument 1", .ptrRType, .rtype)
	return .UnsafeIterate(.data)
}

type UnsafeMapIterator struct {
	*hiter
	pKeyRType  unsafe.Pointer
	pElemRType unsafe.Pointer
}

func ( *UnsafeMapIterator) () bool {
	return .key != nil
}

func ( *UnsafeMapIterator) () (interface{}, interface{}) {
	,  := .UnsafeNext()
	return packEFace(.pKeyRType, ), packEFace(.pElemRType, )
}

func ( *UnsafeMapIterator) () (unsafe.Pointer, unsafe.Pointer) {
	 := .key
	 := .value
	mapiternext(.hiter)
	return , 
}