tee.h 530 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "output.h"
  3. /**
  4. * @addtogroup Streams_Multi
  5. * @{
  6. */
  7. /**
  8. * A proxy output stream that writes into two slave streams simultaneously.
  9. */
  10. class TTeeOutput: public IOutputStream {
  11. public:
  12. TTeeOutput(IOutputStream* l Y_LIFETIME_BOUND, IOutputStream* r Y_LIFETIME_BOUND) noexcept;
  13. ~TTeeOutput() override;
  14. private:
  15. void DoWrite(const void* buf, size_t len) override;
  16. void DoFlush() override;
  17. void DoFinish() override;
  18. private:
  19. IOutputStream* L_;
  20. IOutputStream* R_;
  21. };
  22. /** @} */