react-native/ReactCommon/cxxreact/RAMBundleRegistry.h
Alex Dvornikov 2f952fbaac Initial implementation of multiple RAM bundles registry
Differential Revision: D5850963

fbshipit-source-id: e1bd6d74953872d38e73a20f6d054905a7e4c80c
2017-09-21 08:51:00 -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