NCBI C++ ToolKit
Blast4_ka_block_.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_ka_block_.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_KA_BLOCK_BASE_HPP
42 #define OBJECTS_BLAST_BLAST4_KA_BLOCK_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 /// CBlast4_ka_block_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CBlast4_ka_block_Base(void);
76 
77  // type info
79 
80  // types
81  typedef double TLambda;
82  typedef double TK;
83  typedef double TH;
84  typedef bool TGapped;
85 
86  // member index
87  enum class E_memberIndex {
88  e__allMandatory = 0,
89  e_lambda,
90  e_k,
91  e_h,
92  e_gapped
93  };
95 
96  // getters
97  // setters
98 
99  /// Check if a value has been assigned to Lambda data member.
100  ///
101  /// Data member Lambda is mandatory;
102  /// its type is defined as 'typedef double TLambda'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetLambda(void) const;
107 
108  /// Check if it is safe to call GetLambda method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetLambda(void) const;
114 
115  /// Reset Lambda data member.
116  void ResetLambda(void);
117 
118  /// Get the Lambda member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TLambda GetLambda(void) const;
123 
124  /// Assign a value to Lambda data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetLambda(TLambda value);
129 
130  /// Assign a value to Lambda data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TLambda& SetLambda(void);
135 
136  /// Check if a value has been assigned to K data member.
137  ///
138  /// Data member K is mandatory;
139  /// its type is defined as 'typedef double TK'
140  /// @return
141  /// - true, if a value has been assigned.
142  /// - false, otherwise.
143  bool IsSetK(void) const;
144 
145  /// Check if it is safe to call GetK method.
146  ///
147  /// @return
148  /// - true, if the data member is getatable.
149  /// - false, otherwise.
150  bool CanGetK(void) const;
151 
152  /// Reset K data member.
153  void ResetK(void);
154 
155  /// Get the K member data.
156  ///
157  /// @return
158  /// Copy of the member data.
159  TK GetK(void) const;
160 
161  /// Assign a value to K data member.
162  ///
163  /// @param value
164  /// Value to assign
165  void SetK(TK value);
166 
167  /// Assign a value to K data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TK& SetK(void);
172 
173  /// Check if a value has been assigned to H data member.
174  ///
175  /// Data member H is mandatory;
176  /// its type is defined as 'typedef double TH'
177  /// @return
178  /// - true, if a value has been assigned.
179  /// - false, otherwise.
180  bool IsSetH(void) const;
181 
182  /// Check if it is safe to call GetH method.
183  ///
184  /// @return
185  /// - true, if the data member is getatable.
186  /// - false, otherwise.
187  bool CanGetH(void) const;
188 
189  /// Reset H data member.
190  void ResetH(void);
191 
192  /// Get the H member data.
193  ///
194  /// @return
195  /// Copy of the member data.
196  TH GetH(void) const;
197 
198  /// Assign a value to H data member.
199  ///
200  /// @param value
201  /// Value to assign
202  void SetH(TH value);
203 
204  /// Assign a value to H data member.
205  ///
206  /// @return
207  /// Reference to the data value.
208  TH& SetH(void);
209 
210  /// Check if a value has been assigned to Gapped data member.
211  ///
212  /// Data member Gapped is mandatory;
213  /// its type is defined as 'typedef bool TGapped'
214  /// @return
215  /// - true, if a value has been assigned.
216  /// - false, otherwise.
217  bool IsSetGapped(void) const;
218 
219  /// Check if it is safe to call GetGapped method.
220  ///
221  /// @return
222  /// - true, if the data member is getatable.
223  /// - false, otherwise.
224  bool CanGetGapped(void) const;
225 
226  /// Reset Gapped data member.
227  void ResetGapped(void);
228 
229  /// Get the Gapped member data.
230  ///
231  /// @return
232  /// Copy of the member data.
233  TGapped GetGapped(void) const;
234 
235  /// Assign a value to Gapped data member.
236  ///
237  /// @param value
238  /// Value to assign
239  void SetGapped(TGapped value);
240 
241  /// Assign a value to Gapped data member.
242  ///
243  /// @return
244  /// Reference to the data value.
245  TGapped& SetGapped(void);
246 
247  /// Reset the whole object
248  virtual void Reset(void);
249 
250 
251 private:
252  // Prohibit copy constructor and assignment operator
255 
256  // data
257  Uint4 m_set_State[1];
258  double m_Lambda;
259  double m_K;
260  double m_H;
261  bool m_Gapped;
262 };
263 
264 /* @} */
265 
266 
267 
268 
269 
270 ///////////////////////////////////////////////////////////
271 ///////////////////// inline methods //////////////////////
272 ///////////////////////////////////////////////////////////
273 inline
275 {
276  return ((m_set_State[0] & 0x3) != 0);
277 }
278 
279 inline
281 {
282  return IsSetLambda();
283 }
284 
285 inline
287 {
288  m_Lambda = 0;
289  m_set_State[0] &= ~0x3;
290 }
291 
292 inline
294 {
295  if (!CanGetLambda()) {
296  ThrowUnassigned(0);
297  }
298  return m_Lambda;
299 }
300 
301 inline
303 {
304  m_Lambda = value;
305  m_set_State[0] |= 0x3;
306 }
307 
308 inline
310 {
311 #ifdef _DEBUG
312  if (!IsSetLambda()) {
313  memset(&m_Lambda,UnassignedByte(),sizeof(m_Lambda));
314  }
315 #endif
316  m_set_State[0] |= 0x1;
317  return m_Lambda;
318 }
319 
320 inline
322 {
323  return ((m_set_State[0] & 0xc) != 0);
324 }
325 
326 inline
328 {
329  return IsSetK();
330 }
331 
332 inline
334 {
335  m_K = 0;
336  m_set_State[0] &= ~0xc;
337 }
338 
339 inline
341 {
342  if (!CanGetK()) {
343  ThrowUnassigned(1);
344  }
345  return m_K;
346 }
347 
348 inline
350 {
351  m_K = value;
352  m_set_State[0] |= 0xc;
353 }
354 
355 inline
357 {
358 #ifdef _DEBUG
359  if (!IsSetK()) {
360  memset(&m_K,UnassignedByte(),sizeof(m_K));
361  }
362 #endif
363  m_set_State[0] |= 0x4;
364  return m_K;
365 }
366 
367 inline
369 {
370  return ((m_set_State[0] & 0x30) != 0);
371 }
372 
373 inline
375 {
376  return IsSetH();
377 }
378 
379 inline
381 {
382  m_H = 0;
383  m_set_State[0] &= ~0x30;
384 }
385 
386 inline
388 {
389  if (!CanGetH()) {
390  ThrowUnassigned(2);
391  }
392  return m_H;
393 }
394 
395 inline
397 {
398  m_H = value;
399  m_set_State[0] |= 0x30;
400 }
401 
402 inline
404 {
405 #ifdef _DEBUG
406  if (!IsSetH()) {
407  memset(&m_H,UnassignedByte(),sizeof(m_H));
408  }
409 #endif
410  m_set_State[0] |= 0x10;
411  return m_H;
412 }
413 
414 inline
416 {
417  return ((m_set_State[0] & 0xc0) != 0);
418 }
419 
420 inline
422 {
423  return IsSetGapped();
424 }
425 
426 inline
428 {
429  m_Gapped = 0;
430  m_set_State[0] &= ~0xc0;
431 }
432 
433 inline
435 {
436  if (!CanGetGapped()) {
437  ThrowUnassigned(3);
438  }
439  return m_Gapped;
440 }
441 
442 inline
444 {
445  m_Gapped = value;
446  m_set_State[0] |= 0xc0;
447 }
448 
449 inline
451 {
452 #ifdef _DEBUG
453  if (!IsSetGapped()) {
454  memset(&m_Gapped,UnassignedByte(),sizeof(m_Gapped));
455  }
456 #endif
457  m_set_State[0] |= 0x40;
458  return m_Gapped;
459 }
460 
461 ///////////////////////////////////////////////////////////
462 ////////////////// end of inline methods //////////////////
463 ///////////////////////////////////////////////////////////
464 
465 
466 
467 
468 
469 END_objects_SCOPE // namespace ncbi::objects::
470 
472 
473 
474 #endif // OBJECTS_BLAST_BLAST4_KA_BLOCK_BASE_HPP
CBlast4_ka_block_Base –.
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_BLAST_EXPORT
Definition: ncbi_export.h:360
TGapped GetGapped(void) const
Get the Gapped member data.
TK GetK(void) const
Get the K member data.
TGapped & SetGapped(void)
Assign a value to Gapped data member.
void ResetGapped(void)
Reset Gapped data member.
bool CanGetH(void) const
Check if it is safe to call GetH method.
TLambda & SetLambda(void)
Assign a value to Lambda data member.
bool IsSetGapped(void) const
Check if a value has been assigned to Gapped data member.
void ResetLambda(void)
Reset Lambda data member.
TH & SetH(void)
Assign a value to H data member.
TLambda GetLambda(void) const
Get the Lambda member data.
void ResetH(void)
Reset H data member.
bool IsSetLambda(void) const
Check if a value has been assigned to Lambda data member.
bool CanGetGapped(void) const
Check if it is safe to call GetGapped method.
bool CanGetK(void) const
Check if it is safe to call GetK method.
bool CanGetLambda(void) const
Check if it is safe to call GetLambda method.
bool IsSetK(void) const
Check if a value has been assigned to K data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
TH GetH(void) const
Get the H member data.
void ResetK(void)
Reset K data member.
CBlast4_ka_block_Base & operator=(const CBlast4_ka_block_Base &)
bool IsSetH(void) const
Check if a value has been assigned to H data member.
CBlast4_ka_block_Base(const CBlast4_ka_block_Base &)
TK & SetK(void)
Assign a value to K data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:07:12 2024 by modify_doxy.py rev. 669887