protoio.hh (9399:f7582cce2459) protoio.hh (9705:177e8d8e50fc)
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 108 unchanged lines hidden (view full) ---

117 void write(const google::protobuf::Message& msg);
118
119 private:
120
121 /// Underlying file output stream
122 std::ofstream fileStream;
123
124 /// Zero Copy stream wrapping the STL output stream
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 108 unchanged lines hidden (view full) ---

117 void write(const google::protobuf::Message& msg);
118
119 private:
120
121 /// Underlying file output stream
122 std::ofstream fileStream;
123
124 /// Zero Copy stream wrapping the STL output stream
125 google::protobuf::io::OstreamOutputStream* zeroCopyStream;
125 google::protobuf::io::OstreamOutputStream* wrappedFileStream;
126
127 /// Optional Gzip stream to wrap the Zero Copy stream
128 google::protobuf::io::GzipOutputStream* gzipStream;
129
126
127 /// Optional Gzip stream to wrap the Zero Copy stream
128 google::protobuf::io::GzipOutputStream* gzipStream;
129
130 /// Top-level coded stream that messages are written to
131 google::protobuf::io::CodedOutputStream* codedStream;
130 /// Top-level zero-copy stream, either with compression or not
131 google::protobuf::io::ZeroCopyOutputStream* zeroCopyStream;
132
133};
134
135/**
136 * A ProtoInputStream wraps a coded stream, potentially with
137 * decompression, based on looking at the file name. Reading from the
138 * stream is done on a per-message basis to avoid having to deal with
139 * huge data structures. The latter assumes the length of each message

--- 48 unchanged lines hidden (view full) ---

188
189 /// Hold on to the file name for debug messages
190 const std::string fileName;
191
192 /// Boolean flag to remember whether we use gzip or not
193 bool useGzip;
194
195 /// Zero Copy stream wrapping the STL input stream
132
133};
134
135/**
136 * A ProtoInputStream wraps a coded stream, potentially with
137 * decompression, based on looking at the file name. Reading from the
138 * stream is done on a per-message basis to avoid having to deal with
139 * huge data structures. The latter assumes the length of each message

--- 48 unchanged lines hidden (view full) ---

188
189 /// Hold on to the file name for debug messages
190 const std::string fileName;
191
192 /// Boolean flag to remember whether we use gzip or not
193 bool useGzip;
194
195 /// Zero Copy stream wrapping the STL input stream
196 google::protobuf::io::IstreamInputStream* zeroCopyStream;
196 google::protobuf::io::IstreamInputStream* wrappedFileStream;
197
198 /// Optional Gzip stream to wrap the Zero Copy stream
199 google::protobuf::io::GzipInputStream* gzipStream;
200
197
198 /// Optional Gzip stream to wrap the Zero Copy stream
199 google::protobuf::io::GzipInputStream* gzipStream;
200
201 /// Top-level coded stream that messages are read from
202 google::protobuf::io::CodedInputStream* codedStream;
201 /// Top-level zero-copy stream, either with compression or not
202 google::protobuf::io::ZeroCopyInputStream* zeroCopyStream;
203
204};
205
206#endif //__PROTO_PROTOIO_HH
203
204};
205
206#endif //__PROTO_PROTOIO_HH