1 ////////////////////////////////////////////////////////////////////////////
3 // Copyright 2014 Realm Inc.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 ////////////////////////////////////////////////////////////////////////////
19 #import <Foundation/Foundation.h>
25 @class RLMRealm, RLMSchema, RLMObjectBase, RLMResults, RLMProperty;
27 NS_ASSUME_NONNULL_BEGIN
33 // create or get cached accessors for the given schema
34 void RLMRealmCreateAccessors(RLMSchema *schema);
38 // Adding, Removing, Getting Objects
41 // add an object to the given realm
42 void RLMAddObjectToRealm(RLMObjectBase *object, RLMRealm *realm, bool createOrUpdate);
44 // delete an object from its realm
45 void RLMDeleteObjectFromRealm(RLMObjectBase *object, RLMRealm *realm);
47 // deletes all objects from a realm
48 void RLMDeleteAllObjectsFromRealm(RLMRealm *realm);
50 // get objects of a given class
51 RLMResults *RLMGetObjects(RLMRealm *realm, NSString *objectClassName, NSPredicate * _Nullable predicate)
54 // get an object with the given primary key
55 id _Nullable RLMGetObject(RLMRealm *realm, NSString *objectClassName, id _Nullable key) NS_RETURNS_RETAINED;
57 // create object from array or dictionary
58 RLMObjectBase *RLMCreateObjectInRealmWithValue(RLMRealm *realm, NSString *className,
59 id _Nullable value, bool createOrUpdate)
68 // switch List<> properties from being backed by unmanaged RLMArrays to RLMManagedArray
69 void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);
76 template<typename T> class BasicRowExpr;
77 using RowExpr = BasicRowExpr<Table>;
82 RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm, RLMClassInfo& info,
83 NSUInteger index) NS_RETURNS_RETAINED;
84 RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm, RLMClassInfo& info,
85 realm::RowExpr row) NS_RETURNS_RETAINED;