use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
};
use objc2_foundation::{CopyingHelper, NSArray, NSCopying, NSObject, NSObjectProtocol};
use crate::{MTL4FunctionDescriptor, MTLFunctionStitchingGraph};
extern_class!(
#[unsafe(super(MTL4FunctionDescriptor, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTL4StitchedFunctionDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTL4StitchedFunctionDescriptor {}
);
unsafe impl CopyingHelper for MTL4StitchedFunctionDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTL4StitchedFunctionDescriptor {}
);
impl MTL4StitchedFunctionDescriptor {
extern_methods!(
#[unsafe(method(functionGraph))]
#[unsafe(method_family = none)]
pub fn function_graph(&self) -> Option<Retained<MTLFunctionStitchingGraph>>;
#[unsafe(method(setFunctionGraph:))]
#[unsafe(method_family = none)]
pub fn set_function_graph(
&self,
function_graph: Option<&MTLFunctionStitchingGraph>,
);
#[unsafe(method(functionDescriptors))]
#[unsafe(method_family = none)]
pub fn function_descriptors(&self) -> Option<Retained<NSArray<MTL4FunctionDescriptor>>>;
#[unsafe(method(setFunctionDescriptors:))]
#[unsafe(method_family = none)]
pub fn set_function_descriptors(
&self,
function_descriptors: Option<&NSArray<MTL4FunctionDescriptor>>,
);
);
}
impl MTL4StitchedFunctionDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}