<commit_before>////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#ifndef REALM_REALM_HPP
#define REALM_REALM_HPP

#include <memory>
#include <thread>
#include <vector>
#include <mutex>
#include <set>
#include <map>

#include "object_store.hpp"

namespace realm {
    class RealmCache;
    class Realm;
    typedef std::shared_ptr<Realm> SharedRealm;
    typedef std::weak_ptr<Realm> WeakRealm;
    class ClientHistory;

    class Realm : public std::enable_shared_from_this<Realm>
    {
      public:
        typedef std::function<void(SharedRealm old_realm, SharedRealm realm)> MigrationFunction;

        struct Config
        {
            std::string path;
            bool read_only;
            bool in_memory;
            std::unique_ptr<char[]> encryption_key;

            std::unique_ptr<Schema> schema;
            uint64_t schema_version;

            MigrationFunction migration_function;

            Config() : read_only(false), in_memory(false), schema_version(ObjectStore::NotVersioned) {};<commit_msg>Use NSDMIs for Realm::Config and make it moveable<commit_after>////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#ifndef REALM_REALM_HPP
#define REALM_REALM_HPP

#include <memory>
#include <thread>
#include <vector>
#include <mutex>
#include <set>
#include <map>

#include "object_store.hpp"

namespace realm {
    class RealmCache;
    class Realm;
    typedef std::shared_ptr<Realm> SharedRealm;
    typedef std::weak_ptr<Realm> WeakRealm;
    class ClientHistory;

    class Realm : public std::enable_shared_from_this<Realm>
    {
      public:
        typedef std::function<void(SharedRealm old_realm, SharedRealm realm)> MigrationFunction;

        struct Config
        {
            std::string path;
            bool read_only = false;
            bool in_memory = false;
            std::unique_ptr<char[]> encryption_key;

            std::unique_ptr<Schema> schema;
            uint64_t schema_version = ObjectStore::NotVersioned;

            MigrationFunction migration_function;

            Config() = default;
            Config(Config&&) = default;
{'fraction_non_alphanumeric': 0.1724733659660236, 'fraction_numerical': 0.005758710048949035, 'mean_word_length': 2.222634508348794, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6226535', 'n_tokens_mistral': 920, 'n_tokens_neox': 881, 'n_words': 302}