NCBI C++ ToolKit
OrgMod_.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 OrgMod_.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_ORGMOD_BASE_HPP
42 #define OBJECTS_SEQFEAT_ORGMOD_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_Organism
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// COrgMod_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  COrgMod_Base(void);
78  // destructor
79  virtual ~COrgMod_Base(void);
80 
81  // type info
83 
84  enum ESubtype {
85  eSubtype_strain = 2,
86  eSubtype_substrain = 3,
87  eSubtype_type = 4,
88  eSubtype_subtype = 5,
89  eSubtype_variety = 6,
90  eSubtype_serotype = 7,
91  eSubtype_serogroup = 8,
92  eSubtype_serovar = 9,
93  eSubtype_cultivar = 10,
94  eSubtype_pathovar = 11,
95  eSubtype_chemovar = 12,
96  eSubtype_biovar = 13,
97  eSubtype_biotype = 14,
98  eSubtype_group = 15,
99  eSubtype_subgroup = 16,
100  eSubtype_isolate = 17,
101  eSubtype_common = 18,
102  eSubtype_acronym = 19,
103  eSubtype_dosage = 20, ///< chromosome dosage of hybrid
104  eSubtype_nat_host = 21, ///< natural host of this specimen
105  eSubtype_sub_species = 22,
106  eSubtype_specimen_voucher = 23,
107  eSubtype_authority = 24,
108  eSubtype_forma = 25,
109  eSubtype_forma_specialis = 26,
110  eSubtype_ecotype = 27,
111  eSubtype_synonym = 28,
112  eSubtype_anamorph = 29,
113  eSubtype_teleomorph = 30,
114  eSubtype_breed = 31,
115  eSubtype_gb_acronym = 32, ///< used by taxonomy database
116  eSubtype_gb_anamorph = 33, ///< used by taxonomy database
117  eSubtype_gb_synonym = 34, ///< used by taxonomy database
118  eSubtype_culture_collection = 35,
119  eSubtype_bio_material = 36,
120  eSubtype_metagenome_source = 37,
121  eSubtype_type_material = 38,
122  eSubtype_nomenclature = 39, ///< code of nomenclature in subname (B,P,V,Z or combination)
123  eSubtype_old_lineage = 253,
124  eSubtype_old_name = 254,
125  eSubtype_other = 255 ///< ASN5: old-name (254) will be added to next spec
126  };
127 
128  /// Access to ESubtype's attributes (values, names) as defined in spec
129  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESubtype)(void);
130 
131  // types
132  typedef int TSubtype;
133  typedef string TSubname;
134  typedef string TAttrib;
135 
136  // member index
137  enum class E_memberIndex {
138  e__allMandatory = 0,
139  e_subtype,
140  e_subname,
141  e_attrib
142  };
144 
145  // getters
146  // setters
147 
148  /// Check if a value has been assigned to Subtype data member.
149  ///
150  /// Data member Subtype is mandatory;
151  /// its type is defined as 'typedef int TSubtype'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetSubtype(void) const;
156 
157  /// Check if it is safe to call GetSubtype method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetSubtype(void) const;
163 
164  /// Reset Subtype data member.
165  void ResetSubtype(void);
166 
167  /// Get the Subtype member data.
168  ///
169  /// @return
170  /// Copy of the member data.
171  TSubtype GetSubtype(void) const;
172 
173  /// Assign a value to Subtype data member.
174  ///
175  /// @param value
176  /// Value to assign
177  void SetSubtype(TSubtype value);
178 
179  /// Assign a value to Subtype data member.
180  ///
181  /// @return
182  /// Reference to the data value.
183  TSubtype& SetSubtype(void);
184 
185  /// Check if a value has been assigned to Subname data member.
186  ///
187  /// Data member Subname is mandatory;
188  /// its type is defined as 'typedef string TSubname'
189  /// @return
190  /// - true, if a value has been assigned.
191  /// - false, otherwise.
192  bool IsSetSubname(void) const;
193 
194  /// Check if it is safe to call GetSubname method.
195  ///
196  /// @return
197  /// - true, if the data member is getatable.
198  /// - false, otherwise.
199  bool CanGetSubname(void) const;
200 
201  /// Reset Subname data member.
202  void ResetSubname(void);
203 
204  /// Get the Subname member data.
205  ///
206  /// @return
207  /// Reference to the member data.
208  const TSubname& GetSubname(void) const;
209 
210  /// Assign a value to Subname data member.
211  ///
212  /// @param value
213  /// Value to assign
214  void SetSubname(const TSubname& value);
215  void SetSubname(TSubname&& value);
216 
217  /// Assign a value to Subname data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TSubname& SetSubname(void);
222 
223  /// attribution/source of name
224  /// Check if a value has been assigned to Attrib data member.
225  ///
226  /// Data member Attrib is optional;
227  /// its type is defined as 'typedef string TAttrib'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetAttrib(void) const;
232 
233  /// Check if it is safe to call GetAttrib method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetAttrib(void) const;
239 
240  /// Reset Attrib data member.
241  void ResetAttrib(void);
242 
243  /// Get the Attrib member data.
244  ///
245  /// @return
246  /// Reference to the member data.
247  const TAttrib& GetAttrib(void) const;
248 
249  /// Assign a value to Attrib data member.
250  ///
251  /// @param value
252  /// Value to assign
253  void SetAttrib(const TAttrib& value);
254  void SetAttrib(TAttrib&& value);
255 
256  /// Assign a value to Attrib data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TAttrib& SetAttrib(void);
261 
262  /// Reset the whole object
263  virtual void Reset(void);
264 
265 
266 private:
267  // Prohibit copy constructor and assignment operator
270 
271  // data
272  Uint4 m_set_State[1];
274  string m_Subname;
275  string m_Attrib;
276 };
277 
278 /* @} */
279 
280 
281 
282 
283 
284 ///////////////////////////////////////////////////////////
285 ///////////////////// inline methods //////////////////////
286 ///////////////////////////////////////////////////////////
287 inline
289 {
290  return ((m_set_State[0] & 0x3) != 0);
291 }
292 
293 inline
295 {
296  return IsSetSubtype();
297 }
298 
299 inline
301 {
302  m_Subtype = (ESubtype)(0);
303  m_set_State[0] &= ~0x3;
304 }
305 
306 inline
308 {
309  if (!CanGetSubtype()) {
310  ThrowUnassigned(0);
311  }
312  return m_Subtype;
313 }
314 
315 inline
317 {
318  m_Subtype = value;
319  m_set_State[0] |= 0x3;
320 }
321 
322 inline
324 {
325 #ifdef _DEBUG
326  if (!IsSetSubtype()) {
327  memset(&m_Subtype,UnassignedByte(),sizeof(m_Subtype));
328  }
329 #endif
330  m_set_State[0] |= 0x1;
331  return m_Subtype;
332 }
333 
334 inline
336 {
337  return ((m_set_State[0] & 0xc) != 0);
338 }
339 
340 inline
342 {
343  return IsSetSubname();
344 }
345 
346 inline
348 {
349  if (!CanGetSubname()) {
350  ThrowUnassigned(1);
351  }
352  return m_Subname;
353 }
354 
355 inline
357 {
358  m_Subname = value;
359  m_set_State[0] |= 0xc;
360 }
361 
362 inline
364 {
365  m_Subname = std::forward<COrgMod_Base::TSubname>(value);
366  m_set_State[0] |= 0xc;
367 }
368 
369 inline
371 {
372 #ifdef _DEBUG
373  if (!IsSetSubname()) {
375  }
376 #endif
377  m_set_State[0] |= 0x4;
378  return m_Subname;
379 }
380 
381 inline
383 {
384  return ((m_set_State[0] & 0x30) != 0);
385 }
386 
387 inline
389 {
390  return IsSetAttrib();
391 }
392 
393 inline
395 {
396  if (!CanGetAttrib()) {
397  ThrowUnassigned(2);
398  }
399  return m_Attrib;
400 }
401 
402 inline
404 {
405  m_Attrib = value;
406  m_set_State[0] |= 0x30;
407 }
408 
409 inline
411 {
412  m_Attrib = std::forward<COrgMod_Base::TAttrib>(value);
413  m_set_State[0] |= 0x30;
414 }
415 
416 inline
418 {
419 #ifdef _DEBUG
420  if (!IsSetAttrib()) {
422  }
423 #endif
424  m_set_State[0] |= 0x10;
425  return m_Attrib;
426 }
427 
428 ///////////////////////////////////////////////////////////
429 ////////////////// end of inline methods //////////////////
430 ///////////////////////////////////////////////////////////
431 
432 
433 
434 
435 
436 END_objects_SCOPE // namespace ncbi::objects::
437 
439 
440 
441 #endif // OBJECTS_SEQFEAT_ORGMOD_BASE_HPP
COrgMod_Base –.
Definition: OrgMod_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
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
TSubname & SetSubname(void)
Assign a value to Subname data member.
Definition: OrgMod_.hpp:370
TSubtype GetSubtype(void) const
Get the Subtype member data.
Definition: OrgMod_.hpp:307
COrgMod_Base(const COrgMod_Base &)
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
Definition: OrgMod_.hpp:394
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
Definition: OrgMod_.hpp:288
const TSubname & GetSubname(void) const
Get the Subname member data.
Definition: OrgMod_.hpp:347
TAttrib & SetAttrib(void)
Assign a value to Attrib data member.
Definition: OrgMod_.hpp:417
string TSubname
Definition: OrgMod_.hpp:133
string TAttrib
Definition: OrgMod_.hpp:134
bool CanGetSubname(void) const
Check if it is safe to call GetSubname method.
Definition: OrgMod_.hpp:341
Uint4 m_set_State[1]
Definition: OrgMod_.hpp:272
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
Definition: OrgMod_.hpp:294
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: OrgMod_.hpp:143
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
Definition: OrgMod_.hpp:323
DECLARE_INTERNAL_TYPE_INFO()
bool CanGetAttrib(void) const
Check if it is safe to call GetAttrib method.
Definition: OrgMod_.hpp:388
void ResetSubtype(void)
Reset Subtype data member.
Definition: OrgMod_.hpp:300
bool IsSetSubname(void) const
Check if a value has been assigned to Subname data member.
Definition: OrgMod_.hpp:335
bool IsSetAttrib(void) const
attribution/source of name Check if a value has been assigned to Attrib data member.
Definition: OrgMod_.hpp:382
COrgMod_Base & operator=(const COrgMod_Base &)
CSerialObject Tparent
Definition: OrgMod_.hpp:74
string m_Subname
Definition: OrgMod_.hpp:274
string m_Attrib
Definition: OrgMod_.hpp:275
Modified on Wed Mar 27 11:24:35 2024 by modify_doxy.py rev. 669887