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

Go to the SVN repository for this file.

1 #ifndef PUBSEQ_GATEWAY_ID2INFO__HPP
2 #define PUBSEQ_GATEWAY_ID2INFO__HPP
3 
4 /* $Id: id2info.hpp 91379 2020-10-21 15:00:25Z satskyse $
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: Sergey Satskiy
30  *
31  * File Description:
32  * PSG ID2 info wrapper
33  *
34  */
35 
36 #include "cass_blob_id.hpp"
37 
38 #include <string>
39 using namespace std;
40 
41 
42 const int64_t kSplitInfoChunk = 999999999;
43 
44 
45 // There could be many ID2INFO flavors
50 };
51 
52 
53 // May be found in cassandra
55 {
56  public:
57  using TSat = int16_t;
58  using TInfo = int32_t;
59  using TChunks = int32_t;
61 
62  public:
63  CPSGS_SatInfoChunksVerFlavorId2Info(const string & id2_info,
64  bool count_errors = true);
66  m_Sat(-1), m_Info(-1), m_Chunks(-1),
67  m_SplitVersion(-1), m_SplitVersionPresent(false)
68  {}
69 
70  public:
71  TSat GetSat(void) const
72  { return m_Sat; }
73 
74  TInfo GetInfo(void) const
75  { return m_Info; }
76 
77  TChunks GetChunks(void) const
78  { return m_Chunks; }
79 
81  { return m_SplitVersion; }
82 
83  string Serialize(void) const;
84 
85  private:
91 };
92 
93 
94 // May come in the URL
96 {
97  public:
100 
101  public:
102  CPSGS_IdModifiedVerFlavorId2Info(const string & id2_info);
104  m_LastModified(-1), m_SplitVersion(-1),
105  m_LastModifiedPresent(false),
106  m_SplitVersionPresent(false)
107  {}
108 
109  public:
111  { return m_TSEId; }
112 
114  { return m_LastModified; }
115 
117  { return m_SplitVersion; }
118 
119  string Serialize(void) const;
120 
121  private:
127 };
128 
129 #endif /* PUBSEQ_GATEWAY_ID2INFO__HPP */
130 
TLastModified GetLastModified(void) const
Definition: id2info.hpp:113
TSplitVersion GetSplitVersion(void) const
Definition: id2info.hpp:116
SCass_BlobId & GetTSEId(void)
Definition: id2info.hpp:110
TSplitVersion GetSplitVersion(void) const
Definition: id2info.hpp:80
TChunks GetChunks(void) const
Definition: id2info.hpp:77
#define false
Definition: bool.h:36
Int4 int32_t
Int2 int16_t
Int8 int64_t
const int64_t kSplitInfoChunk
Definition: id2info.hpp:42
EPSGSId2InfoFlavor
Definition: id2info.hpp:46
@ ePSGS_UnknownId2InfoFlavor
Definition: id2info.hpp:49
@ ePSGS_IdModifiedVerId2InfoFlavor
Definition: id2info.hpp:48
@ ePSGS_SatInfoChunksVerId2InfoFlavor
Definition: id2info.hpp:47
void Serialize(CNcbiOstream &, const CRawScoreVector< Key, Score > &)
Generics These throw an exception; we must implement serialization for each type.
Modified on Thu Apr 11 15:14:19 2024 by modify_doxy.py rev. 669887