NCBI C++ ToolKit
Org_ref_.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 Org_ref_.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_ORG_REF_BASE_HPP
42 #define OBJECTS_SEQFEAT_ORG_REF_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 #include <vector>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CDbtag;
63 class COrgName;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Organism
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///*** Org-ref ***********************************************
76 ///*
77 ///* Reference to an organism
78 ///* defines only the organism.. lower levels of detail for biological
79 ///* molecules are provided by the Source object
80 ///*
81 ///
82 /// COrg_ref_Base --
83 ///
84 
86 {
88 public:
89  // constructor
90  COrg_ref_Base(void);
91  // destructor
92  virtual ~COrg_ref_Base(void);
93 
94  // type info
96 
97  // types
98  typedef string TTaxname;
99  typedef string TCommon;
100  typedef list< string > TMod;
101  typedef vector< CRef< CDbtag > > TDb;
102  typedef list< string > TSyn;
104 
105  // member index
106  enum class E_memberIndex {
107  e__allMandatory = 0,
108  e_taxname,
109  e_common,
110  e_mod,
111  e_db,
112  e_syn,
113  e_orgname
114  };
116 
117  // getters
118  // setters
119 
120  /// preferred formal name
121  /// Check if a value has been assigned to Taxname data member.
122  ///
123  /// Data member Taxname is optional;
124  /// its type is defined as 'typedef string TTaxname'
125  /// @return
126  /// - true, if a value has been assigned.
127  /// - false, otherwise.
128  bool IsSetTaxname(void) const;
129 
130  /// Check if it is safe to call GetTaxname method.
131  ///
132  /// @return
133  /// - true, if the data member is getatable.
134  /// - false, otherwise.
135  bool CanGetTaxname(void) const;
136 
137  /// Reset Taxname data member.
138  void ResetTaxname(void);
139 
140  /// Get the Taxname member data.
141  ///
142  /// @return
143  /// Reference to the member data.
144  const TTaxname& GetTaxname(void) const;
145 
146  /// Assign a value to Taxname data member.
147  ///
148  /// @param value
149  /// Value to assign
150  void SetTaxname(const TTaxname& value);
151  void SetTaxname(TTaxname&& value);
152 
153  /// Assign a value to Taxname data member.
154  ///
155  /// @return
156  /// Reference to the data value.
157  TTaxname& SetTaxname(void);
158 
159  /// common name
160  /// Check if a value has been assigned to Common data member.
161  ///
162  /// Data member Common is optional;
163  /// its type is defined as 'typedef string TCommon'
164  /// @return
165  /// - true, if a value has been assigned.
166  /// - false, otherwise.
167  bool IsSetCommon(void) const;
168 
169  /// Check if it is safe to call GetCommon method.
170  ///
171  /// @return
172  /// - true, if the data member is getatable.
173  /// - false, otherwise.
174  bool CanGetCommon(void) const;
175 
176  /// Reset Common data member.
177  void ResetCommon(void);
178 
179  /// Get the Common member data.
180  ///
181  /// @return
182  /// Reference to the member data.
183  const TCommon& GetCommon(void) const;
184 
185  /// Assign a value to Common data member.
186  ///
187  /// @param value
188  /// Value to assign
189  void SetCommon(const TCommon& value);
190  void SetCommon(TCommon&& value);
191 
192  /// Assign a value to Common data member.
193  ///
194  /// @return
195  /// Reference to the data value.
196  TCommon& SetCommon(void);
197 
198  /// unstructured modifiers
199  /// Check if a value has been assigned to Mod data member.
200  ///
201  /// Data member Mod is optional;
202  /// its type is defined as 'typedef list< string > TMod'
203  /// @return
204  /// - true, if a value has been assigned.
205  /// - false, otherwise.
206  bool IsSetMod(void) const;
207 
208  /// Check if it is safe to call GetMod method.
209  ///
210  /// @return
211  /// - true, if the data member is getatable.
212  /// - false, otherwise.
213  bool CanGetMod(void) const;
214 
215  /// Reset Mod data member.
216  void ResetMod(void);
217 
218  /// Get the Mod member data.
219  ///
220  /// @return
221  /// Reference to the member data.
222  const TMod& GetMod(void) const;
223 
224  /// Assign a value to Mod data member.
225  ///
226  /// @return
227  /// Reference to the data value.
228  TMod& SetMod(void);
229 
230  /// ids in taxonomic or culture dbases
231  /// Check if a value has been assigned to Db data member.
232  ///
233  /// Data member Db is optional;
234  /// its type is defined as 'typedef vector< CRef< CDbtag > > TDb'
235  /// @return
236  /// - true, if a value has been assigned.
237  /// - false, otherwise.
238  bool IsSetDb(void) const;
239 
240  /// Check if it is safe to call GetDb method.
241  ///
242  /// @return
243  /// - true, if the data member is getatable.
244  /// - false, otherwise.
245  bool CanGetDb(void) const;
246 
247  /// Reset Db data member.
248  void ResetDb(void);
249 
250  /// Get the Db member data.
251  ///
252  /// @return
253  /// Reference to the member data.
254  const TDb& GetDb(void) const;
255 
256  /// Assign a value to Db data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TDb& SetDb(void);
261 
262  /// synonyms for taxname or common
263  /// Check if a value has been assigned to Syn data member.
264  ///
265  /// Data member Syn is optional;
266  /// its type is defined as 'typedef list< string > TSyn'
267  /// @return
268  /// - true, if a value has been assigned.
269  /// - false, otherwise.
270  bool IsSetSyn(void) const;
271 
272  /// Check if it is safe to call GetSyn method.
273  ///
274  /// @return
275  /// - true, if the data member is getatable.
276  /// - false, otherwise.
277  bool CanGetSyn(void) const;
278 
279  /// Reset Syn data member.
280  void ResetSyn(void);
281 
282  /// Get the Syn member data.
283  ///
284  /// @return
285  /// Reference to the member data.
286  const TSyn& GetSyn(void) const;
287 
288  /// Assign a value to Syn data member.
289  ///
290  /// @return
291  /// Reference to the data value.
292  TSyn& SetSyn(void);
293 
294  /// Check if a value has been assigned to Orgname data member.
295  ///
296  /// Data member Orgname is optional;
297  /// its type is defined as 'typedef COrgName TOrgname'
298  /// @return
299  /// - true, if a value has been assigned.
300  /// - false, otherwise.
301  bool IsSetOrgname(void) const;
302 
303  /// Check if it is safe to call GetOrgname method.
304  ///
305  /// @return
306  /// - true, if the data member is getatable.
307  /// - false, otherwise.
308  bool CanGetOrgname(void) const;
309 
310  /// Reset Orgname data member.
311  void ResetOrgname(void);
312 
313  /// Get the Orgname member data.
314  ///
315  /// @return
316  /// Reference to the member data.
317  const TOrgname& GetOrgname(void) const;
318 
319  /// Assign a value to Orgname data member.
320  ///
321  /// @param value
322  /// Reference to value.
323  void SetOrgname(TOrgname& value);
324 
325  /// Assign a value to Orgname data member.
326  ///
327  /// @return
328  /// Reference to the data value.
329  TOrgname& SetOrgname(void);
330 
331  /// Reset the whole object
332  virtual void Reset(void);
333 
334 
335 private:
336  // Prohibit copy constructor and assignment operator
339 
340  // data
341  Uint4 m_set_State[1];
342  string m_Taxname;
343  string m_Common;
344  list< string > m_Mod;
345  vector< CRef< CDbtag > > m_Db;
346  list< string > m_Syn;
348 };
349 
350 /* @} */
351 
352 
353 
354 
355 
356 ///////////////////////////////////////////////////////////
357 ///////////////////// inline methods //////////////////////
358 ///////////////////////////////////////////////////////////
359 inline
361 {
362  return ((m_set_State[0] & 0x3) != 0);
363 }
364 
365 inline
367 {
368  return IsSetTaxname();
369 }
370 
371 inline
373 {
374  if (!CanGetTaxname()) {
375  ThrowUnassigned(0);
376  }
377  return m_Taxname;
378 }
379 
380 inline
382 {
383  m_Taxname = value;
384  m_set_State[0] |= 0x3;
385 }
386 
387 inline
389 {
390  m_Taxname = std::forward<COrg_ref_Base::TTaxname>(value);
391  m_set_State[0] |= 0x3;
392 }
393 
394 inline
396 {
397 #ifdef _DEBUG
398  if (!IsSetTaxname()) {
400  }
401 #endif
402  m_set_State[0] |= 0x1;
403  return m_Taxname;
404 }
405 
406 inline
408 {
409  return ((m_set_State[0] & 0xc) != 0);
410 }
411 
412 inline
414 {
415  return IsSetCommon();
416 }
417 
418 inline
420 {
421  if (!CanGetCommon()) {
422  ThrowUnassigned(1);
423  }
424  return m_Common;
425 }
426 
427 inline
429 {
430  m_Common = value;
431  m_set_State[0] |= 0xc;
432 }
433 
434 inline
436 {
437  m_Common = std::forward<COrg_ref_Base::TCommon>(value);
438  m_set_State[0] |= 0xc;
439 }
440 
441 inline
443 {
444 #ifdef _DEBUG
445  if (!IsSetCommon()) {
447  }
448 #endif
449  m_set_State[0] |= 0x4;
450  return m_Common;
451 }
452 
453 inline
454 bool COrg_ref_Base::IsSetMod(void) const
455 {
456  return ((m_set_State[0] & 0x30) != 0);
457 }
458 
459 inline
460 bool COrg_ref_Base::CanGetMod(void) const
461 {
462  return true;
463 }
464 
465 inline
467 {
468  return m_Mod;
469 }
470 
471 inline
473 {
474  m_set_State[0] |= 0x10;
475  return m_Mod;
476 }
477 
478 inline
479 bool COrg_ref_Base::IsSetDb(void) const
480 {
481  return ((m_set_State[0] & 0xc0) != 0);
482 }
483 
484 inline
485 bool COrg_ref_Base::CanGetDb(void) const
486 {
487  return true;
488 }
489 
490 inline
492 {
493  return m_Db;
494 }
495 
496 inline
498 {
499  m_set_State[0] |= 0x40;
500  return m_Db;
501 }
502 
503 inline
504 bool COrg_ref_Base::IsSetSyn(void) const
505 {
506  return ((m_set_State[0] & 0x300) != 0);
507 }
508 
509 inline
510 bool COrg_ref_Base::CanGetSyn(void) const
511 {
512  return true;
513 }
514 
515 inline
517 {
518  return m_Syn;
519 }
520 
521 inline
523 {
524  m_set_State[0] |= 0x100;
525  return m_Syn;
526 }
527 
528 inline
530 {
531  return m_Orgname.NotEmpty();
532 }
533 
534 inline
536 {
537  return IsSetOrgname();
538 }
539 
540 inline
542 {
543  if (!CanGetOrgname()) {
544  ThrowUnassigned(5);
545  }
546  return (*m_Orgname);
547 }
548 
549 ///////////////////////////////////////////////////////////
550 ////////////////// end of inline methods //////////////////
551 ///////////////////////////////////////////////////////////
552 
553 
554 
555 
556 
557 END_objects_SCOPE // namespace ncbi::objects::
558 
560 
561 
562 #endif // OBJECTS_SEQFEAT_ORG_REF_BASE_HPP
Definition: Dbtag.hpp:53
*** Org-ref *********************************************** * * Reference to an organism * defines on...
Definition: Org_ref_.hpp:86
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
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 IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
Definition: Org_ref_.hpp:479
TCommon & SetCommon(void)
Assign a value to Common data member.
Definition: Org_ref_.hpp:442
COrgName TOrgname
Definition: Org_ref_.hpp:103
bool CanGetMod(void) const
Check if it is safe to call GetMod method.
Definition: Org_ref_.hpp:460
list< string > TMod
Definition: Org_ref_.hpp:100
bool CanGetCommon(void) const
Check if it is safe to call GetCommon method.
Definition: Org_ref_.hpp:413
vector< CRef< CDbtag > > m_Db
Definition: Org_ref_.hpp:345
list< string > m_Syn
Definition: Org_ref_.hpp:346
CRef< TOrgname > m_Orgname
Definition: Org_ref_.hpp:347
Uint4 m_set_State[1]
Definition: Org_ref_.hpp:341
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
Definition: Org_ref_.hpp:115
TTaxname & SetTaxname(void)
Assign a value to Taxname data member.
Definition: Org_ref_.hpp:395
bool CanGetSyn(void) const
Check if it is safe to call GetSyn method.
Definition: Org_ref_.hpp:510
COrg_ref_Base & operator=(const COrg_ref_Base &)
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
Definition: Org_ref_.hpp:407
TDb & SetDb(void)
Assign a value to Db data member.
Definition: Org_ref_.hpp:497
vector< CRef< CDbtag > > TDb
Definition: Org_ref_.hpp:101
bool IsSetMod(void) const
unstructured modifiers Check if a value has been assigned to Mod data member.
Definition: Org_ref_.hpp:454
TSyn & SetSyn(void)
Assign a value to Syn data member.
Definition: Org_ref_.hpp:522
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:372
string m_Taxname
Definition: Org_ref_.hpp:342
const TCommon & GetCommon(void) const
Get the Common member data.
Definition: Org_ref_.hpp:419
const TDb & GetDb(void) const
Get the Db member data.
Definition: Org_ref_.hpp:491
const TSyn & GetSyn(void) const
Get the Syn member data.
Definition: Org_ref_.hpp:516
string m_Common
Definition: Org_ref_.hpp:343
bool CanGetTaxname(void) const
Check if it is safe to call GetTaxname method.
Definition: Org_ref_.hpp:366
string TTaxname
Definition: Org_ref_.hpp:98
string TCommon
Definition: Org_ref_.hpp:99
DECLARE_INTERNAL_TYPE_INFO()
list< string > m_Mod
Definition: Org_ref_.hpp:344
bool CanGetOrgname(void) const
Check if it is safe to call GetOrgname method.
Definition: Org_ref_.hpp:535
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
Definition: Org_ref_.hpp:529
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
Definition: Org_ref_.hpp:360
TMod & SetMod(void)
Assign a value to Mod data member.
Definition: Org_ref_.hpp:472
bool CanGetDb(void) const
Check if it is safe to call GetDb method.
Definition: Org_ref_.hpp:485
const TMod & GetMod(void) const
Get the Mod member data.
Definition: Org_ref_.hpp:466
bool IsSetSyn(void) const
synonyms for taxname or common Check if a value has been assigned to Syn data member.
Definition: Org_ref_.hpp:504
COrg_ref_Base(const COrg_ref_Base &)
list< string > TSyn
Definition: Org_ref_.hpp:102
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
Definition: Org_ref_.hpp:541
CSerialObject Tparent
Definition: Org_ref_.hpp:87
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void ResetOrgname(CRef< objects::CSeq_entry > entry)
void SetTaxname(CRef< objects::CSeq_entry > entry, string taxname)
void SetCommon(CRef< objects::CSeq_entry > entry, string common)
Modified on Fri Sep 20 14:57:02 2024 by modify_doxy.py rev. 669887