24#ifndef BASIC_OSTREAM_INCLUDED
25#define BASIC_OSTREAM_INCLUDED
138 bool flush()
override;
148 bool sync()
override;
159template <
int BUFFER_SIZE>
The abstract class for basic output streams which provides write operation.
Definition: basic_ostream.h:37
virtual ~Basic_ostream()=default
virtual bool write(const unsigned char *buffer, my_off_t length)=0
Write some bytes into the output stream.
Definition: basic_ostream.h:173
Managed_buffer_sequence_t & m_managed_buffer_sequence
Definition: basic_ostream.h:180
Compressor_ptr_t m_compressor
Definition: basic_ostream.h:179
Compressed_ostream(const Compressed_ostream &)=delete
Compressed_ostream(Compressor_ptr_t compressor, Managed_buffer_sequence_t &managed_buffer_sequence)
Definition: basic_ostream.h:184
Status_t m_status
Definition: basic_ostream.h:181
Compressed_ostream()=delete
std::shared_ptr< Compressor_t > Compressor_ptr_t
Definition: basic_ostream.h:176
bool write(const unsigned char *buffer, my_off_t length) override
Compress the given bytes into the buffer sequence.
Definition: basic_ostream.cc:92
Status_t get_status() const
Definition: basic_ostream.cc:99
Compressed_ostream & operator=(const Compressed_ostream &)=delete
~Compressed_ostream() override=default
An output stream based on IO_CACHE class.
Definition: basic_ostream.h:98
IO_CACHE m_io_cache
Definition: basic_ostream.h:151
bool close()
Closes the stream.
Definition: basic_ostream.cc:52
bool flush() override
Flush data to IO_CACHE's file if there is any data in IO_CACHE's buffer.
Definition: basic_ostream.cc:82
~IO_CACHE_ostream() override
Definition: basic_ostream.cc:32
IO_CACHE_ostream(const IO_CACHE_ostream &)=delete
bool truncate(my_off_t offset) override
Truncate some data at the end of the output stream.
Definition: basic_ostream.cc:72
bool seek(my_off_t offset) override
Put the write position to a given offset.
Definition: basic_ostream.cc:61
bool open(PSI_file_key log_file_key, const char *file_name, myf flags)
Open the output stream.
Definition: basic_ostream.cc:34
bool write(const unsigned char *buffer, my_off_t length) override
Write some bytes into the output stream.
Definition: basic_ostream.cc:66
bool sync() override
Syncs the file to disk.
Definition: basic_ostream.cc:87
IO_CACHE_ostream & operator=(const IO_CACHE_ostream &)=delete
A basic output stream based on StringBuffer class.
Definition: basic_ostream.h:161
StringBuffer_ostream(const StringBuffer_ostream &)=delete
bool write(const unsigned char *buffer, my_off_t length) override
Write some bytes into the output stream.
Definition: basic_ostream.h:167
StringBuffer_ostream()=default
StringBuffer_ostream & operator=(const StringBuffer_ostream &)=delete
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:681
bool append(const String &s)
Definition: sql_string.cc:419
size_t length() const
Definition: sql_string.h:241
Truncatable_ostream abstract class provides seek() and truncate() interfaces to all truncatable outpu...
Definition: basic_ostream.h:58
virtual bool flush()=0
Flush data.
virtual bool seek(my_off_t offset)=0
Put the write position to a given offset.
~Truncatable_ostream() override=default
virtual bool sync()=0
Sync.
virtual bool truncate(my_off_t offset)=0
Truncate some data at the end of the output stream.
Abstract base class for compressors.
Definition: compressor.h:80
mysql::binlog::event::compression::buffer::Managed_buffer_sequence<> Managed_buffer_sequence_t
Definition: compressor.h:83
Owned, non-contiguous, growable memory buffer.
Definition: managed_buffer_sequence.h:115
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:48
static int flags[50]
Definition: hp_test1.cc:40
Functions for reading and storing in machine-independent format.
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
ulonglong my_off_t
Definition: my_inttypes.h:72
#define HAVE_PSI_INTERFACE
Definition: my_psi_config.h:39
Common header for many mysys elements.
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:94
Grow_status
Error statuses for classes that use Grow_calculator.
Definition: grow_status.h:38
@ success
A grow operation succeeded.
mysql::binlog::event::compression::buffer::Grow_status Compress_status
Definition: compressor.h:38
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Definition: gcs_xcom_synode.h:64
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47
Our own string classes, used pervasively throughout the executor.