test_variable.cpp 1020 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "direct_access.h"
  2. #include <library/cpp/yt/global/mock_modules/module3_public/test_tag.h>
  3. #include <library/cpp/yt/global/variable.h>
  4. namespace NYT {
  5. ////////////////////////////////////////////////////////////////////////////////
  6. NGlobal::TErasedStorage GetGlobal3() noexcept;
  7. ////////////////////////////////////////////////////////////////////////////////
  8. static NGlobal::TVariable<std::array<int, 2>> TestVariable3{
  9. TestTag3,
  10. &GetGlobal3,
  11. std::array{11, 22}};
  12. ////////////////////////////////////////////////////////////////////////////////
  13. NGlobal::TErasedStorage GetGlobal3() noexcept
  14. {
  15. return NGlobal::TErasedStorage{TestVariable3.Get()};
  16. }
  17. ////////////////////////////////////////////////////////////////////////////////
  18. std::array<int, 2> GetTestVariable3()
  19. {
  20. return TestVariable3.Get();
  21. }
  22. void SetTestVariable3(std::array<int, 2> val)
  23. {
  24. TestVariable3.Set(val);
  25. }
  26. ////////////////////////////////////////////////////////////////////////////////
  27. } // namespace NYT