react-native/ReactCommon/cxxreact/RAMBundleRegistry.h
Jia Li 0aa12939fd Revert D5850968: Configure JSExector with BundleRegistry instead of JSModulesUnbundle.
Differential Revision: D5850968

fbshipit-source-id: f4c9dc8d5f14cdd32195463e8786242e708770e9
2017-09-21 21:22:39 -07:00

29 lines
668 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <cstdint>
#include <memory>
#include <unordered_map>
#include <utility>
#include <cxxreact/JSModulesUnbundle.h>
namespace facebook {
namespace react {
class RAMBundleRegistry {
public:
constexpr static uint32_t MAIN_BUNDLE_ID = 0;
explicit RAMBundleRegistry(std::unique_ptr<JSModulesUnbundle> mainBundle);
JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId);
private:
JSModulesUnbundle *getBundle(uint32_t bundleId) const;
std::unordered_map<uint32_t, std::unique_ptr<JSModulesUnbundle>> m_bundles;
};
} // namespace react
} // namespace facebook