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

Go to the SVN repository for this file.

1 #ifndef SPLIT_INFO_UTILS__HPP
2 #define SPLIT_INFO_UTILS__HPP
3 
4 /* $Id: split_info_utils.hpp 95558 2021-11-24 19:04:09Z vasilche $
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: Eugene Vasilchenko
30  *
31  * File Description: ID2 split-info processing utilities
32  *
33  *
34  */
35 
36 #include <corelib/ncbistd.hpp>
37 #include <corelib/ncbiobj.hpp>
39 
41 
43 
44 class CSeq_id;
45 class CID2S_Split_Info;
46 
48 
50 
53 
55 {
56 public:
59 
60  void AddDataChunk(const unsigned char * data,
61  unsigned int size,
62  int chunk_no);
63 
65 
67 
68  void SetGzip(bool gzip)
69  {
70  m_Gzip = gzip;
71  }
72  bool IsGzip() const
73  {
74  return m_Gzip;
75  }
76 
77 private:
79  unique_ptr<CNcbiIstream> m_Stream;
80  bool m_Gzip;
81 };
82 
83 vector<int> GetBioseqChunks(const CSeq_id& seq_id,
84  const CID2S_Split_Info& split_info);
85 
86 vector<int> GetBioseqChunks(const CSeq_id& seq_id,
87  const CBlobRecord& blob,
88  const unsigned char * data,
89  unsigned int size,
90  int chunk_no);
91 
94 
95 #endif // SPLIT_INFO_UTILS__HPP
map< int, vector< char > > m_Chunks
void SetGzip(bool gzip)
CRef< CID2S_Split_Info > DeserializeSplitInfo()
void AddDataChunk(const unsigned char *data, unsigned int size, int chunk_no)
CNcbiIstream & GetStream()
unique_ptr< CNcbiIstream > m_Stream
CID2S_Split_Info –.
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
char data[12]
Definition: iconv.c:80
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
const struct ncbi::grid::netcache::search::fields::SIZE size
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
USING_SCOPE(objects)
BEGIN_NAMESPACE(objects)
vector< int > GetBioseqChunks(const CSeq_id &seq_id, const CID2S_Split_Info &split_info)
USING_IDBLOB_SCOPE
END_NCBI_NAMESPACE
END_NAMESPACE(objects)
BEGIN_NCBI_NAMESPACE
Modified on Mon May 27 04:35:24 2024 by modify_doxy.py rev. 669887