StubViewTree.h 833 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <memory>
  9. #include <unordered_map>
  10. #include <react/mounting/ShadowViewMutation.h>
  11. #include <react/mounting/StubView.h>
  12. namespace facebook {
  13. namespace react {
  14. class StubViewTree {
  15. public:
  16. StubViewTree() = default;
  17. StubViewTree(ShadowView const &shadowView);
  18. void mutate(ShadowViewMutationList const &mutations);
  19. StubView const &getRootStubView() const;
  20. Tag rootTag;
  21. std::unordered_map<Tag, StubView::Shared> registry{};
  22. };
  23. bool operator==(StubViewTree const &lhs, StubViewTree const &rhs);
  24. bool operator!=(StubViewTree const &lhs, StubViewTree const &rhs);
  25. } // namespace react
  26. } // namespace facebook