yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
develop
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Foundation/NSArray.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{ 32class Array : public Copying < Array > 33{ 34public : 35static Array * array () ; 36static Array * array ( const Object * pObject ) ; 37static Array * array ( const Object * const * pObjects , UInteger count ) ; 38 39static Array * alloc () ; 40 41Array * init () ; 42Array * init ( const Object * const * pObjects , UInteger count ) ; 43Array * init ( const class Coder * pCoder ) ; 44 45template < class _Object = Object > 46_Object * object ( UInteger index ) const ; 47UInteger count () const ; 48} ; 49} 50 51//------------------------------------------------------------------------------------------------------------------------------------------------------------- 52 53_NS_INLINE NS :: Array * NS :: Array :: array () 54{ 55return Object :: sendMessage < Array *> ( _NS_PRIVATE_CLS ( NSArray ) , _NS_PRIVATE_SEL ( array )) ; 56} 57 58//------------------------------------------------------------------------------------------------------------------------------------------------------------- 59 60_NS_INLINE NS :: Array * NS :: Array :: array ( const Object * pObject ) 61{ 62return Object :: sendMessage < Array *> ( _NS_PRIVATE_CLS ( NSArray ) , _NS_PRIVATE_SEL ( arrayWithObject_ ) , pObject ) ; 63} 64 65//------------------------------------------------------------------------------------------------------------------------------------------------------------- 66 67_NS_INLINE NS :: Array * NS :: Array :: array ( const Object * const * pObjects , UInteger count ) 68{ 69return Object :: sendMessage < Array *> ( _NS_PRIVATE_CLS ( NSArray ) , _NS_PRIVATE_SEL ( arrayWithObjects_count_ ) , pObjects , count ) ; 70} 71 72//------------------------------------------------------------------------------------------------------------------------------------------------------------- 73 74_NS_INLINE NS :: Array * NS :: Array :: alloc () 75{ 76return NS :: Object :: alloc < Array > ( _NS_PRIVATE_CLS ( NSArray )) ; 77} 78 79//------------------------------------------------------------------------------------------------------------------------------------------------------------- 80 81_NS_INLINE NS :: Array * NS :: Array :: init () 82{ 83return NS :: Object :: init < Array > () ; 84} 85 86//------------------------------------------------------------------------------------------------------------------------------------------------------------- 87 88_NS_INLINE NS :: Array * NS :: Array :: init ( const Object * const * pObjects , UInteger count ) 89{ 90return Object :: sendMessage < Array *> ( this , _NS_PRIVATE_SEL ( initWithObjects_count_ ) , pObjects , count ) ; 91} 92 93//------------------------------------------------------------------------------------------------------------------------------------------------------------- 94 95_NS_INLINE NS :: Array * NS :: Array :: init ( const class Coder * pCoder ) 96{ 97return Object :: sendMessage < Array *> ( this , _NS_PRIVATE_SEL ( initWithCoder_ ) , pCoder ) ; 98} 99 100//------------------------------------------------------------------------------------------------------------------------------------------------------------- 101 102_NS_INLINE NS :: UInteger NS :: Array :: count () const 103{ 104return Object :: sendMessage < UInteger > ( this , _NS_PRIVATE_SEL ( count )) ; 105} 106 107//------------------------------------------------------------------------------------------------------------------------------------------------------------- 108 109template < class _Object > 110_NS_INLINE _Object * NS :: Array :: object ( UInteger index ) const 111{ 112return Object :: sendMessage < _Object *> ( this , _NS_PRIVATE_SEL ( objectAtIndex_ ) , index ) ; 113} 114 115//-------------------------------------------------------------------------------------------------------------------------------------------------------------