The basic_container_buffer class serves as a memory-based steam buffer that supports writing or reading sequences of characters. Note that it cannot be used as a consumer producer buffer.
More...
#include <containerstream.h>
Inheritance diagram for Concurrency::streams::container_buffer< _CollectionType >:
Public Types
typedef _CollectionType::value_type char_type
typedef _CollectionType::value_type char_type
typedef ::concurrency::streams::char_traits< _CollectionType::value_type > traits
typedef traits::int_type int_type
typedef traits::pos_type pos_type
typedef traits::off_type off_type
Public Member Functions
container_buffer (_CollectionType data, std::ios_base::openmode mode=std::ios_base::in)
_CollectionType & collection () const
concurrency::streams::basic_istream< _CollectionType::value_type >
create_istream () const
Constructs an input stream head for this stream buffer.
More...
concurrency::streams::basic_ostream< _CollectionType::value_type >
create_ostream () const
Constructs an output stream for this stream buffer.
More...
Checks if the stream buffer has been initialized or not.
More...
can_read
is used to determine whether a stream buffer will support read operations (get).
More...
can_write
is used to determine whether a stream buffer will support write operations (put).
More...
can_seek
is used to determine whether a stream buffer supports seeking.
More...
has_size
is used to determine whether a stream buffer supports
size().
More...
virtual utility::size64_t
size () const
Gets the total number of characters in the stream buffer, if known. Calls to
has_size
will determine whether the result of
size
can be relied on.
More...
virtual size_t
buffer_size (std::ios_base::openmode direction=std::ios_base::in) const
Gets the stream buffer size, if one has been set.
More...
virtual void
set_buffer_size (size_t
size, std::ios_base::openmode direction=std::ios_base::in)
Sets the stream buffer implementation to buffer or not buffer.
More...
For any input stream,
in_avail
returns the number of characters that are immediately available to be consumed without blocking. May be used in conjunction with <cref="::sbumpc method"/> to read data without incurring the overhead of using tasks.
More...
Checks if the stream buffer is open.
More...
is_eof
is used to determine whether a read head has reached the end of the buffer.
More...
virtual
pplx::task< void >
close (std::ios_base::openmode mode=(std::ios_base::in|std::ios_base::out))
Closes the stream buffer, preventing further read or write operations.
More...
virtual
pplx::task< void >
close (std::ios_base::openmode mode, std::exception_ptr eptr)
Closes the stream buffer with an exception.
More...
Writes a single character to the stream.
More...
virtual _CollectionType::value_type *
alloc (size_t count)
Allocates a contiguous memory block and returns it.
More...
virtual void
commit (size_t count)
Submits a block already allocated by the stream buffer.
More...
virtual bool
acquire (_Out_ _CollectionType::value_type *&ptr, _Out_ size_t &count)
Gets a pointer to the next already allocated contiguous block of data.
More...
virtual void
release (_Out_writes_(count) _CollectionType::value_type *ptr, _In_ size_t count)
Releases a block of data acquired using ::acquire method. This frees the stream buffer to de-allocate the memory, if it so desires. Move the read position ahead by the count.
More...
virtual
pplx::task< size_t >
putn (const _CollectionType::value_type *ptr, size_t count)
Writes a number of characters to the stream.
More...
Writes a number of characters to the stream. Note: callers must make sure the data to be written is valid until the returned task completes.
More...
Reads a single character from the stream and advances the read position.
More...
Reads a single character from the stream and advances the read position.
More...
Reads a single character from the stream without advancing the read position.
More...
Reads a single character from the stream without advancing the read position.
More...
Advances the read position, then returns the next character without advancing again.
More...
Retreats the read position, then returns the current character without advancing.
More...
virtual
pplx::task< size_t >
getn (_Out_writes_(count) _CollectionType::value_type *ptr, _In_ size_t count)
Reads up to a given number of characters from the stream.
More...
virtual size_t
scopy (_Out_writes_(count) _CollectionType::value_type *ptr, _In_ size_t count)
Copies up to a given number of characters from the stream, synchronously.
More...
Gets the current read or write position in the stream.
More...
Seeks to the given position.
More...
Seeks to a position given by a relative offset.
More...
For output streams, flush any internally buffered data to the underlying medium.
More...
virtual std::exception_ptr
exception () const
Retrieves the stream buffer exception_ptr if it has been set.
More...
Virtual constructor for stream buffers.
More...
virtual pos_type
seekpos (pos_type pos, std::ios_base::openmode direction)=0
Seeks to the given position.
More...
virtual pos_type
seekoff (off_type offset, std::ios_base::seekdir way, std::ios_base::openmode mode)=0
Seeks to a position given by a relative offset.
More...
virtual _CollectionType::value_type *
alloc (_In_ size_t count)=0
Allocates a contiguous memory block and returns it.
More...
virtual void
commit (_In_ size_t count)=0
Submits a block already allocated by the stream buffer.
More...
Detailed Description
template<typename _CollectionType>
class Concurrency::streams::container_buffer< _CollectionType >
The basic_container_buffer class serves as a memory-based steam buffer that supports writing or reading sequences of characters. Note that it cannot be used as a consumer producer buffer.
- Template Parameters
-
_CollectionType The type of the container.
This is a reference-counted version of basic_container_buffer
.
Constructor & Destructor Documentation
template<typename _CollectionType >
std::ios_base::openmode
mode = std::ios_base::in
)
inline
Creates a container_buffer given a collection, copying its data into the buffer.
- Parameters
-
data The collection that is the starting point for the buffer
mode The I/O mode that the buffer should use (in / out)
template<typename _CollectionType >
Creates a container_buffer starting from an empty collection.
- Parameters
-
mode The I/O mode that the buffer should use (in / out)
The documentation for this class was generated from the following file: