NCBI C++ ToolKit
Location_edit_type_.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 Location_edit_type_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_LOCATION_EDIT_TYPE_BASE_HPP
42 #define OBJECTS_MACRO_LOCATION_EDIT_TYPE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // forward declarations
64 class CExtend_to_feature;
68 
69 
70 // generated classes
71 
72 
73 /** @addtogroup dataspec_NCBI_Macro
74  *
75  * @{
76  */
77 
78 /////////////////////////////////////////////////////////////////////////////
79 ///
80 /// CLocation_edit_type_Base --
81 ///
82 
84 {
86 public:
87  // constructor
89  // destructor
90  virtual ~CLocation_edit_type_Base(void);
91 
92  // type info
94 
95 
96  /// Choice variants.
97  enum E_Choice {
98  e_not_set = 0, ///< No variant selected
111  };
112  /// Maximum+1 value of the choice variant enumerator.
114  e_MaxChoice = 13 ///< == e_Extend_3_to_feat+1
115  };
116 
117  /// Reset the whole object
118  virtual void Reset(void);
119 
120  /// Reset the selection (set it to e_not_set).
121  virtual void ResetSelection(void);
122 
123  /// Which variant is currently selected.
124  ///
125  /// @return
126  /// Choice state enumerator.
127  E_Choice Which(void) const;
128 
129  /// Verify selection, throw exception if it differs from the expected.
130  ///
131  /// @param index
132  /// Expected selection.
133  void CheckSelected(E_Choice index) const;
134 
135  /// Throw 'InvalidSelection' exception.
136  ///
137  /// @param index
138  /// Expected selection.
139  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
140 
141  /// Retrieve selection name (for diagnostic purposes).
142  ///
143  /// @param index
144  /// One of possible selection states.
145  /// @return
146  /// Name string.
147  static string SelectionName(E_Choice index);
148 
149  /// Select the requested variant if needed.
150  ///
151  /// @param index
152  /// New selection state.
153  /// @param reset
154  /// Flag that defines the resetting of the variant data. The data will
155  /// be reset if either the current selection differs from the new one,
156  /// or the flag is set to eDoResetVariant.
158  /// Select the requested variant if needed,
159  /// allocating CObject variants from memory pool.
160  void Select(E_Choice index,
161  EResetVariant reset,
162  CObjectMemoryPool* pool);
163 
164  // types
175 
176  // getters
177  // setters
178 
179 
180  /// Check if variant Strand is selected.
181  ///
182  /// Strand type is defined as 'typedef CEdit_location_strand TStrand'.
183  /// @return
184  /// - true, if the variant is selected.
185  /// - false, otherwise.
186  bool IsStrand(void) const;
187 
188  /// Get the variant data.
189  ///
190  /// @return
191  /// Reference to the data.
192  const TStrand& GetStrand(void) const;
193 
194  /// Select the variant.
195  ///
196  /// @return
197  /// Reference to the variant data.
198  TStrand& SetStrand(void);
199  /// Select the variant and set its data.
200  ///
201  /// @param value
202  /// Reference to the data.
203  void SetStrand(TStrand& value);
204 
205 
206  /// Check if variant Set_5_partial is selected.
207  ///
208  /// Set_5_partial type is defined as 'typedef CPartial_5_set_action TSet_5_partial'.
209  /// @return
210  /// - true, if the variant is selected.
211  /// - false, otherwise.
212  bool IsSet_5_partial(void) const;
213 
214  /// Get the variant data.
215  ///
216  /// @return
217  /// Reference to the data.
218  const TSet_5_partial& GetSet_5_partial(void) const;
219 
220  /// Select the variant.
221  ///
222  /// @return
223  /// Reference to the variant data.
225  /// Select the variant and set its data.
226  ///
227  /// @param value
228  /// Reference to the data.
230 
231 
232  /// Check if variant Clear_5_partial is selected.
233  ///
234  /// Clear_5_partial type is defined as 'typedef EPartial_5_clear_constraint TClear_5_partial'.
235  /// @return
236  /// - true, if the variant is selected.
237  /// - false, otherwise.
238  bool IsClear_5_partial(void) const;
239 
240  /// Get the variant data.
241  ///
242  /// @return
243  /// Copy of the variant data.
245 
246  /// Select the variant.
247  ///
248  /// @return
249  /// Reference to the variant data.
251 
252  /// Select the variant and set its data.
253  ///
254  /// @param value
255  /// Variant data.
257 
258 
259  /// Check if variant Set_3_partial is selected.
260  ///
261  /// Set_3_partial type is defined as 'typedef CPartial_3_set_action TSet_3_partial'.
262  /// @return
263  /// - true, if the variant is selected.
264  /// - false, otherwise.
265  bool IsSet_3_partial(void) const;
266 
267  /// Get the variant data.
268  ///
269  /// @return
270  /// Reference to the data.
271  const TSet_3_partial& GetSet_3_partial(void) const;
272 
273  /// Select the variant.
274  ///
275  /// @return
276  /// Reference to the variant data.
278  /// Select the variant and set its data.
279  ///
280  /// @param value
281  /// Reference to the data.
283 
284 
285  /// Check if variant Clear_3_partial is selected.
286  ///
287  /// Clear_3_partial type is defined as 'typedef EPartial_3_clear_constraint TClear_3_partial'.
288  /// @return
289  /// - true, if the variant is selected.
290  /// - false, otherwise.
291  bool IsClear_3_partial(void) const;
292 
293  /// Get the variant data.
294  ///
295  /// @return
296  /// Copy of the variant data.
298 
299  /// Select the variant.
300  ///
301  /// @return
302  /// Reference to the variant data.
304 
305  /// Select the variant and set its data.
306  ///
307  /// @param value
308  /// Variant data.
310 
311 
312  /// Check if variant Set_both_partial is selected.
313  ///
314  /// Set_both_partial type is defined as 'typedef CPartial_both_set_action TSet_both_partial'.
315  /// @return
316  /// - true, if the variant is selected.
317  /// - false, otherwise.
318  bool IsSet_both_partial(void) const;
319 
320  /// Get the variant data.
321  ///
322  /// @return
323  /// Reference to the data.
324  const TSet_both_partial& GetSet_both_partial(void) const;
325 
326  /// Select the variant.
327  ///
328  /// @return
329  /// Reference to the variant data.
331  /// Select the variant and set its data.
332  ///
333  /// @param value
334  /// Reference to the data.
336 
337 
338  /// Check if variant Clear_both_partial is selected.
339  ///
340  /// Clear_both_partial type is defined as 'typedef EPartial_both_clear_constraint TClear_both_partial'.
341  /// @return
342  /// - true, if the variant is selected.
343  /// - false, otherwise.
344  bool IsClear_both_partial(void) const;
345 
346  /// Get the variant data.
347  ///
348  /// @return
349  /// Copy of the variant data.
351 
352  /// Select the variant.
353  ///
354  /// @return
355  /// Reference to the variant data.
357 
358  /// Select the variant and set its data.
359  ///
360  /// @param value
361  /// Variant data.
363 
364 
365  /// Check if variant Convert is selected.
366  ///
367  /// Convert type is defined as 'typedef EConvert_location_type TConvert'.
368  /// @return
369  /// - true, if the variant is selected.
370  /// - false, otherwise.
371  bool IsConvert(void) const;
372 
373  /// Get the variant data.
374  ///
375  /// @return
376  /// Copy of the variant data.
377  TConvert GetConvert(void) const;
378 
379  /// Select the variant.
380  ///
381  /// @return
382  /// Reference to the variant data.
383  TConvert& SetConvert(void);
384 
385  /// Select the variant and set its data.
386  ///
387  /// @param value
388  /// Variant data.
389  void SetConvert(TConvert value);
390 
391 
392  /// Check if variant Extend_5 is selected.
393  ///
394  /// @return
395  /// - true, if the variant is selected.
396  /// - false, otherwise.
397  bool IsExtend_5(void) const;
398 
399  /// Select the variant.
400  void SetExtend_5(void);
401 
402 
403  /// Check if variant Extend_3 is selected.
404  ///
405  /// @return
406  /// - true, if the variant is selected.
407  /// - false, otherwise.
408  bool IsExtend_3(void) const;
409 
410  /// Select the variant.
411  void SetExtend_3(void);
412 
413 
414  /// Check if variant Extend_5_to_feat is selected.
415  ///
416  /// Extend_5_to_feat type is defined as 'typedef CExtend_to_feature TExtend_5_to_feat'.
417  /// @return
418  /// - true, if the variant is selected.
419  /// - false, otherwise.
420  bool IsExtend_5_to_feat(void) const;
421 
422  /// Get the variant data.
423  ///
424  /// @return
425  /// Reference to the data.
426  const TExtend_5_to_feat& GetExtend_5_to_feat(void) const;
427 
428  /// Select the variant.
429  ///
430  /// @return
431  /// Reference to the variant data.
433  /// Select the variant and set its data.
434  ///
435  /// @param value
436  /// Reference to the data.
438 
439 
440  /// Check if variant Extend_3_to_feat is selected.
441  ///
442  /// Extend_3_to_feat type is defined as 'typedef CExtend_to_feature TExtend_3_to_feat'.
443  /// @return
444  /// - true, if the variant is selected.
445  /// - false, otherwise.
446  bool IsExtend_3_to_feat(void) const;
447 
448  /// Get the variant data.
449  ///
450  /// @return
451  /// Reference to the data.
452  const TExtend_3_to_feat& GetExtend_3_to_feat(void) const;
453 
454  /// Select the variant.
455  ///
456  /// @return
457  /// Reference to the variant data.
459  /// Select the variant and set its data.
460  ///
461  /// @param value
462  /// Reference to the data.
464 
465 
466 private:
467  // copy constructor and assignment operator
470  // choice state
472  // helper methods
473  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
474 
475  static const char* const sm_SelectionNames[];
476  // data
477  union {
482  NCBI_NS_NCBI::CSerialObject *m_object;
483  };
484 };
485 
486 /* @} */
487 
488 
489 
490 
491 
492 ///////////////////////////////////////////////////////////
493 ///////////////////// inline methods //////////////////////
494 ///////////////////////////////////////////////////////////
495 inline
497 {
498  return m_choice;
499 }
500 
501 inline
503 {
504  if ( m_choice != index )
505  ThrowInvalidSelection(index);
506 }
507 
508 inline
509 void CLocation_edit_type_Base::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
510 {
511  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
512  if ( m_choice != e_not_set )
513  ResetSelection();
514  DoSelect(index, pool);
515  }
516 }
517 
518 inline
520 {
521  Select(index, reset, 0);
522 }
523 
524 inline
526 {
527  return m_choice == e_Strand;
528 }
529 
530 inline
532 {
533  return m_choice == e_Set_5_partial;
534 }
535 
536 inline
538 {
539  return m_choice == e_Clear_5_partial;
540 }
541 
542 inline
544 {
546  return m_Clear_5_partial;
547 }
548 
549 inline
551 {
553  return m_Clear_5_partial;
554 }
555 
556 inline
558 {
561 }
562 
563 inline
565 {
566  return m_choice == e_Set_3_partial;
567 }
568 
569 inline
571 {
572  return m_choice == e_Clear_3_partial;
573 }
574 
575 inline
577 {
579  return m_Clear_3_partial;
580 }
581 
582 inline
584 {
586  return m_Clear_3_partial;
587 }
588 
589 inline
591 {
594 }
595 
596 inline
598 {
599  return m_choice == e_Set_both_partial;
600 }
601 
602 inline
604 {
605  return m_choice == e_Clear_both_partial;
606 }
607 
608 inline
610 {
612  return m_Clear_both_partial;
613 }
614 
615 inline
617 {
619  return m_Clear_both_partial;
620 }
621 
622 inline
624 {
627 }
628 
629 inline
631 {
632  return m_choice == e_Convert;
633 }
634 
635 inline
637 {
639  return m_Convert;
640 }
641 
642 inline
644 {
646  return m_Convert;
647 }
648 
649 inline
651 {
653  m_Convert = value;
654 }
655 
656 inline
658 {
659  return m_choice == e_Extend_5;
660 }
661 
662 inline
664 {
666 }
667 
668 inline
670 {
671  return m_choice == e_Extend_3;
672 }
673 
674 inline
676 {
678 }
679 
680 inline
682 {
683  return m_choice == e_Extend_5_to_feat;
684 }
685 
686 inline
688 {
689  return m_choice == e_Extend_3_to_feat;
690 }
691 
692 ///////////////////////////////////////////////////////////
693 ////////////////// end of inline methods //////////////////
694 ///////////////////////////////////////////////////////////
695 
696 
697 
698 
699 
700 END_objects_SCOPE // namespace ncbi::objects::
701 
703 
704 
705 #endif // OBJECTS_MACRO_LOCATION_EDIT_TYPE_BASE_HPP
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.
CEdit_location_strand –.
CExtend_to_feature –.
CLocation_edit_type_Base –.
CPartial_3_set_action –.
CPartial_5_set_action –.
CPartial_both_set_action –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
EResetVariant
Definition: serialbase.hpp:76
@ eDoResetVariant
Definition: serialbase.hpp:77
@ eDoNotResetVariant
Definition: serialbase.hpp:78
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
CPartial_3_set_action TSet_3_partial
EPartial_3_clear_constraint TClear_3_partial
EConvert_location_type
Access to EConvert_location_type's attributes (values, names) as defined in spec.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
TSet_3_partial & SetSet_3_partial(void)
Select the variant.
TStrand & SetStrand(void)
Select the variant.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
CExtend_to_feature TExtend_5_to_feat
bool IsConvert(void) const
Check if variant Convert is selected.
virtual void Reset(void)
Reset the whole object.
const TSet_both_partial & GetSet_both_partial(void) const
Get the variant data.
bool IsExtend_3_to_feat(void) const
Check if variant Extend_3_to_feat is selected.
TClear_5_partial GetClear_5_partial(void) const
Get the variant data.
const TExtend_3_to_feat & GetExtend_3_to_feat(void) const
Get the variant data.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
TSet_5_partial & SetSet_5_partial(void)
Select the variant.
EPartial_5_clear_constraint TClear_5_partial
NCBI_NS_NCBI::CSerialObject * m_object
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
const TExtend_5_to_feat & GetExtend_5_to_feat(void) const
Get the variant data.
EPartial_both_clear_constraint
Access to EPartial_both_clear_constraint's attributes (values, names) as defined in spec.
TClear_3_partial & SetClear_3_partial(void)
Select the variant.
CEdit_location_strand TStrand
CLocation_edit_type_Base(const CLocation_edit_type_Base &)
const TStrand & GetStrand(void) const
Get the variant data.
TConvert & SetConvert(void)
Select the variant.
EPartial_3_clear_constraint
Access to EPartial_3_clear_constraint's attributes (values, names) as defined in spec.
void SetExtend_3(void)
Select the variant.
TClear_both_partial m_Clear_both_partial
bool IsExtend_3(void) const
Check if variant Extend_3 is selected.
bool IsSet_3_partial(void) const
Check if variant Set_3_partial is selected.
bool IsSet_both_partial(void) const
Check if variant Set_both_partial is selected.
CPartial_5_set_action TSet_5_partial
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
static const char *const sm_SelectionNames[]
TClear_both_partial & SetClear_both_partial(void)
Select the variant.
void SetExtend_5(void)
Select the variant.
TExtend_3_to_feat & SetExtend_3_to_feat(void)
Select the variant.
EConvert_location_type TConvert
bool IsClear_both_partial(void) const
Check if variant Clear_both_partial is selected.
bool IsExtend_5_to_feat(void) const
Check if variant Extend_5_to_feat is selected.
bool IsClear_3_partial(void) const
Check if variant Clear_3_partial is selected.
bool IsStrand(void) const
Check if variant Strand is selected.
TClear_5_partial & SetClear_5_partial(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSet_5_partial(void) const
Check if variant Set_5_partial is selected.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
bool IsExtend_5(void) const
Check if variant Extend_5 is selected.
TClear_both_partial GetClear_both_partial(void) const
Get the variant data.
TClear_3_partial GetClear_3_partial(void) const
Get the variant data.
EPartial_both_clear_constraint TClear_both_partial
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
EPartial_5_clear_constraint
Access to EPartial_5_clear_constraint's attributes (values, names) as defined in spec.
CPartial_both_set_action TSet_both_partial
TSet_both_partial & SetSet_both_partial(void)
Select the variant.
const TSet_3_partial & GetSet_3_partial(void) const
Get the variant data.
const TSet_5_partial & GetSet_5_partial(void) const
Get the variant data.
TExtend_5_to_feat & SetExtend_5_to_feat(void)
Select the variant.
bool IsClear_5_partial(void) const
Check if variant Clear_5_partial is selected.
TConvert GetConvert(void) const
Get the variant data.
CExtend_to_feature TExtend_3_to_feat
CLocation_edit_type_Base & operator=(const CLocation_edit_type_Base &)
@ e_not_set
No variant selected.
@ e_MaxChoice
== e_Extend_3_to_feat+1
Modified on Fri Dec 01 04:44:15 2023 by modify_doxy.py rev. 669887