newsmemory-ios-sdk/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/JSIStoreValueUser.h

38 lines
747 B
C
Raw Permalink Normal View History

2024-10-29 07:36:43 +00:00
#pragma once
#include <jsi/jsi.h>
#include <stdio.h>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <vector>
#include "Scheduler.h"
using namespace facebook;
namespace reanimated {
class RuntimeManager;
struct StaticStoreUser {
std::atomic<int> ctr;
std::unordered_map<int, std::vector<std::shared_ptr<jsi::Value>>> store;
std::recursive_mutex storeMutex;
};
class StoreUser {
int identifier = 0;
std::weak_ptr<Scheduler> scheduler;
std::shared_ptr<StaticStoreUser> storeUserData;
public:
StoreUser(std::shared_ptr<Scheduler> s, const RuntimeManager &runtimeManager);
std::weak_ptr<jsi::Value> getWeakRef(jsi::Runtime &rt);
void removeRefs();
virtual ~StoreUser();
};
} // namespace reanimated