monotonic_provider.h 665 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <util/datetime/base.h>
  3. #include "monotonic.h"
  4. namespace NMonotonic {
  5. class IMonotonicTimeProvider: public TThrRefBase {
  6. public:
  7. virtual TMonotonic Now() = 0;
  8. };
  9. class TMonotonicOperator {
  10. public:
  11. static void RegisterProvider(TIntrusivePtr<IMonotonicTimeProvider> provider);
  12. static TMonotonic Now();
  13. };
  14. TIntrusivePtr<IMonotonicTimeProvider> CreateDefaultMonotonicTimeProvider();
  15. }
  16. // TODO: remove, alias for compatibility
  17. using IMonotonicTimeProvider = NMonotonic::IMonotonicTimeProvider;
  18. // TODO: remove, alias for compatibility
  19. using NMonotonic::CreateDefaultMonotonicTimeProvider;