objc2_gameplay_kit/generated/
GKRTree.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct GKRTreeSplitStrategy(pub NSInteger);
16impl GKRTreeSplitStrategy {
17 #[doc(alias = "GKRTreeSplitStrategyHalve")]
18 pub const Halve: Self = Self(0);
19 #[doc(alias = "GKRTreeSplitStrategyLinear")]
20 pub const Linear: Self = Self(1);
21 #[doc(alias = "GKRTreeSplitStrategyQuadratic")]
22 pub const Quadratic: Self = Self(2);
23 #[doc(alias = "GKRTreeSplitStrategyReduceOverlap")]
24 pub const ReduceOverlap: Self = Self(3);
25}
26
27unsafe impl Encode for GKRTreeSplitStrategy {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for GKRTreeSplitStrategy {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36 #[unsafe(super(NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 pub struct GKRTree<ElementType: ?Sized = AnyObject>;
44);
45
46impl<ElementType: ?Sized + Message + AsRef<NSObject>> GKRTree<ElementType> {
47 #[inline]
53 pub unsafe fn cast_unchecked<NewElementType: ?Sized + Message + AsRef<NSObject>>(
54 &self,
55 ) -> &GKRTree<NewElementType> {
56 unsafe { &*((self as *const Self).cast()) }
57 }
58}
59
60extern_conformance!(
61 unsafe impl<ElementType: ?Sized + AsRef<NSObject>> NSObjectProtocol for GKRTree<ElementType> {}
62);
63
64impl<ElementType: Message + AsRef<NSObject>> GKRTree<ElementType> {
65 extern_methods!(
66 #[unsafe(method(queryReserve))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn queryReserve(&self) -> NSUInteger;
71
72 #[unsafe(method(setQueryReserve:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setQueryReserve(&self, query_reserve: NSUInteger);
76
77 #[unsafe(method(treeWithMaxNumberOfChildren:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn treeWithMaxNumberOfChildren(
84 max_number_of_children: NSUInteger,
85 ) -> Retained<Self>;
86
87 #[unsafe(method(initWithMaxNumberOfChildren:))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn initWithMaxNumberOfChildren(
90 this: Allocated<Self>,
91 max_number_of_children: NSUInteger,
92 ) -> Retained<Self>;
93 );
94}
95
96impl<ElementType: Message + AsRef<NSObject>> GKRTree<ElementType> {
98 extern_methods!(
99 #[unsafe(method(init))]
100 #[unsafe(method_family = init)]
101 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103 #[unsafe(method(new))]
104 #[unsafe(method_family = new)]
105 pub unsafe fn new() -> Retained<Self>;
106 );
107}