2015-10-27 13:59:15 -07:00
|
|
|
/* Copyright 2015 Realm Inc - All Rights Reserved
|
|
|
|
* Proprietary and Confidential
|
|
|
|
*/
|
2015-08-13 09:12:48 -07:00
|
|
|
|
2015-12-01 14:52:38 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "js_util.hpp"
|
2015-10-19 13:39:21 -07:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace realm {
|
|
|
|
class Realm;
|
|
|
|
using ObjectDefaults = std::map<std::string, JSValueRef>;
|
|
|
|
}
|
2015-08-13 09:12:48 -07:00
|
|
|
|
|
|
|
JSClassRef RJSRealmClass();
|
|
|
|
JSClassRef RJSRealmConstructorClass();
|
|
|
|
|
|
|
|
std::string RJSDefaultPath();
|
|
|
|
void RJSSetDefaultPath(std::string path);
|
|
|
|
|
2015-10-19 13:39:21 -07:00
|
|
|
std::map<std::string, realm::ObjectDefaults> &RJSDefaults(realm::Realm *realm);
|
2015-10-19 14:56:59 -07:00
|
|
|
std::map<std::string, JSValueRef> &RJSPrototypes(realm::Realm *realm);
|
2015-12-02 03:42:47 +00:00
|
|
|
|
|
|
|
template<typename T, typename... Args>
|
|
|
|
std::unique_ptr<T> make_unique(Args&&... args)
|
|
|
|
{
|
|
|
|
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
|
|
|
}
|