NCBI C++ ToolKit
Phenotype_.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 Phenotype_.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_PHENOTYPE_BASE_HPP
42 #define OBJECTS_SEQFEAT_PHENOTYPE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CDbtag;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Variation
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CPhenotype_Base --
75 ///
76 
78 {
80 public:
81  // constructor
82  CPhenotype_Base(void);
83  // destructor
84  virtual ~CPhenotype_Base(void);
85 
86  // type info
88 
89  /// does this variant have known clinical significance?
91  eClinical_significance_unknown = 0,
92  eClinical_significance_untested = 1,
93  eClinical_significance_non_pathogenic = 2,
94  eClinical_significance_probable_non_pathogenic = 3,
95  eClinical_significance_probable_pathogenic = 4,
96  eClinical_significance_pathogenic = 5,
97  eClinical_significance_drug_response = 6,
98  eClinical_significance_histocompatibility = 7,
99  eClinical_significance_other = 255
100  };
101 
102  /// Access to EClinical_significance's attributes (values, names) as defined in spec
103  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EClinical_significance)(void);
104 
105  // types
106  typedef string TSource;
107  typedef string TTerm;
108  typedef list< CRef< CDbtag > > TXref;
110 
111  // member index
112  enum class E_memberIndex {
113  e__allMandatory = 0,
114  e_source,
115  e_term,
116  e_xref,
117  e_clinical_significance
118  };
120 
121  // getters
122  // setters
123 
124  /// Check if a value has been assigned to Source data member.
125  ///
126  /// Data member Source is optional;
127  /// its type is defined as 'typedef string TSource'
128  /// @return
129  /// - true, if a value has been assigned.
130  /// - false, otherwise.
131  bool IsSetSource(void) const;
132 
133  /// Check if it is safe to call GetSource method.
134  ///
135  /// @return
136  /// - true, if the data member is getatable.
137  /// - false, otherwise.
138  bool CanGetSource(void) const;
139 
140  /// Reset Source data member.
141  void ResetSource(void);
142 
143  /// Get the Source member data.
144  ///
145  /// @return
146  /// Reference to the member data.
147  const TSource& GetSource(void) const;
148 
149  /// Assign a value to Source data member.
150  ///
151  /// @param value
152  /// Value to assign
153  void SetSource(const TSource& value);
154  void SetSource(TSource&& value);
155 
156  /// Assign a value to Source data member.
157  ///
158  /// @return
159  /// Reference to the data value.
160  TSource& SetSource(void);
161 
162  /// Check if a value has been assigned to Term data member.
163  ///
164  /// Data member Term is optional;
165  /// its type is defined as 'typedef string TTerm'
166  /// @return
167  /// - true, if a value has been assigned.
168  /// - false, otherwise.
169  bool IsSetTerm(void) const;
170 
171  /// Check if it is safe to call GetTerm method.
172  ///
173  /// @return
174  /// - true, if the data member is getatable.
175  /// - false, otherwise.
176  bool CanGetTerm(void) const;
177 
178  /// Reset Term data member.
179  void ResetTerm(void);
180 
181  /// Get the Term member data.
182  ///
183  /// @return
184  /// Reference to the member data.
185  const TTerm& GetTerm(void) const;
186 
187  /// Assign a value to Term data member.
188  ///
189  /// @param value
190  /// Value to assign
191  void SetTerm(const TTerm& value);
192  void SetTerm(TTerm&& value);
193 
194  /// Assign a value to Term data member.
195  ///
196  /// @return
197  /// Reference to the data value.
198  TTerm& SetTerm(void);
199 
200  /// Check if a value has been assigned to Xref data member.
201  ///
202  /// Data member Xref is optional;
203  /// its type is defined as 'typedef list< CRef< CDbtag > > TXref'
204  /// @return
205  /// - true, if a value has been assigned.
206  /// - false, otherwise.
207  bool IsSetXref(void) const;
208 
209  /// Check if it is safe to call GetXref method.
210  ///
211  /// @return
212  /// - true, if the data member is getatable.
213  /// - false, otherwise.
214  bool CanGetXref(void) const;
215 
216  /// Reset Xref data member.
217  void ResetXref(void);
218 
219  /// Get the Xref member data.
220  ///
221  /// @return
222  /// Reference to the member data.
223  const TXref& GetXref(void) const;
224 
225  /// Assign a value to Xref data member.
226  ///
227  /// @return
228  /// Reference to the data value.
229  TXref& SetXref(void);
230 
231  /// Check if a value has been assigned to Clinical_significance data member.
232  ///
233  /// Data member Clinical_significance is optional;
234  /// its type is defined as 'typedef int TClinical_significance'
235  /// @return
236  /// - true, if a value has been assigned.
237  /// - false, otherwise.
238  bool IsSetClinical_significance(void) const;
239 
240  /// Check if it is safe to call GetClinical_significance method.
241  ///
242  /// @return
243  /// - true, if the data member is getatable.
244  /// - false, otherwise.
245  bool CanGetClinical_significance(void) const;
246 
247  /// Reset Clinical_significance data member.
248  void ResetClinical_significance(void);
249 
250  /// Get the Clinical_significance member data.
251  ///
252  /// @return
253  /// Copy of the member data.
254  TClinical_significance GetClinical_significance(void) const;
255 
256  /// Assign a value to Clinical_significance data member.
257  ///
258  /// @param value
259  /// Value to assign
260  void SetClinical_significance(TClinical_significance value);
261 
262  /// Assign a value to Clinical_significance data member.
263  ///
264  /// @return
265  /// Reference to the data value.
266  TClinical_significance& SetClinical_significance(void);
267 
268  /// Reset the whole object
269  virtual void Reset(void);
270 
271 
272 private:
273  // Prohibit copy constructor and assignment operator
276 
277  // data
278  Uint4 m_set_State[1];
279  string m_Source;
280  string m_Term;
281  list< CRef< CDbtag > > m_Xref;
283 };
284 
285 /* @} */
286 
287 
288 
289 
290 
291 ///////////////////////////////////////////////////////////
292 ///////////////////// inline methods //////////////////////
293 ///////////////////////////////////////////////////////////
294 inline
296 {
297  return ((m_set_State[0] & 0x3) != 0);
298 }
299 
300 inline
302 {
303  return IsSetSource();
304 }
305 
306 inline
308 {
309  if (!CanGetSource()) {
310  ThrowUnassigned(0);
311  }
312  return m_Source;
313 }
314 
315 inline
317 {
318  m_Source = value;
319  m_set_State[0] |= 0x3;
320 }
321 
322 inline
324 {
325  m_Source = std::forward<CPhenotype_Base::TSource>(value);
326  m_set_State[0] |= 0x3;
327 }
328 
329 inline
331 {
332 #ifdef _DEBUG
333  if (!IsSetSource()) {
335  }
336 #endif
337  m_set_State[0] |= 0x1;
338  return m_Source;
339 }
340 
341 inline
343 {
344  return ((m_set_State[0] & 0xc) != 0);
345 }
346 
347 inline
349 {
350  return IsSetTerm();
351 }
352 
353 inline
355 {
356  if (!CanGetTerm()) {
357  ThrowUnassigned(1);
358  }
359  return m_Term;
360 }
361 
362 inline
364 {
365  m_Term = value;
366  m_set_State[0] |= 0xc;
367 }
368 
369 inline
371 {
372  m_Term = std::forward<CPhenotype_Base::TTerm>(value);
373  m_set_State[0] |= 0xc;
374 }
375 
376 inline
378 {
379 #ifdef _DEBUG
380  if (!IsSetTerm()) {
382  }
383 #endif
384  m_set_State[0] |= 0x4;
385  return m_Term;
386 }
387 
388 inline
390 {
391  return ((m_set_State[0] & 0x30) != 0);
392 }
393 
394 inline
396 {
397  return true;
398 }
399 
400 inline
402 {
403  return m_Xref;
404 }
405 
406 inline
408 {
409  m_set_State[0] |= 0x10;
410  return m_Xref;
411 }
412 
413 inline
415 {
416  return ((m_set_State[0] & 0xc0) != 0);
417 }
418 
419 inline
421 {
423 }
424 
425 inline
427 {
429  m_set_State[0] &= ~0xc0;
430 }
431 
432 inline
434 {
436  ThrowUnassigned(3);
437  }
439 }
440 
441 inline
443 {
445  m_set_State[0] |= 0xc0;
446 }
447 
448 inline
450 {
451 #ifdef _DEBUG
454  }
455 #endif
456  m_set_State[0] |= 0x40;
458 }
459 
460 ///////////////////////////////////////////////////////////
461 ////////////////// end of inline methods //////////////////
462 ///////////////////////////////////////////////////////////
463 
464 
465 
466 
467 
468 END_objects_SCOPE // namespace ncbi::objects::
469 
471 
472 
473 #endif // OBJECTS_SEQFEAT_PHENOTYPE_BASE_HPP
Definition: Dbtag.hpp:53
CPhenotype_Base –.
Definition: Phenotype_.hpp:78
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
bool CanGetSource(void) const
Check if it is safe to call GetSource method.
Definition: Phenotype_.hpp:301
CPhenotype_Base(const CPhenotype_Base &)
bool IsSetSource(void) const
Check if a value has been assigned to Source data member.
Definition: Phenotype_.hpp:295
TSource & SetSource(void)
Assign a value to Source data member.
Definition: Phenotype_.hpp:330
TClinical_significance GetClinical_significance(void) const
Get the Clinical_significance member data.
Definition: Phenotype_.hpp:433
TClinical_significance & SetClinical_significance(void)
Assign a value to Clinical_significance data member.
Definition: Phenotype_.hpp:449
const TSource & GetSource(void) const
Get the Source member data.
Definition: Phenotype_.hpp:307
bool CanGetXref(void) const
Check if it is safe to call GetXref method.
Definition: Phenotype_.hpp:395
CPhenotype_Base & operator=(const CPhenotype_Base &)
void ResetClinical_significance(void)
Reset Clinical_significance data member.
Definition: Phenotype_.hpp:426
bool CanGetTerm(void) const
Check if it is safe to call GetTerm method.
Definition: Phenotype_.hpp:348
CSerialObject Tparent
Definition: Phenotype_.hpp:79
const TTerm & GetTerm(void) const
Get the Term member data.
Definition: Phenotype_.hpp:354
bool IsSetClinical_significance(void) const
Check if a value has been assigned to Clinical_significance data member.
Definition: Phenotype_.hpp:414
bool CanGetClinical_significance(void) const
Check if it is safe to call GetClinical_significance method.
Definition: Phenotype_.hpp:420
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Phenotype_.hpp:119
TTerm & SetTerm(void)
Assign a value to Term data member.
Definition: Phenotype_.hpp:377
const TXref & GetXref(void) const
Get the Xref member data.
Definition: Phenotype_.hpp:401
list< CRef< CDbtag > > m_Xref
Definition: Phenotype_.hpp:281
bool IsSetTerm(void) const
Check if a value has been assigned to Term data member.
Definition: Phenotype_.hpp:342
TXref & SetXref(void)
Assign a value to Xref data member.
Definition: Phenotype_.hpp:407
int m_Clinical_significance
Definition: Phenotype_.hpp:282
Uint4 m_set_State[1]
Definition: Phenotype_.hpp:278
bool IsSetXref(void) const
Check if a value has been assigned to Xref data member.
Definition: Phenotype_.hpp:389
list< CRef< CDbtag > > TXref
Definition: Phenotype_.hpp:108
EClinical_significance
does this variant have known clinical significance?
Definition: Phenotype_.hpp:90
int TClinical_significance
Definition: Phenotype_.hpp:109
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Jun 16 04:33:46 2024 by modify_doxy.py rev. 669887