• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

realm / realm-core / 1730

04 Oct 2023 01:46PM UTC coverage: 91.575% (-0.04%) from 91.615%
1730

push

Evergreen

web-flow
Initial ObjectStore Class class (#6521)

94264 of 173446 branches covered (0.0%)

30 of 70 new or added lines in 10 files covered. (42.86%)

96 existing lines in 17 files now uncovered.

230350 of 251543 relevant lines covered (91.57%)

6843633.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.85
/src/realm/object-store/class.cpp
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2023 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

20
#include <realm/object-store/class.hpp>
21
#include <realm/object-store/shared_realm.hpp>
22

23
namespace realm {
24

25
Class::Class(std::shared_ptr<Realm> r, const ObjectSchema* object_schema)
26
    : m_realm(std::move(r))
27
    , m_object_schema(object_schema)
28
    , m_table(m_realm->read_group().get_table(m_object_schema->table_key))
29
{
6✔
30
}
6✔
31

32
std::pair<Obj, bool> Class::create_object(Mixed pk)
33
{
8✔
34
    bool did_create;
8✔
35
    auto obj = m_table->create_object_with_primary_key(pk, &did_create);
8✔
36
    return {obj, did_create};
8✔
37
}
8✔
38

39
Obj Class::create_object()
NEW
40
{
×
NEW
41
    return m_table->create_object();
×
NEW
42
}
×
43

44
Obj Class::get_object(Mixed pk)
NEW
45
{
×
NEW
46
    return m_table->get_object_with_primary_key(pk);
×
NEW
47
}
×
48

49
} // namespace realm
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc