aboutsummaryrefslogblamecommitdiffstats
path: root/util/stream/tee.h
blob: c69e232fb9f75e31f6db0e88d2ded369d27a20f0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
            

                   






                                                                           
                                        
       
                                                            
                           
 
        

                                                       
 
        
                      
  
         
#pragma once

#include "output.h"

/**
 * @addtogroup Streams_Multi
 * @{
 */

/**
 * A proxy output stream that writes into two slave streams simultaneously.
 */
class TTeeOutput: public IOutputStream {
public:
    TTeeOutput(IOutputStream* l, IOutputStream* r) noexcept;
    ~TTeeOutput() override;

private:
    void DoWrite(const void* buf, size_t len) override;
    void DoFlush() override;
    void DoFinish() override;

private:
    IOutputStream* L_;
    IOutputStream* R_;
};

/** @} */