A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/istreamasync_8h_source.html below:

NCBI C++ ToolKit: include/misc/jsonwrapp/rapidjson11/istreamasync.h Source File

Go to the documentation of this file.

Go to the SVN repository for this file.

20 #ifndef RAPIDJSON_ISTREAMASYNC_H_ 21 #define RAPIDJSON_ISTREAMASYNC_H_ 29

RAPIDJSON_DIAG_OFF(padded)

34

RAPIDJSON_DIAG_OFF(4351)

55 template

<

typename

StreamType>

61

: stream_(stream), count_(0), bufferSize_(bufferSize)

63  buffer

[0] = std::make_unique< Ch[] >(bufferSize_);

64  buffer

[1] = std::make_unique< Ch[] >(bufferSize_);

66

bufferLast_ = current_ =

buffer

[destbuffer].get();

68

pos_ = stream_.tellg();

75

stream_.seekg(pos_ + count_);

88  size_t Tell

()

const

{

return

count_; }

114

std::future< size_t >

ft

;

117

ft = std::async( std::launch::async, [&]() {

118  return

(

size_t

)stream_.rdbuf()->sgetn(

buffer

[destbuffer].get(), bufferSize_);

122  if

(!eof_ && current_ == bufferLast_) {

123

current_ =

buffer

[destbuffer].get();

124

bufferLast_ = current_ + ft.get();

125

destbuffer = (destbuffer + 1)%2;

126  if

(current_ != bufferLast_) {

132  if

(current_ < bufferLast_) {

136  if

(!eof_ && current_ == bufferLast_) {

138  if

(current_ == bufferLast_) {

149 #if defined(__clang__) || defined(_MSC_VER)

Wrapper of std::basic_istream into RapidJSON's Stream concept.

BasicIStreamAsyncWrapper(const BasicIStreamAsyncWrapper &)

BasicIStreamAsyncWrapper(StreamType &stream, size_t bufferSize=64 *1024)

size_t count_

Number of characters read. Note:

BasicIStreamAsyncWrapper & operator=(const BasicIStreamAsyncWrapper &)

~BasicIStreamAsyncWrapper()

void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)

#define RAPIDJSON_ASSERT(x)

Assertion.

#define RAPIDJSON_NAMESPACE_BEGIN

provide custom rapidjson namespace (opening expression)

#define RAPIDJSON_NAMESPACE_END

provide custom rapidjson namespace (closing expression)

string_type::value_type char_type

The character type used by the parser.

BasicIStreamAsyncWrapper< std::istream > IStreamAsyncWrapper


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4