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

Go to the SVN repository for this file.

1 /* $Id$
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  */
27 
28 /// @file Seq_table_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqtable/seqtable.asn">seqtable.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqtable/seqtable.def">seqtable.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef OBJECTS_SEQTABLE_SEQ_TABLE_BASE_HPP
42 #define OBJECTS_SEQTABLE_SEQ_TABLE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CSeqTable_column;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_SeqTable
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CSeq_table_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CSeq_table_Base(void);
82  // destructor
83  virtual ~CSeq_table_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TFeat_type;
90  typedef int TFeat_subtype;
91  typedef int TNum_rows;
92  typedef vector< CRef< CSeqTable_column > > TColumns;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_feat_type,
98  e_feat_subtype,
99  e_num_rows,
100  e_columns
101  };
103 
104  // getters
105  // setters
106 
107  /// type of features in this table, equal to Seq-feat.data variant index
108  /// Check if a value has been assigned to Feat_type data member.
109  ///
110  /// Data member Feat_type is mandatory;
111  /// its type is defined as 'typedef int TFeat_type'
112  /// @return
113  /// - true, if a value has been assigned.
114  /// - false, otherwise.
115  bool IsSetFeat_type(void) const;
116 
117  /// Check if it is safe to call GetFeat_type method.
118  ///
119  /// @return
120  /// - true, if the data member is getatable.
121  /// - false, otherwise.
122  bool CanGetFeat_type(void) const;
123 
124  /// Reset Feat_type data member.
125  void ResetFeat_type(void);
126 
127  /// Get the Feat_type member data.
128  ///
129  /// @return
130  /// Copy of the member data.
131  TFeat_type GetFeat_type(void) const;
132 
133  /// Assign a value to Feat_type data member.
134  ///
135  /// @param value
136  /// Value to assign
137  void SetFeat_type(TFeat_type value);
138 
139  /// Assign a value to Feat_type data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TFeat_type& SetFeat_type(void);
144 
145  /// subtype of features in this table, defined in header SeqFeatData.hpp
146  /// Check if a value has been assigned to Feat_subtype data member.
147  ///
148  /// Data member Feat_subtype is optional;
149  /// its type is defined as 'typedef int TFeat_subtype'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetFeat_subtype(void) const;
154 
155  /// Check if it is safe to call GetFeat_subtype method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetFeat_subtype(void) const;
161 
162  /// Reset Feat_subtype data member.
163  void ResetFeat_subtype(void);
164 
165  /// Get the Feat_subtype member data.
166  ///
167  /// @return
168  /// Copy of the member data.
169  TFeat_subtype GetFeat_subtype(void) const;
170 
171  /// Assign a value to Feat_subtype data member.
172  ///
173  /// @param value
174  /// Value to assign
175  void SetFeat_subtype(TFeat_subtype value);
176 
177  /// Assign a value to Feat_subtype data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TFeat_subtype& SetFeat_subtype(void);
182 
183  /// number of rows
184  /// Check if a value has been assigned to Num_rows data member.
185  ///
186  /// Data member Num_rows is mandatory;
187  /// its type is defined as 'typedef int TNum_rows'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetNum_rows(void) const;
192 
193  /// Check if it is safe to call GetNum_rows method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetNum_rows(void) const;
199 
200  /// Reset Num_rows data member.
201  void ResetNum_rows(void);
202 
203  /// Get the Num_rows member data.
204  ///
205  /// @return
206  /// Copy of the member data.
207  TNum_rows GetNum_rows(void) const;
208 
209  /// Assign a value to Num_rows data member.
210  ///
211  /// @param value
212  /// Value to assign
213  void SetNum_rows(TNum_rows value);
214 
215  /// Assign a value to Num_rows data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TNum_rows& SetNum_rows(void);
220 
221  /// data in columns
222  /// Check if a value has been assigned to Columns data member.
223  ///
224  /// Data member Columns is mandatory;
225  /// its type is defined as 'typedef vector< CRef< CSeqTable_column > > TColumns'
226  /// @return
227  /// - true, if a value has been assigned.
228  /// - false, otherwise.
229  bool IsSetColumns(void) const;
230 
231  /// Check if it is safe to call GetColumns method.
232  ///
233  /// @return
234  /// - true, if the data member is getatable.
235  /// - false, otherwise.
236  bool CanGetColumns(void) const;
237 
238  /// Reset Columns data member.
239  void ResetColumns(void);
240 
241  /// Get the Columns member data.
242  ///
243  /// @return
244  /// Reference to the member data.
245  const TColumns& GetColumns(void) const;
246 
247  /// Assign a value to Columns data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TColumns& SetColumns(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
263  Uint4 m_set_State[1];
267  vector< CRef< CSeqTable_column > > m_Columns;
268 };
269 
270 /* @} */
271 
272 
273 
274 
275 
276 ///////////////////////////////////////////////////////////
277 ///////////////////// inline methods //////////////////////
278 ///////////////////////////////////////////////////////////
279 inline
281 {
282  return ((m_set_State[0] & 0x3) != 0);
283 }
284 
285 inline
287 {
288  return IsSetFeat_type();
289 }
290 
291 inline
293 {
294  m_Feat_type = 0;
295  m_set_State[0] &= ~0x3;
296 }
297 
298 inline
300 {
301  if (!CanGetFeat_type()) {
302  ThrowUnassigned(0);
303  }
304  return m_Feat_type;
305 }
306 
307 inline
309 {
310  m_Feat_type = value;
311  m_set_State[0] |= 0x3;
312 }
313 
314 inline
316 {
317 #ifdef _DEBUG
318  if (!IsSetFeat_type()) {
319  memset(&m_Feat_type,UnassignedByte(),sizeof(m_Feat_type));
320  }
321 #endif
322  m_set_State[0] |= 0x1;
323  return m_Feat_type;
324 }
325 
326 inline
328 {
329  return ((m_set_State[0] & 0xc) != 0);
330 }
331 
332 inline
334 {
335  return IsSetFeat_subtype();
336 }
337 
338 inline
340 {
341  m_Feat_subtype = 0;
342  m_set_State[0] &= ~0xc;
343 }
344 
345 inline
347 {
348  if (!CanGetFeat_subtype()) {
349  ThrowUnassigned(1);
350  }
351  return m_Feat_subtype;
352 }
353 
354 inline
356 {
358  m_set_State[0] |= 0xc;
359 }
360 
361 inline
363 {
364 #ifdef _DEBUG
365  if (!IsSetFeat_subtype()) {
366  memset(&m_Feat_subtype,UnassignedByte(),sizeof(m_Feat_subtype));
367  }
368 #endif
369  m_set_State[0] |= 0x4;
370  return m_Feat_subtype;
371 }
372 
373 inline
375 {
376  return ((m_set_State[0] & 0x30) != 0);
377 }
378 
379 inline
381 {
382  return IsSetNum_rows();
383 }
384 
385 inline
387 {
388  m_Num_rows = 0;
389  m_set_State[0] &= ~0x30;
390 }
391 
392 inline
394 {
395  if (!CanGetNum_rows()) {
396  ThrowUnassigned(2);
397  }
398  return m_Num_rows;
399 }
400 
401 inline
403 {
404  m_Num_rows = value;
405  m_set_State[0] |= 0x30;
406 }
407 
408 inline
410 {
411 #ifdef _DEBUG
412  if (!IsSetNum_rows()) {
413  memset(&m_Num_rows,UnassignedByte(),sizeof(m_Num_rows));
414  }
415 #endif
416  m_set_State[0] |= 0x10;
417  return m_Num_rows;
418 }
419 
420 inline
422 {
423  return ((m_set_State[0] & 0xc0) != 0);
424 }
425 
426 inline
428 {
429  return true;
430 }
431 
432 inline
434 {
435  return m_Columns;
436 }
437 
438 inline
440 {
441  m_set_State[0] |= 0x40;
442  return m_Columns;
443 }
444 
445 ///////////////////////////////////////////////////////////
446 ////////////////// end of inline methods //////////////////
447 ///////////////////////////////////////////////////////////
448 
449 
450 
451 
452 
453 END_objects_SCOPE // namespace ncbi::objects::
454 
456 
457 
458 #endif // OBJECTS_SEQTABLE_SEQ_TABLE_BASE_HPP
CSeq_table_Base –.
Definition: Seq_table_.hpp:77
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_SEQ_EXPORT
Definition: ncbi_export.h:825
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Seq_table_.hpp:102
const TColumns & GetColumns(void) const
Get the Columns member data.
Definition: Seq_table_.hpp:433
void ResetFeat_type(void)
Reset Feat_type data member.
Definition: Seq_table_.hpp:292
bool IsSetFeat_subtype(void) const
subtype of features in this table, defined in header SeqFeatData.hpp Check if a value has been assign...
Definition: Seq_table_.hpp:327
void ResetFeat_subtype(void)
Reset Feat_subtype data member.
Definition: Seq_table_.hpp:339
TNum_rows & SetNum_rows(void)
Assign a value to Num_rows data member.
Definition: Seq_table_.hpp:409
TFeat_type GetFeat_type(void) const
Get the Feat_type member data.
Definition: Seq_table_.hpp:299
bool IsSetNum_rows(void) const
number of rows Check if a value has been assigned to Num_rows data member.
Definition: Seq_table_.hpp:374
bool CanGetNum_rows(void) const
Check if it is safe to call GetNum_rows method.
Definition: Seq_table_.hpp:380
TFeat_type & SetFeat_type(void)
Assign a value to Feat_type data member.
Definition: Seq_table_.hpp:315
TFeat_subtype GetFeat_subtype(void) const
Get the Feat_subtype member data.
Definition: Seq_table_.hpp:346
Uint4 m_set_State[1]
Definition: Seq_table_.hpp:263
vector< CRef< CSeqTable_column > > TColumns
Definition: Seq_table_.hpp:92
vector< CRef< CSeqTable_column > > m_Columns
Definition: Seq_table_.hpp:267
void ResetNum_rows(void)
Reset Num_rows data member.
Definition: Seq_table_.hpp:386
CSeq_table_Base & operator=(const CSeq_table_Base &)
TNum_rows GetNum_rows(void) const
Get the Num_rows member data.
Definition: Seq_table_.hpp:393
bool CanGetColumns(void) const
Check if it is safe to call GetColumns method.
Definition: Seq_table_.hpp:427
bool CanGetFeat_subtype(void) const
Check if it is safe to call GetFeat_subtype method.
Definition: Seq_table_.hpp:333
TFeat_subtype & SetFeat_subtype(void)
Assign a value to Feat_subtype data member.
Definition: Seq_table_.hpp:362
bool IsSetColumns(void) const
data in columns Check if a value has been assigned to Columns data member.
Definition: Seq_table_.hpp:421
CSerialObject Tparent
Definition: Seq_table_.hpp:78
TColumns & SetColumns(void)
Assign a value to Columns data member.
Definition: Seq_table_.hpp:439
CSeq_table_Base(const CSeq_table_Base &)
bool IsSetFeat_type(void) const
type of features in this table, equal to Seq-feat.data variant index Check if a value has been assign...
Definition: Seq_table_.hpp:280
bool CanGetFeat_type(void) const
Check if it is safe to call GetFeat_type method.
Definition: Seq_table_.hpp:286
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:52 2024 by modify_doxy.py rev. 669887