mirror of
https://github.com/status-im/react-native.git
synced 2025-01-17 04:50:59 +00:00
0aa12939fd
Differential Revision: D5850968 fbshipit-source-id: f4c9dc8d5f14cdd32195463e8786242e708770e9
29 lines
668 B
C++
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
|