NCBI C++ ToolKit
SeqTable_column.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: SeqTable_column.cpp 66087 2015-01-29 19:26:03Z vasilche $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using the following specifications:
34  * 'seqtable.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
49 
50 // generated classes
51 
53 
54 BEGIN_objects_SCOPE // namespace ncbi::objects::
55 
56 // destructor
58 {
59 }
60 
61 
62 bool CSeqTable_column::IsSet(size_t row) const
63 {
64  size_t index = row;
65  if ( IsSetSparse() ) {
66  index = GetSparse().GetIndexAt(row);
67  if ( index == CSeqTable_sparse_index::kSkipped ) {
68  return IsSetSparse_other();
69  }
70  }
71  if ( IsSetData() && GetData().IsSet(index) ) {
72  return true;
73  }
74  return IsSetDefault();
75 }
76 
77 
78 const string* CSeqTable_column::GetStringPtr(size_t row) const
79 {
80  size_t index = row;
81  if ( IsSetSparse() ) {
82  index = GetSparse().GetIndexAt(row);
83  if ( index == CSeqTable_sparse_index::kSkipped ) {
84  if ( IsSetSparse_other() ) {
85  return &GetSparse_other().GetString();
86  }
87  return 0;
88  }
89  }
90  if ( IsSetData() ) {
91  if ( const string* ret = GetData().GetStringPtr(index) ) {
92  return ret;
93  }
94  }
95  if ( IsSetDefault() ) {
96  return &GetDefault().GetString();
97  }
98  return 0;
99 }
100 
101 
102 const vector<char>* CSeqTable_column::GetBytesPtr(size_t row) const
103 {
104  size_t index = row;
105  if ( IsSetSparse() ) {
106  index = GetSparse().GetIndexAt(row);
107  if ( index == CSeqTable_sparse_index::kSkipped ) {
108  if ( IsSetSparse_other() ) {
109  return &GetSparse_other().GetBytes();
110  }
111  return 0;
112  }
113  }
114  if ( IsSetData() ) {
115  if ( const vector<char>* ret = GetData().GetBytesPtr(index) ) {
116  return ret;
117  }
118  }
119  if ( IsSetDefault() ) {
120  return &GetDefault().GetBytes();
121  }
122  return 0;
123 }
124 
125 
127 {
128  size_t index = row;
129  if ( IsSetSparse() ) {
130  index = GetSparse().GetIndexAt(row);
131  if ( index == CSeqTable_sparse_index::kSkipped ) {
132  if ( IsSetSparse_other() ) {
133  return ConstRef(&GetSparse_other().GetId());
134  }
135  return null;
136  }
137  }
138  if ( IsSetData() ) {
140  if ( index < arr.size() ) {
141  return arr[index];
142  }
143  }
144  if ( IsSetDefault() ) {
145  return ConstRef(&GetDefault().GetId());
146  }
147  return null;
148 }
149 
150 
152 {
153  size_t index = row;
154  if ( IsSetSparse() ) {
155  index = GetSparse().GetIndexAt(row);
156  if ( index == CSeqTable_sparse_index::kSkipped ) {
157  if ( IsSetSparse_other() ) {
158  return ConstRef(&GetSparse_other().GetLoc());
159  }
160  return null;
161  }
162  }
163  if ( IsSetData() ) {
165  if ( index < arr.size() ) {
166  return arr[index];
167  }
168  }
169  if ( IsSetDefault() ) {
170  return ConstRef(&GetDefault().GetLoc());
171  }
172  return null;
173 }
174 
175 
177 {
178  size_t index = row;
179  if ( IsSetSparse() ) {
180  index = GetSparse().GetIndexAt(row);
181  if ( index == CSeqTable_sparse_index::kSkipped ) {
182  if ( IsSetSparse_other() ) {
183  return ConstRef(&GetSparse_other().GetInterval());
184  }
185  return null;
186  }
187  }
188  if ( IsSetData() ) {
190  if ( index < arr.size() ) {
191  return arr[index];
192  }
193  }
194  if ( IsSetDefault() ) {
195  return ConstRef(&GetDefault().GetInterval());
196  }
197  return null;
198 }
199 
200 
201 END_objects_SCOPE // namespace ncbi::objects::
202 
204 
205 /* Original file checksum: lines: 57, chars: 1744, CRC32: d04e9b34 */
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
const vector< char > * GetBytesPtr(size_t row) const
CConstRef< CSeq_interval > GetSeq_int(size_t row) const
const string * GetStringPtr(size_t row) const
CConstRef< CSeq_id > GetSeq_id(size_t row) const
CConstRef< CSeq_loc > GetSeq_loc(size_t row) const
bool IsSet(size_t row) const
static const size_t kSkipped
size_t GetIndexAt(size_t row) const
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const TDefault & GetDefault(void) const
Get the Default member data.
const TSparse_other & GetSparse_other(void) const
Get the Sparse_other member data.
const TSparse & GetSparse(void) const
Get the Sparse member data.
const TString & GetString(void) const
Get the variant data.
const TInterval & GetInterval(void) const
Get the variant data.
bool IsSetSparse_other(void) const
single value for indexes not listed in sparse table Check if a value has been assigned to Sparse_othe...
vector< CRef< CSeq_loc > > TLoc
const TLoc & GetLoc(void) const
Get the variant data.
vector< CRef< CSeq_id > > TId
bool IsSetData(void) const
row data Check if a value has been assigned to Data data member.
bool IsSetSparse(void) const
in case not all rows contain data this field will contain sparse info Check if a value has been assig...
const TBytes & GetBytes(void) const
Get the variant data.
vector< CRef< CSeq_interval > > TInterval
const TData & GetData(void) const
Get the Data member data.
bool IsSetDefault(void) const
default value for sparse table, or if row data is too short Check if a value has been assigned to Def...
const TId & GetId(void) const
Get the variant data.
int GetLoc(const string &acc, const string &pat, CSeq_loc &loc, CScope &scope)
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Fri Apr 26 16:23:18 2024 by modify_doxy.py rev. 669887