NCBI C++ ToolKit
multi_writer.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef UTIL___MULTI_WRITER__HPP
2 #define UTIL___MULTI_WRITER__HPP
3 
4 /* $Id: multi_writer.hpp 33815 2007-05-04 17:18:18Z kazimird $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Maxim Didenko
30  *
31  * File Description:
32  *
33  */
34 
35 /// @file transmissionrw.hpp
36 /// Reader writer with transmission checking
37 /// @sa IReader, IWriter
38 
39 #include <corelib/ncbimisc.hpp>
41 #include <corelib/ncbidbg.hpp> // for _ASSERT
42 
43 
45 
46 
47 /// IWriter which can write simultaneously to the different streams
48 ///
50 {
51 public:
52 
53  explicit CMultiWriter(const list<CNcbiOstream*>& streams);
54  virtual ~CMultiWriter();
55 
56  virtual ERW_Result Write(const void* buf,
57  size_t count,
58  size_t* bytes_written = 0);
59 
60  virtual ERW_Result Flush(void);
61 
62 private:
65 private:
66  list<CNcbiOstream*> m_Dest;
67 };
68 
69 
71 
72 #endif /* UTIL___MULTI_WRITER__HPP */
IWriter which can write simultaneously to the different streams.
CMultiWriter(const CMultiWriter &)
CMultiWriter & operator=(CMultiWriter &)
list< CNcbiOstream * > m_Dest
A very basic data-write interface.
Abstract reader-writer interface classes.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
ERW_Result
Result codes for I/O operations.
virtual ERW_Result Flush(void)=0
Flush pending data (if any) down to the output device.
virtual ERW_Result Write(const void *buf, size_t count, size_t *bytes_written=0)=0
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
char * buf
NCBI C++ auxiliary debug macros.
Miscellaneous common-use basic types and functionality.
NCBI_XUTIL_EXPORT
Parameter to control printing diagnostic message about conversion of static array data from a differe...
Definition: static_set.hpp:72
Modified on Thu Feb 29 12:22:12 2024 by modify_doxy.py rev. 669887