use objc2::{extern_class, extern_methods, msg_send, rc::Retained, runtime::NSObject};
use objc2_foundation::NSString;
use crate::{
MTLArrayType, MTLDataType, MTLPointerType, MTLStructType, MTLTensorReferenceType, MTLTextureReferenceType,
};
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLStructMember;
);
impl MTLStructMember {
extern_methods!(
#[unsafe(method(offset))]
#[unsafe(method_family = none)]
pub fn offset(&self) -> usize;
#[unsafe(method(dataType))]
#[unsafe(method_family = none)]
pub fn data_type(&self) -> MTLDataType;
#[unsafe(method(structType))]
#[unsafe(method_family = none)]
pub fn struct_type(&self) -> Option<Retained<MTLStructType>>;
#[unsafe(method(arrayType))]
#[unsafe(method_family = none)]
pub fn array_type(&self) -> Option<Retained<MTLArrayType>>;
#[unsafe(method(textureReferenceType))]
#[unsafe(method_family = none)]
pub fn texture_reference_type(&self) -> Option<Retained<MTLTextureReferenceType>>;
#[unsafe(method(pointerType))]
#[unsafe(method_family = none)]
pub fn pointer_type(&self) -> Option<Retained<MTLPointerType>>;
#[unsafe(method(tensorReferenceType))]
#[unsafe(method_family = none)]
pub fn tensor_reference_type(&self) -> Option<Retained<MTLTensorReferenceType>>;
#[unsafe(method(argumentIndex))]
#[unsafe(method_family = none)]
pub fn argument_index(&self) -> usize;
);
pub fn name(&self) -> String {
let ns: Retained<NSString> = unsafe { msg_send![self, name] };
ns.to_string()
}
}