added iOS source code
[wl-app.git] / iOS / Pods / Realm / include / RLMObjectSchema_Private.h
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright 2014 Realm Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 ////////////////////////////////////////////////////////////////////////////
18
19 #import <Realm/RLMObjectSchema.h>
20
21 #import <objc/runtime.h>
22
23 NS_ASSUME_NONNULL_BEGIN
24
25 // RLMObjectSchema private
26 @interface RLMObjectSchema () {
27 @public
28     bool _isSwiftClass;
29 }
30
31 /// The object type name reported to the object store and core.
32 @property (nonatomic, readonly) NSString *objectName;
33
34 // writable redeclaration
35 @property (nonatomic, readwrite, copy) NSArray<RLMProperty *> *properties;
36 @property (nonatomic, readwrite, assign) bool isSwiftClass;
37
38 // class used for this object schema
39 @property (nonatomic, readwrite, assign) Class objectClass;
40 @property (nonatomic, readwrite, assign) Class accessorClass;
41 @property (nonatomic, readwrite, assign) Class unmanagedClass;
42
43 @property (nonatomic, readwrite, nullable) RLMProperty *primaryKeyProperty;
44
45 @property (nonatomic, copy) NSArray<RLMProperty *> *computedProperties;
46 @property (nonatomic, readonly) NSArray<RLMProperty *> *swiftGenericProperties;
47
48 // returns a cached or new schema for a given object class
49 + (instancetype)schemaForObjectClass:(Class)objectClass;
50 @end
51
52 @interface RLMObjectSchema (Dynamic)
53 /**
54  This method is useful only in specialized circumstances, for example, when accessing objects
55  in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
56  to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
57
58  Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
59
60  @warning This method is useful only in specialized circumstances.
61
62  @param objectClassName     The name of the class used to refer to objects of this type.
63  @param objectClass         The Objective-C class used when creating instances of this type.
64  @param properties          An array of RLMProperty instances describing the managed properties for this type.
65
66  @return    An initialized instance of RLMObjectSchema.
67  */
68 - (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;
69 @end
70
71 NS_ASSUME_NONNULL_END