realm-js/src/js_realm.hpp

28 lines
689 B
C++
Raw Normal View History

/* 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"
#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);
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)...));
}