yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Tolmachev DmitriiMetal support in VkFFTba7001c

develop
3.1 KiB78 linesraw
1//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2//
3// Foundation/NSEnumerator.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//-------------------------------------------------------------------------------------------------------------------------------------------------------------
24
25#include "NSObject.hpp"
26#include "NSTypes.hpp"
27
28//-------------------------------------------------------------------------------------------------------------------------------------------------------------
29
30namespace NS
31{
32struct FastEnumerationState
33{
34    unsigned long  state;
35    Object**       itemsPtr;
36    unsigned long* mutationsPtr;
37    unsigned long  extra[5];
38} _NS_PACKED;
39
40class FastEnumeration : public Referencing<FastEnumeration>
41{
42public:
43    NS::UInteger countByEnumerating(FastEnumerationState* pState, Object** pBuffer, NS::UInteger len);
44};
45
46template <class _ObjectType>
47class Enumerator : public Referencing<Enumerator<_ObjectType>, FastEnumeration>
48{
49public:
50    _ObjectType* nextObject();
51    class Array* allObjects();
52};
53}
54
55//-------------------------------------------------------------------------------------------------------------------------------------------------------------
56
57_NS_INLINE NS::UInteger NS::FastEnumeration::countByEnumerating(FastEnumerationState* pState, Object** pBuffer, NS::UInteger len)
58{
59    return Object::sendMessage<UInteger>(this, _NS_PRIVATE_SEL(countByEnumeratingWithState_objects_count_), pState, pBuffer, len);
60}
61
62//-------------------------------------------------------------------------------------------------------------------------------------------------------------
63
64template <class _ObjectType>
65_NS_INLINE _ObjectType* NS::Enumerator<_ObjectType>::nextObject()
66{
67    return Object::sendMessage<_ObjectType*>(this, _NS_PRIVATE_SEL(nextObject));
68}
69
70//-------------------------------------------------------------------------------------------------------------------------------------------------------------
71
72template <class _ObjectType>
73_NS_INLINE NS::Array* NS::Enumerator<_ObjectType>::allObjects()
74{
75    return Object::sendMessage<Array*>(this, _NS_PRIVATE_SEL(allObjects));
76}
77
78//-------------------------------------------------------------------------------------------------------------------------------------------------------------