yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
master
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Metal/MTLEvent.hpp 4// 5// Copyright 2020-2021 Apple Inc. 6// 7// Licensed under the Apache License, Version 2.0 (the "License"); 8// you may not use this file except in compliance with the License. 9// You may obtain a copy of the License at 10// 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// See the License for the specific language governing permissions and 17// limitations under the License. 18// 19//------------------------------------------------------------------------------------------------------------------------------------------------------------- 20 21#pragma once 22 23#include "MTLDefines.hpp" 24#include "MTLHeaderBridge.hpp" 25#include "MTLPrivate.hpp" 26 27#include <Foundation/Foundation.hpp> 28 29#include "MTLEvent.hpp" 30 31namespace MTL 32{ 33class Event :public NS ::Referencing < Event > 34{ 35public : 36class Device * device ()const ; 37 38NS ::String * label ()const ; 39void setLabel (const NS ::String * label ); 40}; 41 42class SharedEventListener :public NS ::Referencing < SharedEventListener > 43{ 44public : 45static class SharedEventListener * alloc (); 46 47MTL ::SharedEventListener * init (); 48 49MTL ::SharedEventListener * init (const dispatch_queue_t dispatchQueue ); 50 51dispatch_queue_t dispatchQueue ()const ; 52}; 53 54using SharedEventNotificationBlock = void (^)(SharedEvent * pEvent , std::uint64_t value ); 55 56class SharedEvent :public NS ::Referencing < SharedEvent ,Event > 57{ 58public : 59void notifyListener (const class SharedEventListener * listener ,uint64_t value ,const MTL ::SharedEventNotificationBlock block ); 60 61class SharedEventHandle * newSharedEventHandle (); 62 63uint64_t signaledValue ()const ; 64void setSignaledValue (uint64_t signaledValue ); 65}; 66 67class SharedEventHandle :public NS ::Referencing < SharedEventHandle > 68{ 69public : 70static class SharedEventHandle * alloc (); 71 72class SharedEventHandle * init (); 73 74NS ::String * label ()const ; 75}; 76 77struct SharedEventHandlePrivate 78{ 79}_MTL_PACKED ; 80 81} 82 83// property: device 84_MTL_INLINE MTL ::Device * MTL ::Event ::device ()const 85{ 86return Object ::sendMessage < MTL ::Device *> (this ,_MTL_PRIVATE_SEL (device )); 87} 88 89// property: label 90_MTL_INLINE NS ::String * MTL ::Event ::label ()const 91{ 92return Object ::sendMessage < NS ::String *> (this ,_MTL_PRIVATE_SEL (label )); 93} 94 95_MTL_INLINE voidMTL ::Event ::setLabel (const NS ::String * label ) 96{ 97Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setLabel_ ),label ); 98} 99 100// static method: alloc 101_MTL_INLINE MTL ::SharedEventListener * MTL ::SharedEventListener ::alloc () 102{ 103return NS ::Object ::alloc < MTL ::SharedEventListener > (_MTL_PRIVATE_CLS (MTLSharedEventListener )); 104} 105 106// method: init 107_MTL_INLINE MTL ::SharedEventListener * MTL ::SharedEventListener ::init () 108{ 109return NS ::Object ::init < MTL ::SharedEventListener > (); 110} 111 112// method: initWithDispatchQueue: 113_MTL_INLINE MTL ::SharedEventListener * MTL ::SharedEventListener ::init (const dispatch_queue_t dispatchQueue ) 114{ 115return Object ::sendMessage < MTL ::SharedEventListener *> (this ,_MTL_PRIVATE_SEL (initWithDispatchQueue_ ),dispatchQueue ); 116} 117 118// property: dispatchQueue 119_MTL_INLINE dispatch_queue_tMTL ::SharedEventListener ::dispatchQueue ()const 120{ 121return Object ::sendMessage < dispatch_queue_t > (this ,_MTL_PRIVATE_SEL (dispatchQueue )); 122} 123 124// method: notifyListener:atValue:block: 125_MTL_INLINE voidMTL ::SharedEvent ::notifyListener (const MTL ::SharedEventListener * listener ,uint64_t value ,const MTL ::SharedEventNotificationBlock block ) 126{ 127Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (notifyListener_atValue_block_ ),listener ,value ,block ); 128} 129 130// method: newSharedEventHandle 131_MTL_INLINE MTL ::SharedEventHandle * MTL ::SharedEvent ::newSharedEventHandle () 132{ 133return Object ::sendMessage < MTL ::SharedEventHandle *> (this ,_MTL_PRIVATE_SEL (newSharedEventHandle )); 134} 135 136// property: signaledValue 137_MTL_INLINE uint64_tMTL ::SharedEvent ::signaledValue ()const 138{ 139return Object ::sendMessage < uint64_t > (this ,_MTL_PRIVATE_SEL (signaledValue )); 140} 141 142_MTL_INLINE voidMTL ::SharedEvent ::setSignaledValue (uint64_t signaledValue ) 143{ 144Object ::sendMessage < void > (this ,_MTL_PRIVATE_SEL (setSignaledValue_ ),signaledValue ); 145} 146 147// static method: alloc 148_MTL_INLINE MTL ::SharedEventHandle * MTL ::SharedEventHandle ::alloc () 149{ 150return NS ::Object ::alloc < MTL ::SharedEventHandle > (_MTL_PRIVATE_CLS (MTLSharedEventHandle )); 151} 152 153// method: init 154_MTL_INLINE MTL ::SharedEventHandle * MTL ::SharedEventHandle ::init () 155{ 156return NS ::Object ::init < MTL ::SharedEventHandle > (); 157} 158 159// property: label 160_MTL_INLINE NS ::String * MTL ::SharedEventHandle ::label ()const 161{ 162return Object ::sendMessage < NS ::String *> (this ,_MTL_PRIVATE_SEL (label )); 163}