NCBI C++ ToolKit
SeqTable_column_.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 SeqTable_column_.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_SEQTABLE_COLUMN_BASE_HPP
42 #define OBJECTS_SEQTABLE_SEQTABLE_COLUMN_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
60 
61 
62 // generated classes
63 
64 
65 /** @addtogroup dataspec_NCBI_SeqTable
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// CSeqTable_column_Base --
73 ///
74 
76 {
78 public:
79  // constructor
81  // destructor
82  virtual ~CSeqTable_column_Base(void);
83 
84  // type info
86 
87  // types
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_header,
98  e_data,
99  e_sparse,
100  e_default,
101  e_sparse_other
102  };
104 
105  // getters
106  // setters
107 
108  /// column description or reference to previously defined info
109  /// information about data
110  /// Check if a value has been assigned to Header data member.
111  ///
112  /// Data member Header is mandatory;
113  /// its type is defined as 'typedef CSeqTable_column_info THeader'
114  /// @return
115  /// - true, if a value has been assigned.
116  /// - false, otherwise.
117  bool IsSetHeader(void) const;
118 
119  /// Check if it is safe to call GetHeader method.
120  ///
121  /// @return
122  /// - true, if the data member is getatable.
123  /// - false, otherwise.
124  bool CanGetHeader(void) const;
125 
126  /// Reset Header data member.
127  void ResetHeader(void);
128 
129  /// Get the Header member data.
130  ///
131  /// @return
132  /// Reference to the member data.
133  const THeader& GetHeader(void) const;
134 
135  /// Assign a value to Header data member.
136  ///
137  /// @param value
138  /// Reference to value.
139  void SetHeader(THeader& value);
140 
141  /// Assign a value to Header data member.
142  ///
143  /// @return
144  /// Reference to the data value.
145  THeader& SetHeader(void);
146 
147  /// row data
148  /// Check if a value has been assigned to Data data member.
149  ///
150  /// Data member Data is optional;
151  /// its type is defined as 'typedef CSeqTable_multi_data TData'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetData(void) const;
156 
157  /// Check if it is safe to call GetData method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetData(void) const;
163 
164  /// Reset Data data member.
165  void ResetData(void);
166 
167  /// Get the Data member data.
168  ///
169  /// @return
170  /// Reference to the member data.
171  const TData& GetData(void) const;
172 
173  /// Assign a value to Data data member.
174  ///
175  /// @param value
176  /// Reference to value.
177  void SetData(TData& value);
178 
179  /// Assign a value to Data data member.
180  ///
181  /// @return
182  /// Reference to the data value.
183  TData& SetData(void);
184 
185  /// in case not all rows contain data this field will contain sparse info
186  /// Check if a value has been assigned to Sparse data member.
187  ///
188  /// Data member Sparse is optional;
189  /// its type is defined as 'typedef CSeqTable_sparse_index TSparse'
190  /// @return
191  /// - true, if a value has been assigned.
192  /// - false, otherwise.
193  bool IsSetSparse(void) const;
194 
195  /// Check if it is safe to call GetSparse method.
196  ///
197  /// @return
198  /// - true, if the data member is getatable.
199  /// - false, otherwise.
200  bool CanGetSparse(void) const;
201 
202  /// Reset Sparse data member.
203  void ResetSparse(void);
204 
205  /// Get the Sparse member data.
206  ///
207  /// @return
208  /// Reference to the member data.
209  const TSparse& GetSparse(void) const;
210 
211  /// Assign a value to Sparse data member.
212  ///
213  /// @param value
214  /// Reference to value.
215  void SetSparse(TSparse& value);
216 
217  /// Assign a value to Sparse data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TSparse& SetSparse(void);
222 
223  /// default value for sparse table, or if row data is too short
224  /// Check if a value has been assigned to Default data member.
225  ///
226  /// Data member Default is optional;
227  /// its type is defined as 'typedef CSeqTable_single_data TDefault'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetDefault(void) const;
232 
233  /// Check if it is safe to call GetDefault method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetDefault(void) const;
239 
240  /// Reset Default data member.
241  void ResetDefault(void);
242 
243  /// Get the Default member data.
244  ///
245  /// @return
246  /// Reference to the member data.
247  const TDefault& GetDefault(void) const;
248 
249  /// Assign a value to Default data member.
250  ///
251  /// @param value
252  /// Reference to value.
253  void SetDefault(TDefault& value);
254 
255  /// Assign a value to Default data member.
256  ///
257  /// @return
258  /// Reference to the data value.
259  TDefault& SetDefault(void);
260 
261  /// single value for indexes not listed in sparse table
262  /// Check if a value has been assigned to Sparse_other data member.
263  ///
264  /// Data member Sparse_other is optional;
265  /// its type is defined as 'typedef CSeqTable_single_data TSparse_other'
266  /// @return
267  /// - true, if a value has been assigned.
268  /// - false, otherwise.
269  bool IsSetSparse_other(void) const;
270 
271  /// Check if it is safe to call GetSparse_other method.
272  ///
273  /// @return
274  /// - true, if the data member is getatable.
275  /// - false, otherwise.
276  bool CanGetSparse_other(void) const;
277 
278  /// Reset Sparse_other data member.
279  void ResetSparse_other(void);
280 
281  /// Get the Sparse_other member data.
282  ///
283  /// @return
284  /// Reference to the member data.
285  const TSparse_other& GetSparse_other(void) const;
286 
287  /// Assign a value to Sparse_other data member.
288  ///
289  /// @param value
290  /// Reference to value.
291  void SetSparse_other(TSparse_other& value);
292 
293  /// Assign a value to Sparse_other data member.
294  ///
295  /// @return
296  /// Reference to the data value.
297  TSparse_other& SetSparse_other(void);
298 
299  /// Reset the whole object
300  virtual void Reset(void);
301 
302 
303 private:
304  // Prohibit copy constructor and assignment operator
307 
308  // data
309  Uint4 m_set_State[1];
315 };
316 
317 /* @} */
318 
319 
320 
321 
322 
323 ///////////////////////////////////////////////////////////
324 ///////////////////// inline methods //////////////////////
325 ///////////////////////////////////////////////////////////
326 inline
328 {
329  return m_Header.NotEmpty();
330 }
331 
332 inline
334 {
335  return true;
336 }
337 
338 inline
340 {
341  if ( !m_Header ) {
342  const_cast<CSeqTable_column_Base*>(this)->ResetHeader();
343  }
344  return (*m_Header);
345 }
346 
347 inline
349 {
350  if ( !m_Header ) {
351  ResetHeader();
352  }
353  return (*m_Header);
354 }
355 
356 inline
358 {
359  return m_Data.NotEmpty();
360 }
361 
362 inline
364 {
365  return IsSetData();
366 }
367 
368 inline
370 {
371  if (!CanGetData()) {
372  ThrowUnassigned(1);
373  }
374  return (*m_Data);
375 }
376 
377 inline
379 {
380  return m_Sparse.NotEmpty();
381 }
382 
383 inline
385 {
386  return IsSetSparse();
387 }
388 
389 inline
391 {
392  if (!CanGetSparse()) {
393  ThrowUnassigned(2);
394  }
395  return (*m_Sparse);
396 }
397 
398 inline
400 {
401  return m_Default.NotEmpty();
402 }
403 
404 inline
406 {
407  return IsSetDefault();
408 }
409 
410 inline
412 {
413  if (!CanGetDefault()) {
414  ThrowUnassigned(3);
415  }
416  return (*m_Default);
417 }
418 
419 inline
421 {
422  return m_Sparse_other.NotEmpty();
423 }
424 
425 inline
427 {
428  return IsSetSparse_other();
429 }
430 
431 inline
433 {
434  if (!CanGetSparse_other()) {
435  ThrowUnassigned(4);
436  }
437  return (*m_Sparse_other);
438 }
439 
440 ///////////////////////////////////////////////////////////
441 ////////////////// end of inline methods //////////////////
442 ///////////////////////////////////////////////////////////
443 
444 
445 
446 
447 
448 END_objects_SCOPE // namespace ncbi::objects::
449 
451 
452 
453 #endif // OBJECTS_SEQTABLE_SEQTABLE_COLUMN_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSeqTable_column_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
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
CSeqTable_single_data TDefault
const TDefault & GetDefault(void) const
Get the Default member data.
bool CanGetDefault(void) const
Check if it is safe to call GetDefault method.
const TSparse_other & GetSparse_other(void) const
Get the Sparse_other member data.
const TSparse & GetSparse(void) const
Get the Sparse member data.
void ResetHeader(void)
Reset Header data member.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
CSeqTable_column_Base & operator=(const CSeqTable_column_Base &)
CRef< TDefault > m_Default
bool CanGetHeader(void) const
Check if it is safe to call GetHeader method.
bool CanGetSparse(void) const
Check if it is safe to call GetSparse method.
CSeqTable_column_Base(const CSeqTable_column_Base &)
CRef< TSparse_other > m_Sparse_other
bool IsSetSparse_other(void) const
single value for indexes not listed in sparse table Check if a value has been assigned to Sparse_othe...
const THeader & GetHeader(void) const
Get the Header member data.
CSeqTable_multi_data TData
CSeqTable_column_info THeader
CSeqTable_single_data TSparse_other
bool IsSetHeader(void) const
column description or reference to previously defined info information about data Check if a value ha...
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...
bool CanGetData(void) const
Check if it is safe to call GetData method.
CSeqTable_sparse_index TSparse
THeader & SetHeader(void)
Assign a value to Header data member.
const TData & GetData(void) const
Get the Data member data.
bool CanGetSparse_other(void) const
Check if it is safe to call GetSparse_other method.
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...
string GetHeader()
Definition: file_names.hpp:62
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon May 20 05:05:23 2024 by modify_doxy.py rev. 669887