Skip to content

Commit 0c40582

Browse files
committed
metal-cpp_macOS12_iOS15.zip
0 parents  commit 0c40582

File tree

83 files changed

+21913
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+21913
-0
lines changed

Foundation/Foundation.hpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2+
//
3+
// Foundation/Foundation.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 "NSArray.hpp"
26+
#include "NSAutoreleasePool.hpp"
27+
#include "NSBundle.hpp"
28+
#include "NSData.hpp"
29+
#include "NSDate.hpp"
30+
#include "NSDefines.hpp"
31+
#include "NSDictionary.hpp"
32+
#include "NSEnumerator.hpp"
33+
#include "NSError.hpp"
34+
#include "NSLock.hpp"
35+
#include "NSNotification.hpp"
36+
#include "NSNumber.hpp"
37+
#include "NSObject.hpp"
38+
#include "NSPrivate.hpp"
39+
#include "NSProcessInfo.hpp"
40+
#include "NSRange.hpp"
41+
#include "NSString.hpp"
42+
#include "NSTypes.hpp"
43+
#include "NSURL.hpp"
44+
45+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------

Foundation/NSArray.hpp

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
30+
namespace NS
31+
{
32+
class Array : public Copying<Array>
33+
{
34+
public:
35+
static Array* array();
36+
static Array* array(const Object* pObject);
37+
static Array* array(const Object* const* pObjects, UInteger count);
38+
39+
static Array* alloc();
40+
41+
Array* init();
42+
Array* init(const Object* const* pObjects, UInteger count);
43+
Array* init(const class Coder* pCoder);
44+
45+
template <class _Object = Object>
46+
_Object* object(UInteger index) const;
47+
UInteger count() const;
48+
};
49+
}
50+
51+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
52+
53+
_NS_INLINE NS::Array* NS::Array::array()
54+
{
55+
return 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+
{
62+
return 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+
{
69+
return 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+
{
76+
return NS::Object::alloc<Array>(_NS_PRIVATE_CLS(NSArray));
77+
}
78+
79+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
80+
81+
_NS_INLINE NS::Array* NS::Array::init()
82+
{
83+
return NS::Object::init<Array>();
84+
}
85+
86+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
87+
88+
_NS_INLINE NS::Array* NS::Array::init(const Object* const* pObjects, UInteger count)
89+
{
90+
return 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+
{
97+
return Object::sendMessage<Array*>(this, _NS_PRIVATE_SEL(initWithCoder_), pCoder);
98+
}
99+
100+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
101+
102+
_NS_INLINE NS::UInteger NS::Array::count() const
103+
{
104+
return Object::sendMessage<UInteger>(this, _NS_PRIVATE_SEL(count));
105+
}
106+
107+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
108+
109+
template <class _Object>
110+
_NS_INLINE _Object* NS::Array::object(UInteger index) const
111+
{
112+
return Object::sendMessage<_Object*>(this, _NS_PRIVATE_SEL(objectAtIndex_), index);
113+
}
114+
115+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------

Foundation/NSAutoreleasePool.hpp

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
2+
//
3+
// Foundation/NSAutoreleasePool.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 "NSDefines.hpp"
26+
#include "NSObject.hpp"
27+
#include "NSPrivate.hpp"
28+
#include "NSTypes.hpp"
29+
30+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
31+
32+
namespace NS
33+
{
34+
class AutoreleasePool : public Object
35+
{
36+
public:
37+
static AutoreleasePool* alloc();
38+
AutoreleasePool* init();
39+
40+
void drain();
41+
42+
void addObject(Object* pObject);
43+
44+
static void showPools();
45+
};
46+
}
47+
48+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
49+
50+
_NS_INLINE NS::AutoreleasePool* NS::AutoreleasePool::alloc()
51+
{
52+
return NS::Object::alloc<AutoreleasePool>(_NS_PRIVATE_CLS(NSAutoreleasePool));
53+
}
54+
55+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
56+
57+
_NS_INLINE NS::AutoreleasePool* NS::AutoreleasePool::init()
58+
{
59+
return NS::Object::init<AutoreleasePool>();
60+
}
61+
62+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
63+
64+
_NS_INLINE void NS::AutoreleasePool::drain()
65+
{
66+
Object::sendMessage<void>(this, _NS_PRIVATE_SEL(drain));
67+
}
68+
69+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
70+
71+
_NS_INLINE void NS::AutoreleasePool::addObject(Object* pObject)
72+
{
73+
Object::sendMessage<void>(this, _NS_PRIVATE_SEL(addObject_), pObject);
74+
}
75+
76+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------
77+
78+
_NS_INLINE void NS::AutoreleasePool::showPools()
79+
{
80+
Object::sendMessage<void>(_NS_PRIVATE_CLS(NSAutoreleasePool), _NS_PRIVATE_SEL(showPools));
81+
}
82+
83+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)