NCBI C++ ToolKit
Blast4_cutoff_.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 Blast4_cutoff_.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/blast/blast.asn">blast.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/blast/blast.def">blast.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_BLAST_BLAST4_CUTOFF_BASE_HPP
42 #define OBJECTS_BLAST_BLAST4_CUTOFF_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_Blast4
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 ///
66 ///
67 ///
68 ///
69 ///
70 ///
71 ///
72 ///
73 ///
74 ///
75 ///
76 ///
77 ///
78 ///
79 ///
80 ///
81 ///
82 ///
83 /// Other types in alphabetical order
84 ///
85 ///
86 ///
87 ///
88 ///
89 ///
90 ///
91 ///
92 ///
93 ///
94 ///
95 ///
96 ///
97 ///
98 ///
99 ///
100 ///
101 ///
102 ///
103 ///
104 /// CBlast4_cutoff_Base --
105 ///
106 
108 {
110 public:
111  // constructor
112  CBlast4_cutoff_Base(void);
113  // destructor
114  virtual ~CBlast4_cutoff_Base(void);
115 
116  // type info
118 
119 
120  /// Choice variants.
121  enum E_Choice {
122  e_not_set = 0, ///< No variant selected
124  e_Raw_score
125  };
126  /// Maximum+1 value of the choice variant enumerator.
128  e_MaxChoice = 3 ///< == e_Raw_score+1
129  };
130 
131  /// Reset the whole object
132  virtual void Reset(void);
133 
134  /// Reset the selection (set it to e_not_set).
135  virtual void ResetSelection(void);
136 
137  /// Which variant is currently selected.
138  ///
139  /// @return
140  /// Choice state enumerator.
141  E_Choice Which(void) const;
142 
143  /// Verify selection, throw exception if it differs from the expected.
144  ///
145  /// @param index
146  /// Expected selection.
147  void CheckSelected(E_Choice index) const;
148 
149  /// Throw 'InvalidSelection' exception.
150  ///
151  /// @param index
152  /// Expected selection.
153  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
154 
155  /// Retrieve selection name (for diagnostic purposes).
156  ///
157  /// @param index
158  /// One of possible selection states.
159  /// @return
160  /// Name string.
161  static string SelectionName(E_Choice index);
162 
163  /// Select the requested variant if needed.
164  ///
165  /// @param index
166  /// New selection state.
167  /// @param reset
168  /// Flag that defines the resetting of the variant data. The data will
169  /// be reset if either the current selection differs from the new one,
170  /// or the flag is set to eDoResetVariant.
172  /// Select the requested variant if needed,
173  /// allocating CObject variants from memory pool.
174  void Select(E_Choice index,
175  EResetVariant reset,
176  CObjectMemoryPool* pool);
177 
178  // types
179  typedef double TE_value;
180  typedef int TRaw_score;
181 
182  // getters
183  // setters
184 
185 
186  /// Check if variant E_value is selected.
187  ///
188  /// E_value type is defined as 'typedef double TE_value'.
189  /// @return
190  /// - true, if the variant is selected.
191  /// - false, otherwise.
192  bool IsE_value(void) const;
193 
194  /// Get the variant data.
195  ///
196  /// @return
197  /// Copy of the variant data.
198  TE_value GetE_value(void) const;
199 
200  /// Select the variant.
201  ///
202  /// @return
203  /// Reference to the variant data.
204  TE_value& SetE_value(void);
205 
206  /// Select the variant and set its data.
207  ///
208  /// @param value
209  /// Variant data.
210  void SetE_value(TE_value value);
211 
212 
213  /// Check if variant Raw_score is selected.
214  ///
215  /// Raw_score type is defined as 'typedef int TRaw_score'.
216  /// @return
217  /// - true, if the variant is selected.
218  /// - false, otherwise.
219  bool IsRaw_score(void) const;
220 
221  /// Get the variant data.
222  ///
223  /// @return
224  /// Copy of the variant data.
225  TRaw_score GetRaw_score(void) const;
226 
227  /// Select the variant.
228  ///
229  /// @return
230  /// Reference to the variant data.
231  TRaw_score& SetRaw_score(void);
232 
233  /// Select the variant and set its data.
234  ///
235  /// @param value
236  /// Variant data.
237  void SetRaw_score(TRaw_score value);
238 
239 
240 private:
241  // copy constructor and assignment operator
244  // choice state
246  // helper methods
247  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
248 
249  static const char* const sm_SelectionNames[];
250  // data
251  union {
254  };
255 };
256 
257 /* @} */
258 
259 
260 
261 
262 
263 ///////////////////////////////////////////////////////////
264 ///////////////////// inline methods //////////////////////
265 ///////////////////////////////////////////////////////////
266 inline
268 {
269  return m_choice;
270 }
271 
272 inline
274 {
275  if ( m_choice != index )
276  ThrowInvalidSelection(index);
277 }
278 
279 inline
280 void CBlast4_cutoff_Base::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
281 {
282  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
283  if ( m_choice != e_not_set )
284  ResetSelection();
285  DoSelect(index, pool);
286  }
287 }
288 
289 inline
291 {
292  Select(index, reset, 0);
293 }
294 
295 inline
297 {
298  return m_choice == e_E_value;
299 }
300 
301 inline
303 {
305  return m_E_value;
306 }
307 
308 inline
310 {
312  return m_E_value;
313 }
314 
315 inline
317 {
319  m_E_value = value;
320 }
321 
322 inline
324 {
325  return m_choice == e_Raw_score;
326 }
327 
328 inline
330 {
332  return m_Raw_score;
333 }
334 
335 inline
337 {
339  return m_Raw_score;
340 }
341 
342 inline
344 {
346  m_Raw_score = value;
347 }
348 
349 ///////////////////////////////////////////////////////////
350 ////////////////// end of inline methods //////////////////
351 ///////////////////////////////////////////////////////////
352 
353 
354 
355 
356 
357 END_objects_SCOPE // namespace ncbi::objects::
358 
360 
361 
362 #endif // OBJECTS_BLAST_BLAST4_CUTOFF_BASE_HPP
Other types in alphabetical order.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_BLAST_EXPORT
Definition: ncbi_export.h:360
bool IsRaw_score(void) const
Check if variant Raw_score is selected.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
CBlast4_cutoff_Base(const CBlast4_cutoff_Base &)
TE_value & SetE_value(void)
Select the variant.
TRaw_score GetRaw_score(void) const
Get the variant data.
TRaw_score & SetRaw_score(void)
Select the variant.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
E_Choice Which(void) const
Which variant is currently selected.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsE_value(void) const
Check if variant E_value is selected.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TE_value GetE_value(void) const
Get the variant data.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
CBlast4_cutoff_Base & operator=(const CBlast4_cutoff_Base &)
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
E_Choice
Choice variants.
@ e_not_set
No variant selected.
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Apr 28 04:49:32 2024 by modify_doxy.py rev. 669887