NCBI C++ ToolKit
gridrpcclient.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
2 #define OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
3 
4 /* $Id: gridrpcclient.hpp 99711 2023-05-02 14:14:50Z evgeniev $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Peter Meric, Dmitry Kazimirov
30  *
31  */
32 
33 /// @file gridrpcclient.hpp
34 /// Classes pertaining to GRID-based ASN.1 RPC clients
35 
36 #include <corelib/ncbiobj.hpp>
37 #include <corelib/stream_utils.hpp>
38 #include <corelib/ncbiapp_api.hpp>
39 #include <serial/serial.hpp>
40 #include <serial/objistr.hpp>
41 #include <serial/objostr.hpp>
42 #include <serial/rpcbase.hpp>
47 #include <corelib/perf_log.hpp>
48 #include <corelib/rwstream.hpp>
49 #include <util/compress/lzo.hpp>
51 #include <util/compress/zlib.hpp>
52 
53 
55 
56 
57 ///
58 /// Traits class for binary ASN.1
59 ///
60 class CAsnBin
61 {
62 public:
63  /// Return the serialization type
64  ///
65  /// @return
66  /// data format enumeration
68  {
69  return eSerial_AsnBinary;
70  }
71 };
72 
73 ///
74 /// Traits class for compressed binary ASN.1 streams
75 ///
76 class CAsnBinCompressed : public CAsnBin
77 {
78 public:
79  using TOwnership = int;
80 
81  struct SStreamProp
82  {
84  : compress_method(comp_mthd)
85  {
86  }
87 
89  };
90 
91 
92  /// Return an object output stream (CObjectOStream)
93  ///
94  /// @param ostr
95  /// underlying output stream
96  /// @return
97  /// object stream
98  static unique_ptr<CObjectOStream>
100  {
101  unique_ptr<CCompressionOStream> outstr_zip(
103  ostr,
104  CreateStreamCompressor(stream_prop),
106  )
107  );
108  return unique_ptr<CObjectOStream>(CObjectOStream::Open(GetDataFormat(), *outstr_zip.release(), eTakeOwnership));
109  }
110 
111  /// Return an object input stream (CObjectIStream)
112  ///
113  /// @param istr
114  /// underlying input stream
115  /// @return
116  /// object stream
117  static unique_ptr<CObjectIStream>
119  {
120  return GetIStream(istr, GetIStreamProperties(istr));
121  }
122 
123  static unique_ptr<CObjectIStream>
124  GetIStream(const string& job_content, CNetCacheAPI& nc_api)
125  {
126  SStreamProp sp;
127  return GetIStream(job_content, nc_api, sp);
128  }
129 
130  static unique_ptr<CObjectIStream>
131  GetIStream(const string& job_content, CNetCacheAPI& nc_api, SStreamProp& streamprop)
132  {
133  auto rstr = GetRawIStream(job_content, nc_api, streamprop);
134  return GetIStream(*rstr.release(), streamprop, CCompressionStream::fOwnAll);
135  }
136 
137  static unique_ptr<CNcbiIstream>
138  GetRawIStream(const string& job_content, CNetCacheAPI& nc_api)
139  {
140  SStreamProp sp;
141  return GetRawIStream(job_content, nc_api, sp);
142  }
143 
144  static unique_ptr<CNcbiIstream>
145  GetRawIStream(const string& job_content, CNetCacheAPI& nc_api, SStreamProp& streamprop)
146  {
147  streamprop = GetJobStreamProperties(job_content, nc_api);
148  unique_ptr<CStringOrBlobStorageReader> reader(new CStringOrBlobStorageReader(job_content, nc_api));
149  unique_ptr<CNcbiIstream> rstr(new CRStream(reader.release(), 0, nullptr, CRWStreambuf::fOwnReader));
150  return rstr;
151  }
152 
153 protected:
154  static unique_ptr<CObjectIStream>
156  const SStreamProp& stream_prop,
158  )
159  {
160  unique_ptr<CCompressionIStream> instr_zip(
162  istr,
163  CreateStreamDecompressor(stream_prop),
164  ownership
165  )
166  );
167  return unique_ptr<CObjectIStream>(CObjectIStream::Open(GetDataFormat(), *instr_zip.release(), eTakeOwnership));
168  }
169 
170  static SStreamProp GetJobStreamProperties(const string& job_content, CNetCacheAPI& nc_api)
171  {
172  if (job_content.empty()) {
173  NCBI_THROW(CException, eUnknown, "job content is empty");
174  }
175  CStringOrBlobStorageReader reader(job_content, nc_api);
176  char buf[5];
177  size_t count = ArraySize(buf);
178  size_t bytes_read = 0UL;
179  reader.Read(buf, count, &bytes_read);
180  const bool is_lzo = IsLZOStream(CTempString(buf, bytes_read));
182  };
183 
184  static SStreamProp
186  {
188  }
189 
190  static bool IsLZOStream(CNcbiIstream& istr)
191  {
192  char buf[5];
193  const size_t buflen = ArraySize(buf);
194  const streamsize readlen = CStreamUtils::Readsome(istr, buf, buflen);
195  CStreamUtils::Stepback(istr, buf, readlen);
196  return IsLZOStream(CTempString(buf, readlen));
197  }
198 
199  static bool IsLZOStream(const CTempString& str)
200  {
201  /// LZO magic header (see fStreamFormat flag).
202  static const char kMagic[] = { 'L', 'Z', 'O', '\0' };
203  static const size_t kMagicSize = 4UL;
204  return (str.size() < kMagicSize)
205  ? false
207  }
208 
210  {
211  unique_ptr<CCompressionStreamProcessor> sp;
212  if (stream_prop.compress_method == CCompressStream::eLZO) {
213  sp.reset(new CLZOStreamCompressor());
214  }
215  else {
216  sp.reset(new CZipStreamCompressor());
217  }
218  return sp.release();
219  }
220 
222  {
223  unique_ptr<CCompressionStreamProcessor> sp;
224  if (stream_prop.compress_method == CCompressStream::eLZO) {
225  sp.reset(new CLZOStreamDecompressor());
226  }
227  else {
228  sp.reset(new CZipStreamDecompressor());
229  }
230  return sp.release();
231  }
232 
233  static string CompMethodToString(const CCompressStream::EMethod method)
234  {
235  switch (method) {
237  return "none";
239  return "BZip2";
241  return "LZO";
243  return "Zip";
245  return "GZipFile";
247  return "GZipFile";
249  return "ZStandard";
250  };
251  NCBI_THROW(CException, eUnknown, "unexpected compression method");
252  }
253 };
254 
255 
257 {
258 public:
259  enum EErrCode
260  {
261  eWaitTimeout, ///< timeout while waiting for job completion
263  };
264  virtual const char* GetErrCodeString(void) const override;
265 
267 };
268 
269 
270 ///
271 /// CGridRPCBaseClient<typename TConnectTraits>
272 ///
273 /// Base class for GRID-based ASN.1 RPC clients
274 ///
275 /// TConnectTraits template classes: CAsnBinCompressed
276 ///
277 template <typename TConnectTraits = CAsnBinCompressed, int DefaultTimeout = 20>
278 class CGridRPCBaseClient : protected TConnectTraits
279 {
280 public:
281  CGridRPCBaseClient(const string& NS_service,
282  const string& NS_queue,
283  const string& client_name,
284  const string& NC_registry_section
285  )
286  : m_NS_api(NS_service, client_name, NS_queue),
287  m_Timeout(DefaultTimeout)
288  {
289  x_Init(NC_registry_section);
290  }
291 
292  CGridRPCBaseClient(const string& NS_registry_section = "netschedule_api",
293  const string& NC_registry_section = kEmptyStr
294  )
295  : m_NS_api(CNetScheduleAPI::eAppRegistry, NS_registry_section),
296  m_Timeout(DefaultTimeout)
297  {
299  static const CNcbiRegistry& cfg = guard->GetConfig();
300  const string nc_reg(
301  NStr::IsBlank(NC_registry_section)
302  ? cfg.GetString(NS_registry_section, "netcache_api", "netcache_api")
303  : NC_registry_section
304  );
305  x_Init(nc_reg);
306  }
307 
308  /// Sets the request timeout (default is 20s)
309  ///
310  /// @param timeout
311  /// Timeout in seconds
312  void SetTimeout(const size_t timeout)
313  {
314  m_Timeout = timeout;
315  }
316 
317  void x_Init(const string& NC_registry_section)
318  {
319  m_NC_api = CNetCacheAPI(CNetCacheAPI::eAppRegistry, NC_registry_section);
320  }
321 
322  virtual ~CGridRPCBaseClient() = default;
323 
324  /// Sends an ASN.1 request, waiting specified time
325  ///
326  /// @param request
327  /// ASN.1 request, serialized from string
328  /// @param reply
329  /// ASN.1 reply, serialized to stream
330  /// @return
331  /// pair of CNetScheduleJob and boolean, indicating if the request timed out (always false)
332  /// @throws
333  /// CGridRPCBaseClientException::eUnexpectedFailure on error
334  /// CGridRPCBaseClientException::eWaitTimeout if the job didn't finish in the specified time
335  /// @note
336  /// The timeout can be set by using \link SetTimeout
337  pair<CNetScheduleJob, bool> AskStream(CNcbiIstream& request, CNcbiOstream& reply) const
338  {
339  CPerfLogGuard pl("CGridRPCBaseClient::AskStream");
340  CGridClient grid_cli(m_NS_api.GetSubmitter(),
341  m_NC_api,
344  );
345  auto& job_in = grid_cli.GetOStream(); // job input stream
346  NcbiStreamCopy(job_in, request);
347  if (job_in.bad()) {
348  NCBI_THROW(CIOException, eWrite, "Error while writing request");
349  }
350  grid_cli.CloseStream();
351 
352  CNetScheduleJob& job = grid_cli.GetJob();
353  x_PrepareJob(job);
354 
356  switch (evt) {
358  {
359  m_NS_api.GetJobDetails(job);
360  auto instr = TConnectTraits::GetRawIStream(job.output, m_NC_api);
361  NcbiStreamCopy(reply, *instr);
362  break;
363  }
365  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job failed");
366 
368  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job canceled");
369 
373  NCBI_THROW(CGridRPCBaseClientException, eWaitTimeout, "The job timed out");
374 
375  default:
377  eUnexpectedFailure,
378  "Unexpected status: " + CNetScheduleAPI::StatusToString(evt)
379  );
380  }
381 
383  return make_pair(job, false);
384  }
385 
386  /// Sends an ASN.1 request, waiting specified time
387  ///
388  /// @param request
389  /// ASN.1 request
390  /// @param reply
391  /// ASN.1 reply
392  /// @return
393  /// pair of CNetScheduleJob and boolean, indicating if the request timed out (always false)
394  /// @throws
395  /// CGridRPCBaseClientException::eUnexpectedFailure on error
396  /// CGridRPCBaseClientException::eWaitTimeout if the job didn't finish in the specified time
397  /// @note
398  /// The timeout can be set by using \link SetTimeout
399  template <class TRequest, class TReply>
400  pair<CNetScheduleJob, bool> Ask(const TRequest& request, TReply& reply) const
401  {
402  CPerfLogGuard pl("CGridRPCBaseClient::Ask");
403  CGridClient grid_cli(m_NS_api.GetSubmitter(),
404  m_NC_api,
407  );
408  auto& job_in = grid_cli.GetOStream(); // job input stream
409  auto outstr = TConnectTraits::GetOStream(job_in);
410  *outstr << request;
411  if (job_in.bad()) {
412  NCBI_THROW(CIOException, eWrite, "Error while writing request");
413  }
414  outstr.reset();
415  grid_cli.CloseStream();
416 
417  CNetScheduleJob& job = grid_cli.GetJob();
418  x_PrepareJob(job);
419 
421  switch (evt) {
423  {
424  m_NS_api.GetJobDetails(job);
425  auto instr = TConnectTraits::GetIStream(job.output, m_NC_api);
426  *instr >> reply;
427  break;
428  }
430  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job failed");
431 
433  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job canceled");
434 
438  NCBI_THROW(CGridRPCBaseClientException, eWaitTimeout, "The job timed out");
439 
440  default:
442  eUnexpectedFailure,
443  "Unexpected status: " + CNetScheduleAPI::StatusToString(evt)
444  );
445  }
446 
448  return make_pair(job, false);
449  }
450 
451 protected:
454  : m_NS_api(move(c.m_NS_api)), m_NC_api(move(c.m_NC_api)),
456  {
457  }
458 
459  virtual void x_PrepareJob(CNetScheduleJob& /*job*/) const
460  {
461  }
462 
463  template <class TReply>
464  CNetScheduleJob x_GetJobById(const string job_id, TReply& reply) const
465  {
466  CPerfLogGuard pl("CGridRPCBaseClient::x_GetJobById");
467  CNetScheduleJob job;
468  job.job_id = job_id;
469 
470  CNetScheduleSubmitter job_submitter = m_NS_api.GetSubmitter();
471  const CNetScheduleAPI::EJobStatus evt = job_submitter.WaitForJob(job.job_id, m_Timeout);
472  switch (evt) {
474  {
475  m_NS_api.GetJobDetails(job);
476  auto instr = TConnectTraits::GetIStream(job.output, m_NC_api);
477  *instr >> reply;
478  break;
479  }
481  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job failed");
482 
484  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job canceled");
485 
487  NCBI_THROW(CGridRPCBaseClientException, eUnexpectedFailure, "Job running");
488 
489  default:
491  eWaitTimeout,
492  "Unexpected status: " + CNetScheduleAPI::StatusToString(evt)
493  );
494  }
496  return job;
497  }
498 
499 private:
503 };
504 
505 
506 template <typename TRequest, typename TReply>
507 class CGridRPCHttpClient : public CRPCClient<TRequest, TReply>
508 {
509 protected:
511 
512 public:
513  CGridRPCHttpClient(const string& http_service)
514  : TParent(http_service)
515  {
516  }
517 
518  virtual ~CGridRPCHttpClient() = default;
519 
520 protected:
521  virtual void x_Connect() override
522  {
526  }
527 };
528 
529 
531 
532 #endif // OBJECTS_MISC_SERIAL___GRID_RPC_CLIENT__HPP
533 
Traits class for compressed binary ASN.1 streams.
static bool IsLZOStream(CNcbiIstream &istr)
static unique_ptr< CObjectIStream > GetIStream(const string &job_content, CNetCacheAPI &nc_api)
static bool IsLZOStream(const CTempString &str)
static unique_ptr< CNcbiIstream > GetRawIStream(const string &job_content, CNetCacheAPI &nc_api, SStreamProp &streamprop)
static unique_ptr< CObjectIStream > GetIStream(const string &job_content, CNetCacheAPI &nc_api, SStreamProp &streamprop)
static unique_ptr< CObjectOStream > GetOStream(CNcbiOstream &ostr, SStreamProp stream_prop=SStreamProp(CCompressStream::eZip))
Return an object output stream (CObjectOStream)
static unique_ptr< CObjectIStream > GetIStream(CNcbiIstream &istr)
Return an object input stream (CObjectIStream)
static CCompressionStreamProcessor * CreateStreamCompressor(const SStreamProp &stream_prop)
static CCompressionStreamProcessor * CreateStreamDecompressor(const SStreamProp &stream_prop)
static string CompMethodToString(const CCompressStream::EMethod method)
static unique_ptr< CNcbiIstream > GetRawIStream(const string &job_content, CNetCacheAPI &nc_api)
static SStreamProp GetJobStreamProperties(const string &job_content, CNetCacheAPI &nc_api)
static unique_ptr< CObjectIStream > GetIStream(CNcbiIstream &istr, const SStreamProp &stream_prop, TOwnership ownership=CCompressionStream::fOwnProcessor)
static SStreamProp GetIStreamProperties(CNcbiIstream &istr)
Traits class for binary ASN.1.
static ESerialDataFormat GetDataFormat(void)
Return the serialization type.
Grid Client (the submitter).
@ eWaitTimeout
timeout while waiting for job completion
virtual const char * GetErrCodeString(void) const override
Get error code interpreted as text.
NCBI_EXCEPTION_DEFAULT(CGridRPCBaseClientException, CException)
CGridRPCBaseClient<typename TConnectTraits>
CNetScheduleJob x_GetJobById(const string job_id, TReply &reply) const
virtual void x_PrepareJob(CNetScheduleJob &) const
pair< CNetScheduleJob, bool > AskStream(CNcbiIstream &request, CNcbiOstream &reply) const
Sends an ASN.1 request, waiting specified time.
CGridRPCBaseClient(const string &NS_service, const string &NS_queue, const string &client_name, const string &NC_registry_section)
void x_Init(const string &NC_registry_section)
void SetTimeout(const size_t timeout)
Sets the request timeout (default is 20s)
CGridRPCBaseClient(const string &NS_registry_section="netschedule_api", const string &NC_registry_section=kEmptyStr)
CGridRPCBaseClient(const CGridRPCBaseClient &)=delete
CNetCacheAPI m_NC_api
pair< CNetScheduleJob, bool > Ask(const TRequest &request, TReply &reply) const
Sends an ASN.1 request, waiting specified time.
CNetScheduleAPI m_NS_api
CGridRPCBaseClient(CGridRPCBaseClient &&c)
virtual ~CGridRPCBaseClient()=default
virtual void x_Connect() override
These run with m_Mutex already acquired.
virtual ~CGridRPCHttpClient()=default
CGridRPCHttpClient(const string &http_service)
CLZOStreamCompressor – lzo based compression stream processor.
Definition: lzo.hpp:772
CLZOStreamDecompressor – lzo based decompression stream processor.
Definition: lzo.hpp:824
CNcbiRegistry –.
Definition: ncbireg.hpp:913
Client API for NetCache server.
Client API for NCBI NetSchedule server.
Smart pointer to the job submission part of the NetSchedule API.
CPerfLogGuard –.
Definition: perf_log.hpp:252
CRPCClient – prototype client for ASN.1/XML-based RPC.
Definition: rpcbase.hpp:63
Note about the "buf_size" parameter for streams in this API.
Definition: rwstream.hpp:122
@ fOwnReader
Own the underlying reader.
Definition: rwstreambuf.hpp:66
String or Blob Storage Reader.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
CZipStreamCompressor – zlib based compression stream processor.
Definition: zlib.hpp:763
CZipStreamDecompressor – zlib based decompression stream processor.
Definition: zlib.hpp:817
const unsigned char kMagic[2]
#define false
Definition: bool.h:36
static const char * str(char *buf, int n)
Definition: stats.c:84
@ eWaitTimeout
Definition: grid_cli.hpp:231
NetSchedule Framework specs.
NetSchedule worker node application.
static CNcbiApplicationGuard InstanceGuard(void)
Singleton method.
Definition: ncbiapp.cpp:133
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
constexpr size_t ArraySize(const Element(&)[Size])
Definition: ncbimisc.hpp:1532
@ eTakeOwnership
An object can take ownership of another.
Definition: ncbi_types.h:136
EMethod
Compression/decompression methods.
Definition: stream_util.hpp:98
@ eZip
ZLIB (raw zip data / DEFLATE method)
@ eLZO
LZO (LZO1X)
@ eNone
no compression method (copy "as is")
Definition: stream_util.hpp:99
@ eZstd
ZStandard (raw zstd data)
@ eConcatenatedGZipFile
Synonym for eGZipFile (for backward compatibility) - deprecated.
@ eGZipFile
.gz file (including concatenated files)
void Post(CRequestStatus::ECode status, CTempString status_msg=CTempString())
Write the collected resource info and timing to the log.
Definition: perf_log.hpp:578
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
EErrCode
Error types that an application can generate.
Definition: ncbiexpt.hpp:884
unique_ptr< CObjectIStream > m_In
unique_ptr< CObjectOStream > m_Out
virtual void x_Connect(void) override
These run with m_Mutex already acquired.
Definition: rpcbase.hpp:199
unique_ptr< CNcbiIostream > m_Stream
ESerialDataFormat
Data file format.
Definition: serialdef.hpp:71
@ eSerial_AsnBinary
ASN.1 binary.
Definition: serialdef.hpp:74
EJobStatus
Job status codes.
CNetScheduleAPI::EJobStatus SubmitAndWait(unsigned wait_time)
Submit a job to the queue.
CNetScheduleSubmitter GetSubmitter()
Create an instance of CNetScheduleSubmitter.
string output
Job result data.
EJobStatus GetJobDetails(CNetScheduleJob &job, time_t *job_exptime=NULL, ENetScheduleQueuePauseMode *pause_mode=NULL)
Get job details.
void CloseStream()
Definition: grid_client.cpp:98
static string StatusToString(EJobStatus status)
Printable status type.
CNetScheduleAPI::EJobStatus WaitForJob(const string &job_id, unsigned wait_time)
Wait for job to finish its execution (done/failed/canceled).
CNetScheduleJob & GetJob()
CNcbiOstream & GetOStream()
Get a stream where a client can write an input data for the remote job.
Definition: grid_client.cpp:93
string job_id
Output job key.
@ eDone
Job is ready (computed successfully)
@ eReading
Job has its output been reading.
@ eCanceled
Explicitly canceled.
@ eRunning
Running on a worker node.
@ ePending
Waiting for execution.
@ eFailed
Failed to run (execution timeout)
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
Definition: objostr.cpp:126
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
Definition: objistr.cpp:195
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
virtual string GetString(const string &section, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
Definition: ncbireg.cpp:321
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
static void Stepback(CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size, void *del_ptr=0)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
static streamsize Readsome(CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size)
bool NcbiStreamCopy(CNcbiOstream &os, CNcbiIstream &is)
Copy the entire contents of stream "is" to stream "os".
Definition: ncbistre.cpp:211
#define kEmptyStr
Definition: ncbistr.hpp:123
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5386
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
char * buf
const size_t kMagicSize
Size of magic signature.
Definition: lzo.cpp:94
LZO Compression API.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Defines NCBI C++ API for timing-and-logging, classes, and macros.
Reader-writer based streams.
C++ I/O stream wrappers to compress/decompress data on-the-fly.
SStreamProp(const CCompressStream::EMethod comp_mthd=CCompressStream::eZip)
CCompressStream::EMethod compress_method
Job description.
unique_ptr< CObjectIStream > GetIStream(string path, ESerialDataFormat serial_format)
ZLib Compression API.
Modified on Tue Jul 23 17:50:04 2024 by modify_doxy.py rev. 669887