NCBI C++ ToolKit
Seq_map_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_map_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/seqcode/seqcode.asn">seqcode.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqcode/seqcode.def">seqcode.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_SEQCODE_SEQ_MAP_TABLE_BASE_HPP
42 #define OBJECTS_SEQCODE_SEQ_MAP_TABLE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_SeqCode
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// for tables of sequence mappings
70 ///
71 /// CSeq_map_table_Base --
72 ///
73 
75 {
77 public:
78  // constructor
79  CSeq_map_table_Base(void);
80  // destructor
81  virtual ~CSeq_map_table_Base(void);
82 
83  // type info
85 
86  // types
89  typedef int TNum;
90  typedef int TStart_at;
91  typedef list< int > TTable;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_from,
97  e_to,
98  e_num,
99  e_start_at,
100  e_table
101  };
103 
104  // getters
105  // setters
106 
107  /// code to map from
108  /// Check if a value has been assigned to From data member.
109  ///
110  /// Data member From is mandatory;
111  /// its type is defined as 'typedef ESeq_code_type TFrom'
112  /// @return
113  /// - true, if a value has been assigned.
114  /// - false, otherwise.
115  bool IsSetFrom(void) const;
116 
117  /// Check if it is safe to call GetFrom method.
118  ///
119  /// @return
120  /// - true, if the data member is getatable.
121  /// - false, otherwise.
122  bool CanGetFrom(void) const;
123 
124  /// Reset From data member.
125  void ResetFrom(void);
126 
127  /// Get the From member data.
128  ///
129  /// @return
130  /// Copy of the member data.
131  TFrom GetFrom(void) const;
132 
133  /// Assign a value to From data member.
134  ///
135  /// @param value
136  /// Value to assign
137  void SetFrom(TFrom value);
138 
139  /// Assign a value to From data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TFrom& SetFrom(void);
144 
145  /// code to map to
146  /// Check if a value has been assigned to To data member.
147  ///
148  /// Data member To is mandatory;
149  /// its type is defined as 'typedef ESeq_code_type TTo'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetTo(void) const;
154 
155  /// Check if it is safe to call GetTo method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetTo(void) const;
161 
162  /// Reset To data member.
163  void ResetTo(void);
164 
165  /// Get the To member data.
166  ///
167  /// @return
168  /// Copy of the member data.
169  TTo GetTo(void) const;
170 
171  /// Assign a value to To data member.
172  ///
173  /// @param value
174  /// Value to assign
175  void SetTo(TTo value);
176 
177  /// Assign a value to To data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TTo& SetTo(void);
182 
183  /// number of rows in table
184  /// Check if a value has been assigned to Num data member.
185  ///
186  /// Data member Num is mandatory;
187  /// its type is defined as 'typedef int TNum'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetNum(void) const;
192 
193  /// Check if it is safe to call GetNum method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetNum(void) const;
199 
200  /// Reset Num data member.
201  void ResetNum(void);
202 
203  /// Get the Num member data.
204  ///
205  /// @return
206  /// Copy of the member data.
207  TNum GetNum(void) const;
208 
209  /// Assign a value to Num data member.
210  ///
211  /// @param value
212  /// Value to assign
213  void SetNum(TNum value);
214 
215  /// Assign a value to Num data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TNum& SetNum(void);
220 
221  /// index offset of first element
222  /// Check if a value has been assigned to Start_at data member.
223  ///
224  /// Data member Start_at is optional with default 0;
225  /// its type is defined as 'typedef int TStart_at'
226  /// @return
227  /// - true, if a value has been assigned.
228  /// - false, otherwise.
229  bool IsSetStart_at(void) const;
230 
231  /// Check if it is safe to call GetStart_at method.
232  ///
233  /// @return
234  /// - true, if the data member is getatable.
235  /// - false, otherwise.
236  bool CanGetStart_at(void) const;
237 
238  /// Reset Start_at data member.
239  void ResetStart_at(void);
240 
241  /// Assign default value to Start_at data member.
242  void SetDefaultStart_at(void);
243 
244  /// Get the Start_at member data.
245  ///
246  /// @return
247  /// Copy of the member data.
248  TStart_at GetStart_at(void) const;
249 
250  /// Assign a value to Start_at data member.
251  ///
252  /// @param value
253  /// Value to assign
254  void SetStart_at(TStart_at value);
255 
256  /// Assign a value to Start_at data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TStart_at& SetStart_at(void);
261 
262  /// table of values, in from-to order
263  /// Check if a value has been assigned to Table data member.
264  ///
265  /// Data member Table is mandatory;
266  /// its type is defined as 'typedef list< int > TTable'
267  /// @return
268  /// - true, if a value has been assigned.
269  /// - false, otherwise.
270  bool IsSetTable(void) const;
271 
272  /// Check if it is safe to call GetTable method.
273  ///
274  /// @return
275  /// - true, if the data member is getatable.
276  /// - false, otherwise.
277  bool CanGetTable(void) const;
278 
279  /// Reset Table data member.
280  void ResetTable(void);
281 
282  /// Get the Table member data.
283  ///
284  /// @return
285  /// Reference to the member data.
286  const TTable& GetTable(void) const;
287 
288  /// Assign a value to Table data member.
289  ///
290  /// @return
291  /// Reference to the data value.
292  TTable& SetTable(void);
293 
294  /// Reset the whole object
295  virtual void Reset(void);
296 
297 
298 private:
299  // Prohibit copy constructor and assignment operator
302 
303  // data
304  Uint4 m_set_State[1];
307  int m_Num;
309  list< int > m_Table;
310 };
311 
312 /* @} */
313 
314 
315 
316 
317 
318 ///////////////////////////////////////////////////////////
319 ///////////////////// inline methods //////////////////////
320 ///////////////////////////////////////////////////////////
321 inline
323 {
324  return ((m_set_State[0] & 0x3) != 0);
325 }
326 
327 inline
329 {
330  return IsSetFrom();
331 }
332 
333 inline
335 {
337  m_set_State[0] &= ~0x3;
338 }
339 
340 inline
342 {
343  if (!CanGetFrom()) {
344  ThrowUnassigned(0);
345  }
346  return m_From;
347 }
348 
349 inline
351 {
352  m_From = value;
353  m_set_State[0] |= 0x3;
354 }
355 
356 inline
358 {
359 #ifdef _DEBUG
360  if (!IsSetFrom()) {
361  memset(&m_From,UnassignedByte(),sizeof(m_From));
362  }
363 #endif
364  m_set_State[0] |= 0x1;
365  return m_From;
366 }
367 
368 inline
370 {
371  return ((m_set_State[0] & 0xc) != 0);
372 }
373 
374 inline
376 {
377  return IsSetTo();
378 }
379 
380 inline
382 {
384  m_set_State[0] &= ~0xc;
385 }
386 
387 inline
389 {
390  if (!CanGetTo()) {
391  ThrowUnassigned(1);
392  }
393  return m_To;
394 }
395 
396 inline
398 {
399  m_To = value;
400  m_set_State[0] |= 0xc;
401 }
402 
403 inline
405 {
406 #ifdef _DEBUG
407  if (!IsSetTo()) {
408  memset(&m_To,UnassignedByte(),sizeof(m_To));
409  }
410 #endif
411  m_set_State[0] |= 0x4;
412  return m_To;
413 }
414 
415 inline
417 {
418  return ((m_set_State[0] & 0x30) != 0);
419 }
420 
421 inline
423 {
424  return IsSetNum();
425 }
426 
427 inline
429 {
430  m_Num = 0;
431  m_set_State[0] &= ~0x30;
432 }
433 
434 inline
436 {
437  if (!CanGetNum()) {
438  ThrowUnassigned(2);
439  }
440  return m_Num;
441 }
442 
443 inline
445 {
446  m_Num = value;
447  m_set_State[0] |= 0x30;
448 }
449 
450 inline
452 {
453 #ifdef _DEBUG
454  if (!IsSetNum()) {
455  memset(&m_Num,UnassignedByte(),sizeof(m_Num));
456  }
457 #endif
458  m_set_State[0] |= 0x10;
459  return m_Num;
460 }
461 
462 inline
464 {
465  return ((m_set_State[0] & 0xc0) != 0);
466 }
467 
468 inline
470 {
471  return true;
472 }
473 
474 inline
476 {
477  m_Start_at = 0;
478  m_set_State[0] &= ~0xc0;
479 }
480 
481 inline
483 {
484  ResetStart_at();
485 }
486 
487 inline
489 {
490  return m_Start_at;
491 }
492 
493 inline
495 {
496  m_Start_at = value;
497  m_set_State[0] |= 0xc0;
498 }
499 
500 inline
502 {
503 #ifdef _DEBUG
504  if (!IsSetStart_at()) {
505  memset(&m_Start_at,UnassignedByte(),sizeof(m_Start_at));
506  }
507 #endif
508  m_set_State[0] |= 0x40;
509  return m_Start_at;
510 }
511 
512 inline
514 {
515  return ((m_set_State[0] & 0x300) != 0);
516 }
517 
518 inline
520 {
521  return true;
522 }
523 
524 inline
526 {
527  return m_Table;
528 }
529 
530 inline
532 {
533  m_set_State[0] |= 0x100;
534  return m_Table;
535 }
536 
537 ///////////////////////////////////////////////////////////
538 ////////////////// end of inline methods //////////////////
539 ///////////////////////////////////////////////////////////
540 
541 
542 
543 
544 
545 END_objects_SCOPE // namespace ncbi::objects::
546 
548 
549 
550 #endif // OBJECTS_SEQCODE_SEQ_MAP_TABLE_BASE_HPP
User-defined methods of the data storage class.
for tables of sequence mappings
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_SEQCODE_EXPORT
Definition: ncbi_export.h:760
TStart_at & SetStart_at(void)
Assign a value to Start_at data member.
ESeq_code_type m_From
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
TTable & SetTable(void)
Assign a value to Table data member.
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
TTo GetTo(void) const
Get the To member data.
bool CanGetFrom(void) const
Check if it is safe to call GetFrom method.
CSeq_map_table_Base & operator=(const CSeq_map_table_Base &)
TStart_at GetStart_at(void) const
Get the Start_at member data.
void ResetStart_at(void)
Reset Start_at data member.
TFrom & SetFrom(void)
Assign a value to From data member.
void ResetTo(void)
Reset To data member.
TNum & SetNum(void)
Assign a value to Num data member.
TNum GetNum(void) const
Get the Num member data.
void SetDefaultStart_at(void)
Assign default value to Start_at data member.
bool CanGetStart_at(void) const
Check if it is safe to call GetStart_at method.
bool IsSetStart_at(void) const
index offset of first element Check if a value has been assigned to Start_at data member.
ESeq_code_type TTo
void ResetNum(void)
Reset Num data member.
bool IsSetTo(void) const
code to map to Check if a value has been assigned to To data member.
TFrom GetFrom(void) const
Get the From member data.
CSerialObject Tparent
ESeq_code_type
sequence representations
const TTable & GetTable(void) const
Get the Table member data.
void ResetFrom(void)
Reset From data member.
bool IsSetNum(void) const
number of rows in table Check if a value has been assigned to Num data member.
CSeq_map_table_Base(const CSeq_map_table_Base &)
ESeq_code_type TFrom
TTo & SetTo(void)
Assign a value to To data member.
bool IsSetTable(void) const
table of values, in from-to order Check if a value has been assigned to Table data member.
bool IsSetFrom(void) const
code to map from Check if a value has been assigned to From data member.
bool CanGetTable(void) const
Check if it is safe to call GetTable method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:00:13 2024 by modify_doxy.py rev. 669887