Realistic 3D camera system
3D camera system components
|
Automatically resizable buffer class based on std::streambuf. More...
#include <basic_streambuf.hpp>
Public Types | |
typedef asio::const_buffers_1 | const_buffers_type |
typedef asio::mutable_buffers_1 | mutable_buffers_type |
Public Member Functions | |
basic_streambuf (std::size_t maximum_size=(std::numeric_limits< std::size_t >::max)(), const Allocator &allocator=Allocator()) | |
Construct a basic_streambuf object. More... | |
std::size_t | size () const |
Get the size of the input sequence. More... | |
std::size_t | max_size () const |
Get the maximum size of the basic_streambuf. More... | |
const_buffers_type | data () const |
Get a list of buffers that represents the input sequence. More... | |
mutable_buffers_type | prepare (std::size_t n) |
void | commit (std::size_t n) |
Move characters from the output sequence to the input sequence. More... | |
void | consume (std::size_t n) |
Remove characters from the input sequence. More... | |
Protected Types | |
enum | { buffer_delta = 128 } |
Protected Member Functions | |
int_type | underflow () |
Override std::streambuf behaviour. More... | |
int_type | overflow (int_type c) |
Override std::streambuf behaviour. More... | |
void | reserve (std::size_t n) |
Friends | |
std::size_t | read_size_helper (basic_streambuf &sb, std::size_t max_size) |
Automatically resizable buffer class based on std::streambuf.
The basic_streambuf
class is derived from std::streambuf
to associate the streambuf's input and output sequences with one or more character arrays. These character arrays are internal to the basic_streambuf
object, but direct access to the array elements is provided to permit them to be used efficiently with I/O operations. Characters written to the output sequence of a basic_streambuf
object are appended to the input sequence of the same object.
The basic_streambuf
class's public interface is intended to permit the following implementation strategies:
The constructor for basic_streambuf accepts a size_t
argument specifying the maximum of the sum of the sizes of the input sequence and output sequence. During the lifetime of the basic_streambuf
object, the following invariant holds:
Any member function that would, if successful, cause the invariant to be violated shall throw an exception of class std::length_error
.
The constructor for basic_streambuf
takes an Allocator argument. A copy of this argument is used for any memory allocation performed, by the constructor and by all member functions, during the lifetime of each basic_streambuf
object.
Reading from a socket directly into a streambuf:
Definition at line 110 of file basic_streambuf.hpp.
typedef asio::const_buffers_1 asio::basic_streambuf< Allocator >::const_buffers_type |
Definition at line 122 of file basic_streambuf.hpp.
typedef asio::mutable_buffers_1 asio::basic_streambuf< Allocator >::mutable_buffers_type |
Definition at line 123 of file basic_streambuf.hpp.
|
protected |
Enumerator | |
---|---|
buffer_delta |
Definition at line 248 of file basic_streambuf.hpp.
|
inlineexplicit |
Construct a basic_streambuf object.
Constructs a streambuf with the specified maximum size. The initial size of the streambuf's input sequence is 0.
Definition at line 131 of file basic_streambuf.hpp.
|
inline |
Move characters from the output sequence to the input sequence.
Appends n
characters from the start of the output sequence to the input sequence. The beginning of the output sequence is advanced by n
characters.
Requires a preceding call prepare(x)
where x >= n
, and no intervening operations that modify the input or output sequence.
n
is greater than the size of the output sequence, the entire output sequence is moved to the input sequence and no error is issued. Definition at line 223 of file basic_streambuf.hpp.
|
inline |
Remove characters from the input sequence.
Removes n
characters from the beginning of the input sequence.
n
is greater than the size of the input sequence, the entire input sequence is consumed and no error is issued. Definition at line 238 of file basic_streambuf.hpp.
|
inline |
Get a list of buffers that represents the input sequence.
const_buffers_type
that satisfies ConstBufferSequence requirements, representing all character arrays in the input sequence.basic_streambuf
member function that modifies the input sequence or output sequence. Definition at line 182 of file basic_streambuf.hpp.
|
inline |
Get the maximum size of the basic_streambuf.
Definition at line 168 of file basic_streambuf.hpp.
|
inlineprotected |
Override std::streambuf behaviour.
Behaves according to the specification of std::streambuf::overflow()
, with the specialisation that std::length_error
is thrown if appending the character to the input sequence would require the condition size() > max_size()
to be true.
Definition at line 274 of file basic_streambuf.hpp.
|
inline |
Get a list of buffers that represents the output sequence, with the given size. Ensures that the output sequence can accommodate n
characters, reallocating character array objects as necessary.
mutable_buffers_type
that satisfies MutableBufferSequence requirements, representing character array objects at the start of the output sequence such that the sum of the buffer sizes is n
.std::length_error | If size() + n > max_size() . |
basic_streambuf
member function that modifies the input sequence or output sequence. Definition at line 204 of file basic_streambuf.hpp.
|
inlineprotected |
Definition at line 299 of file basic_streambuf.hpp.
|
inline |
Get the size of the input sequence.
s
in the following code: Definition at line 158 of file basic_streambuf.hpp.
|
inlineprotected |
Override std::streambuf behaviour.
Behaves according to the specification of std::streambuf::underflow()
.
Definition at line 254 of file basic_streambuf.hpp.
|
friend |
Definition at line 344 of file basic_streambuf.hpp.