RLMObjectSchema_Private.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #import <Realm/RLMObjectSchema.h>
  19. #import <objc/runtime.h>
  20. NS_ASSUME_NONNULL_BEGIN
  21. // RLMObjectSchema private
  22. @interface RLMObjectSchema () {
  23. @public
  24. bool _isSwiftClass;
  25. }
  26. /// The object type name reported to the object store and core.
  27. @property (nonatomic, readonly) NSString *objectName;
  28. // writable redeclaration
  29. @property (nonatomic, readwrite, copy) NSArray<RLMProperty *> *properties;
  30. @property (nonatomic, readwrite, assign) bool isSwiftClass;
  31. // class used for this object schema
  32. @property (nonatomic, readwrite, assign) Class objectClass;
  33. @property (nonatomic, readwrite, assign) Class accessorClass;
  34. @property (nonatomic, readwrite, assign) Class unmanagedClass;
  35. @property (nonatomic, readwrite, nullable) RLMProperty *primaryKeyProperty;
  36. @property (nonatomic, copy) NSArray<RLMProperty *> *computedProperties;
  37. @property (nonatomic, readonly) NSArray<RLMProperty *> *swiftGenericProperties;
  38. // returns a cached or new schema for a given object class
  39. + (instancetype)schemaForObjectClass:(Class)objectClass;
  40. @end
  41. @interface RLMObjectSchema (Dynamic)
  42. /**
  43. This method is useful only in specialized circumstances, for example, when accessing objects
  44. in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
  45. to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
  46. Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
  47. @warning This method is useful only in specialized circumstances.
  48. @param objectClassName The name of the class used to refer to objects of this type.
  49. @param objectClass The Objective-C class used when creating instances of this type.
  50. @param properties An array of RLMProperty instances describing the managed properties for this type.
  51. @return An initialized instance of RLMObjectSchema.
  52. */
  53. - (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;
  54. @end
  55. NS_ASSUME_NONNULL_END