NCBI C++ ToolKit
Spliced_seg_modifier_.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 Spliced_seg_modifier_.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/seqalign/seqalign.asn">seqalign.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqalign/seqalign.def">seqalign.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_SEQALIGN_SPLICED_SEG_MODIFIER_BASE_HPP
42 #define OBJECTS_SEQALIGN_SPLICED_SEG_MODIFIER_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 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_Seqalign
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CSpliced_seg_modifier_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CSpliced_seg_modifier_Base(void);
76 
77  // type info
79 
80 
81  /// Choice variants.
82  enum E_Choice {
83  e_not_set = 0, ///< No variant selected
84  e_Start_codon_found, ///< protein aligns from the start and the first codon on both product and genomic is start codon
85  e_Stop_codon_found ///< protein aligns to it's end and there is stop codon on the genomic right after the alignment
86  };
87  /// Maximum+1 value of the choice variant enumerator.
89  e_MaxChoice = 3 ///< == e_Stop_codon_found+1
90  };
91 
92  /// Reset the whole object
93  virtual void Reset(void);
94 
95  /// Reset the selection (set it to e_not_set).
96  virtual void ResetSelection(void);
97 
98  /// Which variant is currently selected.
99  ///
100  /// @return
101  /// Choice state enumerator.
102  E_Choice Which(void) const;
103 
104  /// Verify selection, throw exception if it differs from the expected.
105  ///
106  /// @param index
107  /// Expected selection.
108  void CheckSelected(E_Choice index) const;
109 
110  /// Throw 'InvalidSelection' exception.
111  ///
112  /// @param index
113  /// Expected selection.
114  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
115 
116  /// Retrieve selection name (for diagnostic purposes).
117  ///
118  /// @param index
119  /// One of possible selection states.
120  /// @return
121  /// Name string.
122  static string SelectionName(E_Choice index);
123 
124  /// Select the requested variant if needed.
125  ///
126  /// @param index
127  /// New selection state.
128  /// @param reset
129  /// Flag that defines the resetting of the variant data. The data will
130  /// be reset if either the current selection differs from the new one,
131  /// or the flag is set to eDoResetVariant.
133  /// Select the requested variant if needed,
134  /// allocating CObject variants from memory pool.
135  void Select(E_Choice index,
136  EResetVariant reset,
137  CObjectMemoryPool* pool);
138 
139  // types
140  typedef bool TStart_codon_found;
141  typedef bool TStop_codon_found;
142 
143  // getters
144  // setters
145 
146 
147  /// Check if variant Start_codon_found is selected.
148  ///
149  /// Start_codon_found type is defined as 'typedef bool TStart_codon_found'.
150  /// @return
151  /// - true, if the variant is selected.
152  /// - false, otherwise.
153  bool IsStart_codon_found(void) const;
154 
155  /// Get the variant data.
156  ///
157  /// @return
158  /// Copy of the variant data.
159  TStart_codon_found GetStart_codon_found(void) const;
160 
161  /// Select the variant.
162  ///
163  /// @return
164  /// Reference to the variant data.
165  TStart_codon_found& SetStart_codon_found(void);
166 
167  /// Select the variant and set its data.
168  ///
169  /// @param value
170  /// Variant data.
171  void SetStart_codon_found(TStart_codon_found value);
172 
173 
174  /// Check if variant Stop_codon_found is selected.
175  ///
176  /// Stop_codon_found type is defined as 'typedef bool TStop_codon_found'.
177  /// @return
178  /// - true, if the variant is selected.
179  /// - false, otherwise.
180  bool IsStop_codon_found(void) const;
181 
182  /// Get the variant data.
183  ///
184  /// @return
185  /// Copy of the variant data.
186  TStop_codon_found GetStop_codon_found(void) const;
187 
188  /// Select the variant.
189  ///
190  /// @return
191  /// Reference to the variant data.
192  TStop_codon_found& SetStop_codon_found(void);
193 
194  /// Select the variant and set its data.
195  ///
196  /// @param value
197  /// Variant data.
198  void SetStop_codon_found(TStop_codon_found value);
199 
200 
201 private:
202  // copy constructor and assignment operator
205  // choice state
207  // helper methods
208  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
209 
210  static const char* const sm_SelectionNames[];
211  // data
212  union {
215  };
216 };
217 
218 /* @} */
219 
220 
221 
222 
223 
224 ///////////////////////////////////////////////////////////
225 ///////////////////// inline methods //////////////////////
226 ///////////////////////////////////////////////////////////
227 inline
229 {
230  return m_choice;
231 }
232 
233 inline
235 {
236  if ( m_choice != index )
237  ThrowInvalidSelection(index);
238 }
239 
240 inline
241 void CSpliced_seg_modifier_Base::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
242 {
243  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
244  if ( m_choice != e_not_set )
245  ResetSelection();
246  DoSelect(index, pool);
247  }
248 }
249 
250 inline
252 {
253  Select(index, reset, 0);
254 }
255 
256 inline
258 {
259  return m_choice == e_Start_codon_found;
260 }
261 
262 inline
264 {
266  return m_Start_codon_found;
267 }
268 
269 inline
271 {
273  return m_Start_codon_found;
274 }
275 
276 inline
278 {
281 }
282 
283 inline
285 {
286  return m_choice == e_Stop_codon_found;
287 }
288 
289 inline
291 {
293  return m_Stop_codon_found;
294 }
295 
296 inline
298 {
300  return m_Stop_codon_found;
301 }
302 
303 inline
305 {
308 }
309 
310 ///////////////////////////////////////////////////////////
311 ////////////////// end of inline methods //////////////////
312 ///////////////////////////////////////////////////////////
313 
314 
315 
316 
317 
318 END_objects_SCOPE // namespace ncbi::objects::
319 
321 
322 
323 #endif // OBJECTS_SEQALIGN_SPLICED_SEG_MODIFIER_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSpliced_seg_modifier_Base –.
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
#define NCBI_SEQALIGN_EXPORT
Definition: ncbi_export.h:744
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
E_Choice Which(void) const
Which variant is currently selected.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TStart_codon_found & SetStart_codon_found(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
bool IsStop_codon_found(void) const
Check if variant Stop_codon_found is selected.
CSpliced_seg_modifier_Base & operator=(const CSpliced_seg_modifier_Base &)
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
TStart_codon_found GetStart_codon_found(void) const
Get the variant data.
TStop_codon_found GetStop_codon_found(void) const
Get the variant data.
CSpliced_seg_modifier_Base(const CSpliced_seg_modifier_Base &)
TStop_codon_found & SetStop_codon_found(void)
Select the variant.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
bool IsStart_codon_found(void) const
Check if variant Start_codon_found is selected.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
@ e_Start_codon_found
protein aligns from the start and the first codon on both product and genomic is start codon
@ e_Stop_codon_found
protein aligns to it's end and there is stop codon on the genomic right after the alignment
@ e_not_set
Modified on Wed Dec 06 07:12:02 2023 by modify_doxy.py rev. 669887