-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: brocollie08 <[email protected]>
- Loading branch information
1 parent
9fb37b1
commit 75ed389
Showing
4 changed files
with
60 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,30 @@ | ||
#pragma once | ||
|
||
#include <jsi/jsi.h> | ||
#include <set> | ||
#include <unordered_map> | ||
#include <vector> | ||
#include <variant> | ||
|
||
using namespace std; | ||
using namespace facebook::jsi; | ||
|
||
namespace intuit::playerui { | ||
|
||
using VariantType = variant<Value, Object, Array, Function, Symbol>; | ||
|
||
class RuntimeScope { | ||
public: | ||
unique_ptr<set<shared_ptr<Value>>> valueScope; | ||
unique_ptr<set<shared_ptr<Object>>> objectScope; | ||
unique_ptr<set<shared_ptr<Array>>> arrayScope; | ||
unique_ptr<set<shared_ptr<Function>>> functionScope; | ||
unique_ptr<set<shared_ptr<Symbol>>> symbolScope; | ||
unique_ptr<vector<shared_ptr<VariantType>>> sharedScope; | ||
|
||
std::weak_ptr<Value> trackValue(Value value); | ||
std::weak_ptr<VariantType> trackValue(Value value); | ||
|
||
std::weak_ptr<Function> trackFunction(Function value); | ||
std::weak_ptr<VariantType> trackFunction(Function value); | ||
|
||
std::weak_ptr<Object> trackObject(Object value); | ||
std::weak_ptr<VariantType> trackObject(Object value); | ||
|
||
std::weak_ptr<Array> trackArray(Array value); | ||
std::weak_ptr<VariantType> trackArray(Array value); | ||
|
||
std::weak_ptr<Symbol> trackSymbol(Symbol value); | ||
std::weak_ptr<VariantType> trackSymbol(Symbol value); | ||
|
||
explicit RuntimeScope(): valueScope(make_unique<set<shared_ptr<Value>>>()), objectScope(make_unique<set<shared_ptr<Object>>>()), arrayScope(make_unique<set<shared_ptr<Array>>>()), functionScope(make_unique<set<shared_ptr<Function>>>()), symbolScope(make_unique<set<shared_ptr<Symbol>>>()){} | ||
explicit RuntimeScope(): sharedScope(make_unique<vector<shared_ptr<VariantType>>>()){} | ||
}; | ||
} |