MCPcopy Create free account
hub / github.com/davisking/dlib / sockstreambuf

Method sockstreambuf

dlib/sockstreambuf/sockstreambuf.h:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 typedef sockstreambuf kernel_2a;
40
41 sockstreambuf (
42 connection* con_,
43 std::streamsize out_buffer_size_ = 10000,
44 std::streamsize in_buffer_size_ = 10000,
45 std::streamsize max_putback_ = 4
46 ) :
47 con(*con_),
48 out_buffer_size(out_buffer_size_),
49 in_buffer_size(in_buffer_size_),
50 max_putback(max_putback_),
51 autoflush(false)
52 {
53 DLIB_ASSERT(0 < out_buffer_size && out_buffer_size <= std::numeric_limits<int>::max(),
54 "out_buffer_size must be in the range (0, INT_MAX]");
55 DLIB_ASSERT(0 < in_buffer_size && in_buffer_size <= std::numeric_limits<int>::max(),
56 "in_buffer_size must be in the range (0, INT_MAX]");
57 DLIB_ASSERT(0 <= max_putback && max_putback < in_buffer_size,
58 "max_putback must be in the range [0, in_buffer_size)");
59
60 out_buffer.reset(new char[static_cast<size_t>(out_buffer_size)]);
61 in_buffer.reset(new char[static_cast<size_t>(in_buffer_size)]);
62 init();
63 }
64
65 sockstreambuf (
66 const std::unique_ptr<connection>& con_,

Callers

nothing calls this directly

Calls 4

initFunction · 0.85
maxFunction · 0.50
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected