consumer.h 1000 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "event.h"
  3. #include <util/generic/strbuf.h>
  4. #include <util/system/types.h>
  5. namespace NYsonPull {
  6. class IConsumer {
  7. public:
  8. virtual ~IConsumer() = default;
  9. virtual void OnBeginStream() = 0;
  10. virtual void OnEndStream() = 0;
  11. virtual void OnBeginList() = 0;
  12. virtual void OnEndList() = 0;
  13. virtual void OnBeginMap() = 0;
  14. virtual void OnEndMap() = 0;
  15. virtual void OnBeginAttributes() = 0;
  16. virtual void OnEndAttributes() = 0;
  17. virtual void OnKey(TStringBuf name) = 0;
  18. virtual void OnEntity() = 0;
  19. virtual void OnScalarBoolean(bool value) = 0;
  20. virtual void OnScalarInt64(i64 value) = 0;
  21. virtual void OnScalarUInt64(ui64 value) = 0;
  22. virtual void OnScalarFloat64(double value) = 0;
  23. virtual void OnScalarString(TStringBuf value) = 0;
  24. virtual void OnScalar(const TScalar& value);
  25. virtual void OnEvent(const TEvent& value);
  26. };
  27. }