NCBI C++ ToolKit
InferenceSupport_.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 InferenceSupport_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_INFERENCESUPPORT_BASE_HPP
42 #define OBJECTS_SEQFEAT_INFERENCESUPPORT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 #include <objects/biblio/DOI.hpp>
53 
55 
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
59 #endif
60 BEGIN_objects_SCOPE // namespace ncbi::objects::
61 
62 
63 // forward declarations
64 class CEvidenceBasis;
65 
66 
67 // generated classes
68 
69 
70 /** @addtogroup dataspec_NCBI_Seqfeat
71  *
72  * @{
73  */
74 
75 /////////////////////////////////////////////////////////////////////////////
76 ///
77 /// CInferenceSupport_Base --
78 ///
79 
81 {
83 public:
84  // constructor
86  // destructor
87  virtual ~CInferenceSupport_Base(void);
88 
89  // type info
91 
92  enum EType {
93  eType_not_set = 0,
94  eType_similar_to_sequence = 1,
95  eType_similar_to_aa = 2,
96  eType_similar_to_dna = 3,
97  eType_similar_to_rna = 4,
98  eType_similar_to_mrna = 5,
99  eType_similiar_to_est = 6,
100  eType_similar_to_other_rna = 7,
101  eType_profile = 8,
102  eType_nucleotide_motif = 9,
103  eType_protein_motif = 10,
104  eType_ab_initio_prediction = 11,
105  eType_alignment = 12,
106  eType_other = 255
107  };
108 
109  /// Access to EType's attributes (values, names) as defined in spec
110  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
111 
112  // types
113  typedef int TCategory;
114  typedef int TType;
115  typedef string TOther_type;
116  typedef bool TSame_species;
118  typedef list< CPubMedId > TPmids;
119  typedef list< CDOI > TDois;
120 
121  // member index
122  enum class E_memberIndex {
123  e__allMandatory = 0,
124  e_category,
125  e_type,
126  e_other_type,
127  e_same_species,
128  e_basis,
129  e_pmids,
130  e_dois
131  };
133 
134  // getters
135  // setters
136 
137  /// Check if a value has been assigned to Category data member.
138  ///
139  /// Data member Category is optional;
140  /// its type is defined as 'typedef int TCategory'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetCategory(void) const;
145 
146  /// Check if it is safe to call GetCategory method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetCategory(void) const;
152 
153  /// Reset Category data member.
154  void ResetCategory(void);
155 
156  /// Get the Category member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TCategory GetCategory(void) const;
161 
162  /// Assign a value to Category data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetCategory(TCategory value);
167 
168  /// Assign a value to Category data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TCategory& SetCategory(void);
173 
174  /// Check if a value has been assigned to Type data member.
175  ///
176  /// Data member Type is optional with default eType_not_set;
177  /// its type is defined as 'typedef int TType'
178  /// @return
179  /// - true, if a value has been assigned.
180  /// - false, otherwise.
181  bool IsSetType(void) const;
182 
183  /// Check if it is safe to call GetType method.
184  ///
185  /// @return
186  /// - true, if the data member is getatable.
187  /// - false, otherwise.
188  bool CanGetType(void) const;
189 
190  /// Reset Type data member.
191  void ResetType(void);
192 
193  /// Assign default value to Type data member.
194  void SetDefaultType(void);
195 
196  /// Get the Type member data.
197  ///
198  /// @return
199  /// Copy of the member data.
200  TType GetType(void) const;
201 
202  /// Assign a value to Type data member.
203  ///
204  /// @param value
205  /// Value to assign
206  void SetType(TType value);
207 
208  /// Assign a value to Type data member.
209  ///
210  /// @return
211  /// Reference to the data value.
212  TType& SetType(void);
213 
214  /// Check if a value has been assigned to Other_type data member.
215  ///
216  /// Data member Other_type is optional;
217  /// its type is defined as 'typedef string TOther_type'
218  /// @return
219  /// - true, if a value has been assigned.
220  /// - false, otherwise.
221  bool IsSetOther_type(void) const;
222 
223  /// Check if it is safe to call GetOther_type method.
224  ///
225  /// @return
226  /// - true, if the data member is getatable.
227  /// - false, otherwise.
228  bool CanGetOther_type(void) const;
229 
230  /// Reset Other_type data member.
231  void ResetOther_type(void);
232 
233  /// Get the Other_type member data.
234  ///
235  /// @return
236  /// Reference to the member data.
237  const TOther_type& GetOther_type(void) const;
238 
239  /// Assign a value to Other_type data member.
240  ///
241  /// @param value
242  /// Value to assign
243  void SetOther_type(const TOther_type& value);
244  void SetOther_type(TOther_type&& value);
245 
246  /// Assign a value to Other_type data member.
247  ///
248  /// @return
249  /// Reference to the data value.
250  TOther_type& SetOther_type(void);
251 
252  /// Check if a value has been assigned to Same_species data member.
253  ///
254  /// Data member Same_species is optional with default false;
255  /// its type is defined as 'typedef bool TSame_species'
256  /// @return
257  /// - true, if a value has been assigned.
258  /// - false, otherwise.
259  bool IsSetSame_species(void) const;
260 
261  /// Check if it is safe to call GetSame_species method.
262  ///
263  /// @return
264  /// - true, if the data member is getatable.
265  /// - false, otherwise.
266  bool CanGetSame_species(void) const;
267 
268  /// Reset Same_species data member.
269  void ResetSame_species(void);
270 
271  /// Assign default value to Same_species data member.
272  void SetDefaultSame_species(void);
273 
274  /// Get the Same_species member data.
275  ///
276  /// @return
277  /// Copy of the member data.
278  TSame_species GetSame_species(void) const;
279 
280  /// Assign a value to Same_species data member.
281  ///
282  /// @param value
283  /// Value to assign
284  void SetSame_species(TSame_species value);
285 
286  /// Assign a value to Same_species data member.
287  ///
288  /// @return
289  /// Reference to the data value.
290  TSame_species& SetSame_species(void);
291 
292  /// Check if a value has been assigned to Basis data member.
293  ///
294  /// Data member Basis is mandatory;
295  /// its type is defined as 'typedef CEvidenceBasis TBasis'
296  /// @return
297  /// - true, if a value has been assigned.
298  /// - false, otherwise.
299  bool IsSetBasis(void) const;
300 
301  /// Check if it is safe to call GetBasis method.
302  ///
303  /// @return
304  /// - true, if the data member is getatable.
305  /// - false, otherwise.
306  bool CanGetBasis(void) const;
307 
308  /// Reset Basis data member.
309  void ResetBasis(void);
310 
311  /// Get the Basis member data.
312  ///
313  /// @return
314  /// Reference to the member data.
315  const TBasis& GetBasis(void) const;
316 
317  /// Assign a value to Basis data member.
318  ///
319  /// @param value
320  /// Reference to value.
321  void SetBasis(TBasis& value);
322 
323  /// Assign a value to Basis data member.
324  ///
325  /// @return
326  /// Reference to the data value.
327  TBasis& SetBasis(void);
328 
329  /// Check if a value has been assigned to Pmids data member.
330  ///
331  /// Data member Pmids is optional;
332  /// its type is defined as 'typedef list< CPubMedId > TPmids'
333  /// @return
334  /// - true, if a value has been assigned.
335  /// - false, otherwise.
336  bool IsSetPmids(void) const;
337 
338  /// Check if it is safe to call GetPmids method.
339  ///
340  /// @return
341  /// - true, if the data member is getatable.
342  /// - false, otherwise.
343  bool CanGetPmids(void) const;
344 
345  /// Reset Pmids data member.
346  void ResetPmids(void);
347 
348  /// Get the Pmids member data.
349  ///
350  /// @return
351  /// Reference to the member data.
352  const TPmids& GetPmids(void) const;
353 
354  /// Assign a value to Pmids data member.
355  ///
356  /// @return
357  /// Reference to the data value.
358  TPmids& SetPmids(void);
359 
360  /// Check if a value has been assigned to Dois data member.
361  ///
362  /// Data member Dois is optional;
363  /// its type is defined as 'typedef list< CDOI > TDois'
364  /// @return
365  /// - true, if a value has been assigned.
366  /// - false, otherwise.
367  bool IsSetDois(void) const;
368 
369  /// Check if it is safe to call GetDois method.
370  ///
371  /// @return
372  /// - true, if the data member is getatable.
373  /// - false, otherwise.
374  bool CanGetDois(void) const;
375 
376  /// Reset Dois data member.
377  void ResetDois(void);
378 
379  /// Get the Dois member data.
380  ///
381  /// @return
382  /// Reference to the member data.
383  const TDois& GetDois(void) const;
384 
385  /// Assign a value to Dois data member.
386  ///
387  /// @return
388  /// Reference to the data value.
389  TDois& SetDois(void);
390 
391  /// Reset the whole object
392  virtual void Reset(void);
393 
394 
395 private:
396  // Prohibit copy constructor and assignment operator
399 
400  // data
401  Uint4 m_set_State[1];
403  int m_Type;
404  string m_Other_type;
407  list< CPubMedId > m_Pmids;
408  list< CDOI > m_Dois;
409 };
410 
411 /* @} */
412 
413 
414 
415 
416 
417 ///////////////////////////////////////////////////////////
418 ///////////////////// inline methods //////////////////////
419 ///////////////////////////////////////////////////////////
420 inline
422 {
423  return ((m_set_State[0] & 0x3) != 0);
424 }
425 
426 inline
428 {
429  return IsSetCategory();
430 }
431 
432 inline
434 {
435  m_Category = (int)(0);
436  m_set_State[0] &= ~0x3;
437 }
438 
439 inline
441 {
442  if (!CanGetCategory()) {
443  ThrowUnassigned(0);
444  }
445  return m_Category;
446 }
447 
448 inline
450 {
451  m_Category = value;
452  m_set_State[0] |= 0x3;
453 }
454 
455 inline
457 {
458 #ifdef _DEBUG
459  if (!IsSetCategory()) {
460  memset(&m_Category,UnassignedByte(),sizeof(m_Category));
461  }
462 #endif
463  m_set_State[0] |= 0x1;
464  return m_Category;
465 }
466 
467 inline
469 {
470  return ((m_set_State[0] & 0xc) != 0);
471 }
472 
473 inline
475 {
476  return true;
477 }
478 
479 inline
481 {
483  m_set_State[0] &= ~0xc;
484 }
485 
486 inline
488 {
489  ResetType();
490 }
491 
492 inline
494 {
495  return m_Type;
496 }
497 
498 inline
500 {
501  m_Type = value;
502  m_set_State[0] |= 0xc;
503 }
504 
505 inline
507 {
508 #ifdef _DEBUG
509  if (!IsSetType()) {
510  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
511  }
512 #endif
513  m_set_State[0] |= 0x4;
514  return m_Type;
515 }
516 
517 inline
519 {
520  return ((m_set_State[0] & 0x30) != 0);
521 }
522 
523 inline
525 {
526  return IsSetOther_type();
527 }
528 
529 inline
531 {
532  if (!CanGetOther_type()) {
533  ThrowUnassigned(2);
534  }
535  return m_Other_type;
536 }
537 
538 inline
540 {
542  m_set_State[0] |= 0x30;
543 }
544 
545 inline
547 {
548  m_Other_type = std::forward<CInferenceSupport_Base::TOther_type>(value);
549  m_set_State[0] |= 0x30;
550 }
551 
552 inline
554 {
555 #ifdef _DEBUG
556  if (!IsSetOther_type()) {
558  }
559 #endif
560  m_set_State[0] |= 0x10;
561  return m_Other_type;
562 }
563 
564 inline
566 {
567  return ((m_set_State[0] & 0xc0) != 0);
568 }
569 
570 inline
572 {
573  return true;
574 }
575 
576 inline
578 {
579  m_Same_species = false;
580  m_set_State[0] &= ~0xc0;
581 }
582 
583 inline
585 {
587 }
588 
589 inline
591 {
592  return m_Same_species;
593 }
594 
595 inline
597 {
599  m_set_State[0] |= 0xc0;
600 }
601 
602 inline
604 {
605 #ifdef _DEBUG
606  if (!IsSetSame_species()) {
607  memset(&m_Same_species,UnassignedByte(),sizeof(m_Same_species));
608  }
609 #endif
610  m_set_State[0] |= 0x40;
611  return m_Same_species;
612 }
613 
614 inline
616 {
617  return m_Basis.NotEmpty();
618 }
619 
620 inline
622 {
623  return true;
624 }
625 
626 inline
628 {
629  if ( !m_Basis ) {
630  const_cast<CInferenceSupport_Base*>(this)->ResetBasis();
631  }
632  return (*m_Basis);
633 }
634 
635 inline
637 {
638  if ( !m_Basis ) {
639  ResetBasis();
640  }
641  return (*m_Basis);
642 }
643 
644 inline
646 {
647  return ((m_set_State[0] & 0xc00) != 0);
648 }
649 
650 inline
652 {
653  return true;
654 }
655 
656 inline
658 {
659  return m_Pmids;
660 }
661 
662 inline
664 {
665  m_set_State[0] |= 0x400;
666  return m_Pmids;
667 }
668 
669 inline
671 {
672  return ((m_set_State[0] & 0x3000) != 0);
673 }
674 
675 inline
677 {
678  return true;
679 }
680 
681 inline
683 {
684  return m_Dois;
685 }
686 
687 inline
689 {
690  m_set_State[0] |= 0x1000;
691  return m_Dois;
692 }
693 
694 ///////////////////////////////////////////////////////////
695 ////////////////// end of inline methods //////////////////
696 ///////////////////////////////////////////////////////////
697 
698 
699 
700 
701 
702 END_objects_SCOPE // namespace ncbi::objects::
703 
705 
706 
707 #endif // OBJECTS_SEQFEAT_INFERENCESUPPORT_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.
CEvidenceBasis –.
CInferenceSupport_Base –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
void ResetType(void)
Reset Type data member.
TCategory & SetCategory(void)
Assign a value to Category data member.
const TDois & GetDois(void) const
Get the Dois member data.
TDois & SetDois(void)
Assign a value to Dois data member.
void SetDefaultSame_species(void)
Assign default value to Same_species data member.
TBasis & SetBasis(void)
Assign a value to Basis data member.
bool IsSetBasis(void) const
Check if a value has been assigned to Basis data member.
bool IsSetDois(void) const
Check if a value has been assigned to Dois data member.
void ResetCategory(void)
Reset Category data member.
TCategory GetCategory(void) const
Get the Category member data.
bool CanGetDois(void) const
Check if it is safe to call GetDois method.
void ResetBasis(void)
Reset Basis data member.
TType & SetType(void)
Assign a value to Type data member.
TType GetType(void) const
Get the Type member data.
bool CanGetType(void) const
Check if it is safe to call GetType method.
const TOther_type & GetOther_type(void) const
Get the Other_type member data.
bool IsSetOther_type(void) const
Check if a value has been assigned to Other_type data member.
bool CanGetCategory(void) const
Check if it is safe to call GetCategory method.
CInferenceSupport_Base & operator=(const CInferenceSupport_Base &)
bool IsSetSame_species(void) const
Check if a value has been assigned to Same_species data member.
bool IsSetPmids(void) const
Check if a value has been assigned to Pmids data member.
const TPmids & GetPmids(void) const
Get the Pmids member data.
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
TSame_species & SetSame_species(void)
Assign a value to Same_species data member.
TSame_species GetSame_species(void) const
Get the Same_species member data.
void ResetSame_species(void)
Reset Same_species data member.
bool CanGetBasis(void) const
Check if it is safe to call GetBasis method.
TPmids & SetPmids(void)
Assign a value to Pmids data member.
bool IsSetCategory(void) const
Check if a value has been assigned to Category data member.
bool CanGetSame_species(void) const
Check if it is safe to call GetSame_species method.
CInferenceSupport_Base(const CInferenceSupport_Base &)
TOther_type & SetOther_type(void)
Assign a value to Other_type data member.
bool CanGetOther_type(void) const
Check if it is safe to call GetOther_type method.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
bool CanGetPmids(void) const
Check if it is safe to call GetPmids method.
const TBasis & GetBasis(void) const
Get the Basis member data.
void SetDefaultType(void)
Assign default value to Type data member.
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue May 28 05:49:43 2024 by modify_doxy.py rev. 669887