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

Go to the SVN repository for this file.

1 /*****************************************************************************
2  * $Id: record.hpp 95682 2021-12-08 18:46:31Z saprykin $
3  * ===========================================================================
4  *
5  * PUBLIC DOMAIN NOTICE
6  * National Center for Biotechnology Information
7  *
8  * This software/database is a "United States Government Work" under the
9  * terms of the United States Copyright Act. It was written as part of
10  * the author's official duties as a United States Government employee and
11  * thus cannot be copyrighted. This software/database is freely available
12  * to the public for use. The National Library of Medicine and the U.S.
13  * Government have not placed any restriction on its use or reproduction.
14  *
15  * Although all reasonable efforts have been taken to ensure the accuracy
16  * and reliability of the software and data, the NLM and the U.S.
17  * Government do not and cannot warrant the performance or results that
18  * may be obtained by using this software or data. The NLM and the U.S.
19  * Government disclaim all warranties, express or implied, including
20  * warranties of performance, merchantability or fitness for any particular
21  * purpose.
22  *
23  * Please cite the author in any work or product based on this material.
24  *
25  * Blob storage: si2csi record
26  *
27  *****************************************************************************/
28 
29 #ifndef OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__SI2CSI__RECORD_HPP
30 #define OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__SI2CSI__RECORD_HPP
31 
32 #include <corelib/ncbistd.hpp>
34 
35 #include <algorithm>
36 #include <memory>
37 #include <set>
38 #include <string>
39 #include <tuple>
40 #include <utility>
41 #include <vector>
42 
43 #include "../IdCassScope.hpp"
44 
47 
49 {
50  public:
51  using TSecSeqId = string;
53 
54  using TAccession = string;
55  using TGI = int64_t;
58  using TVersion = int16_t;
60 
62  m_SecSeqIdType(-1),
63  m_GI(-1),
64  m_SecSeqState(-1),
65  m_SeqIdType(-1),
66  m_Version(-1),
67  m_Writetime(-1)
68  {}
69 
70  CSI2CSIRecord(CSI2CSIRecord const &) = default;
72  CSI2CSIRecord & operator=(CSI2CSIRecord const &) = default;
74 
75  // Setters
77  {
78  m_SecSeqId = value;
79  return *this;
80  }
81 
83  {
85  return *this;
86  }
87 
89  {
91  return *this;
92  }
93 
95  {
96  m_GI = value;
97  return *this;
98  }
99 
101  {
103  return *this;
104  }
105 
107  {
108  m_SeqIdType = value;
109  return *this;
110  }
111 
113  {
114  m_Version = value;
115  return *this;
116  }
117 
119  {
120  m_Writetime = value;
121  return *this;
122  }
123 
124 
125  // Getters
126  TSecSeqId const & GetSecSeqId() const
127  {
128  return m_SecSeqId;
129  }
130 
132  {
133  return m_SecSeqIdType;
134  }
135 
136  TAccession const & GetAccession() const
137  {
138  return m_Accession;
139  }
140 
141  TGI GetGI() const
142  {
143  return m_GI;
144  }
145 
147  {
148  return m_SecSeqState;
149  }
150 
152  {
153  return m_SeqIdType;
154  }
155 
157  {
158  return m_Version;
159  }
160 
162  {
163  return m_Writetime;
164  }
165 
166  string ToString() const;
167 
168  private:
171 
178 };
179 
180 using TSI2CSIConsumeCallback = function<void(vector<CSI2CSIRecord> &&)>;
181 
183 
184 #endif // OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__SI2CSI__RECORD_HPP
#define END_IDBLOB_SCOPE
Definition: IdCassScope.hpp:40
#define BEGIN_IDBLOB_SCOPE
Definition: IdCassScope.hpp:39
BEGIN_IDBLOB_SCOPE USING_NCBI_SCOPE
Definition: record.hpp:45
CSI2CSIRecord & SetSeqIdType(TSeqIdType value)
Definition: record.hpp:106
TSecSeqId m_SecSeqId
Definition: record.hpp:169
CSI2CSIRecord & SetGI(TGI value)
Definition: record.hpp:94
string TAccession
Definition: record.hpp:54
int16_t TSeqIdType
Definition: record.hpp:57
CSI2CSIRecord & SetAccession(const TAccession &value)
Definition: record.hpp:88
int16_t TSecSeqIdType
Definition: record.hpp:52
string ToString() const
Definition: record.cpp:43
TSecSeqIdType m_SecSeqIdType
Definition: record.hpp:170
CSI2CSIRecord(CSI2CSIRecord &&)=default
TAccession m_Accession
Definition: record.hpp:172
CSI2CSIRecord & operator=(CSI2CSIRecord const &)=default
int64_t TGI
Definition: record.hpp:55
CSI2CSIRecord & SetSecSeqState(TSecSeqState value)
Definition: record.hpp:100
int16_t TVersion
Definition: record.hpp:58
CSI2CSIRecord & operator=(CSI2CSIRecord &&)=default
CSI2CSIRecord & SetSecSeqId(const TSecSeqId &value)
Definition: record.hpp:76
string TSecSeqId
Definition: record.hpp:51
TSecSeqId const & GetSecSeqId() const
Definition: record.hpp:126
CSI2CSIRecord(CSI2CSIRecord const &)=default
TAccession const & GetAccession() const
Definition: record.hpp:136
TVersion GetVersion() const
Definition: record.hpp:156
TSeqIdType GetSeqIdType() const
Definition: record.hpp:151
int64_t TWritetime
Definition: record.hpp:59
TGI GetGI() const
Definition: record.hpp:141
TSecSeqState m_SecSeqState
Definition: record.hpp:174
CSI2CSIRecord & SetWritetime(TWritetime value)
Definition: record.hpp:118
TSeqIdType m_SeqIdType
Definition: record.hpp:175
int8_t TSecSeqState
Definition: record.hpp:56
TWritetime m_Writetime
Definition: record.hpp:177
CSI2CSIRecord & SetVersion(TVersion value)
Definition: record.hpp:112
CSI2CSIRecord & SetSecSeqIdType(TSecSeqIdType value)
Definition: record.hpp:82
TSecSeqIdType GetSecSeqIdType() const
Definition: record.hpp:131
TWritetime GetWritetime() const
Definition: record.hpp:161
TSecSeqState GetSecSeqState() const
Definition: record.hpp:146
TVersion m_Version
Definition: record.hpp:176
Include a standard set of the NCBI C++ Toolkit most basic headers.
Int2 int16_t
Int8 int64_t
signed char int8_t
string
Definition: cgiapp.hpp:687
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Defines CRequestStatus class for NCBI C++ diagnostic API.
function< void(vector< CSI2CSIRecord > &&)> TSI2CSIConsumeCallback
Definition: record.hpp:180
Modified on Fri Apr 12 17:22:39 2024 by modify_doxy.py rev. 669887