NCBI C++ ToolKit
Taxon1_name_.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 Taxon1_name_.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/taxon1/taxon1.asn">taxon1.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/taxon1/taxon1.def">taxon1.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_TAXON1_TAXON1_NAME_BASE_HPP
42 #define OBJECTS_TAXON1_TAXON1_NAME_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_Taxon1
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CTaxon1_name_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CTaxon1_name_Base(void);
78  // destructor
79  virtual ~CTaxon1_name_Base(void);
80 
81  // type info
83 
84  // types
86  typedef int TCde;
87  typedef string TOname;
88  typedef string TUname;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_taxid,
94  e_cde,
95  e_oname,
96  e_uname
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to Taxid data member.
104  ///
105  /// Data member Taxid is mandatory;
106  /// its type is defined as 'typedef NCBI_NS_NCBI::TTaxId TTaxid'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetTaxid(void) const;
111 
112  /// Check if it is safe to call GetTaxid method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetTaxid(void) const;
118 
119  /// Reset Taxid data member.
120  void ResetTaxid(void);
121 
122  /// Get the Taxid member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TTaxid GetTaxid(void) const;
127 
128  /// Assign a value to Taxid data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetTaxid(TTaxid value);
133 
134  /// Assign a value to Taxid data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TTaxid& SetTaxid(void);
139 
140  /// Check if a value has been assigned to Cde data member.
141  ///
142  /// Data member Cde is mandatory;
143  /// its type is defined as 'typedef int TCde'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetCde(void) const;
148 
149  /// Check if it is safe to call GetCde method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetCde(void) const;
155 
156  /// Reset Cde data member.
157  void ResetCde(void);
158 
159  /// Get the Cde member data.
160  ///
161  /// @return
162  /// Copy of the member data.
163  TCde GetCde(void) const;
164 
165  /// Assign a value to Cde data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetCde(TCde value);
170 
171  /// Assign a value to Cde data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TCde& SetCde(void);
176 
177  /// Check if a value has been assigned to Oname data member.
178  ///
179  /// Data member Oname is optional;
180  /// its type is defined as 'typedef string TOname'
181  /// @return
182  /// - true, if a value has been assigned.
183  /// - false, otherwise.
184  bool IsSetOname(void) const;
185 
186  /// Check if it is safe to call GetOname method.
187  ///
188  /// @return
189  /// - true, if the data member is getatable.
190  /// - false, otherwise.
191  bool CanGetOname(void) const;
192 
193  /// Reset Oname data member.
194  void ResetOname(void);
195 
196  /// Get the Oname member data.
197  ///
198  /// @return
199  /// Reference to the member data.
200  const TOname& GetOname(void) const;
201 
202  /// Assign a value to Oname data member.
203  ///
204  /// @param value
205  /// Value to assign
206  void SetOname(const TOname& value);
207  void SetOname(TOname&& value);
208 
209  /// Assign a value to Oname data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TOname& SetOname(void);
214 
215  /// Check if a value has been assigned to Uname data member.
216  ///
217  /// Data member Uname is optional;
218  /// its type is defined as 'typedef string TUname'
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetUname(void) const;
223 
224  /// Check if it is safe to call GetUname method.
225  ///
226  /// @return
227  /// - true, if the data member is getatable.
228  /// - false, otherwise.
229  bool CanGetUname(void) const;
230 
231  /// Reset Uname data member.
232  void ResetUname(void);
233 
234  /// Get the Uname member data.
235  ///
236  /// @return
237  /// Reference to the member data.
238  const TUname& GetUname(void) const;
239 
240  /// Assign a value to Uname data member.
241  ///
242  /// @param value
243  /// Value to assign
244  void SetUname(const TUname& value);
245  void SetUname(TUname&& value);
246 
247  /// Assign a value to Uname data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TUname& SetUname(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
263  Uint4 m_set_State[1];
264  int m_Taxid;
265  int m_Cde;
266  string m_Oname;
267  string m_Uname;
268 };
269 
270 /* @} */
271 
272 
273 
274 
275 
276 ///////////////////////////////////////////////////////////
277 ///////////////////// inline methods //////////////////////
278 ///////////////////////////////////////////////////////////
279 inline
281 {
282  return ((m_set_State[0] & 0x3) != 0);
283 }
284 
285 inline
287 {
288  return IsSetTaxid();
289 }
290 
291 inline
293 {
294  m_Taxid = 0;
295  m_set_State[0] &= ~0x3;
296 }
297 
298 inline
300 {
301  if (!CanGetTaxid()) {
302  ThrowUnassigned(0);
303  }
304  return reinterpret_cast<const TTaxid&>(m_Taxid);
305 }
306 
307 inline
309 {
310  reinterpret_cast<TTaxid&>(m_Taxid) = value;
311  m_set_State[0] |= 0x3;
312 }
313 
314 inline
316 {
317 #ifdef _DEBUG
318  if (!IsSetTaxid()) {
319  memset(&m_Taxid,UnassignedByte(),sizeof(m_Taxid));
320  }
321 #endif
322  m_set_State[0] |= 0x1;
323  return reinterpret_cast<TTaxid&>(m_Taxid);
324 }
325 
326 inline
328 {
329  return ((m_set_State[0] & 0xc) != 0);
330 }
331 
332 inline
334 {
335  return IsSetCde();
336 }
337 
338 inline
340 {
341  m_Cde = 0;
342  m_set_State[0] &= ~0xc;
343 }
344 
345 inline
347 {
348  if (!CanGetCde()) {
349  ThrowUnassigned(1);
350  }
351  return m_Cde;
352 }
353 
354 inline
356 {
357  m_Cde = value;
358  m_set_State[0] |= 0xc;
359 }
360 
361 inline
363 {
364 #ifdef _DEBUG
365  if (!IsSetCde()) {
366  memset(&m_Cde,UnassignedByte(),sizeof(m_Cde));
367  }
368 #endif
369  m_set_State[0] |= 0x4;
370  return m_Cde;
371 }
372 
373 inline
375 {
376  return ((m_set_State[0] & 0x30) != 0);
377 }
378 
379 inline
381 {
382  return IsSetOname();
383 }
384 
385 inline
387 {
388  if (!CanGetOname()) {
389  ThrowUnassigned(2);
390  }
391  return m_Oname;
392 }
393 
394 inline
396 {
397  m_Oname = value;
398  m_set_State[0] |= 0x30;
399 }
400 
401 inline
403 {
404  m_Oname = std::forward<CTaxon1_name_Base::TOname>(value);
405  m_set_State[0] |= 0x30;
406 }
407 
408 inline
410 {
411 #ifdef _DEBUG
412  if (!IsSetOname()) {
414  }
415 #endif
416  m_set_State[0] |= 0x10;
417  return m_Oname;
418 }
419 
420 inline
422 {
423  return ((m_set_State[0] & 0xc0) != 0);
424 }
425 
426 inline
428 {
429  return IsSetUname();
430 }
431 
432 inline
434 {
435  if (!CanGetUname()) {
436  ThrowUnassigned(3);
437  }
438  return m_Uname;
439 }
440 
441 inline
443 {
444  m_Uname = value;
445  m_set_State[0] |= 0xc0;
446 }
447 
448 inline
450 {
451  m_Uname = std::forward<CTaxon1_name_Base::TUname>(value);
452  m_set_State[0] |= 0xc0;
453 }
454 
455 inline
457 {
458 #ifdef _DEBUG
459  if (!IsSetUname()) {
461  }
462 #endif
463  m_set_State[0] |= 0x40;
464  return m_Uname;
465 }
466 
467 ///////////////////////////////////////////////////////////
468 ////////////////// end of inline methods //////////////////
469 ///////////////////////////////////////////////////////////
470 
471 
472 
473 
474 
475 END_objects_SCOPE // namespace ncbi::objects::
476 
478 
479 
480 #endif // OBJECTS_TAXON1_TAXON1_NAME_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTaxon1_name_Base –.
SStrictId_Tax::TId TTaxId
Taxon id type.
Definition: ncbimisc.hpp:1048
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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_TAXON1_EXPORT
Definition: ncbi_export.h:857
bool CanGetCde(void) const
Check if it is safe to call GetCde method.
const TUname & GetUname(void) const
Get the Uname member data.
NCBI_NS_NCBI::TTaxId TTaxid
const TOname & GetOname(void) const
Get the Oname member data.
bool CanGetTaxid(void) const
Check if it is safe to call GetTaxid method.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
TTaxid GetTaxid(void) const
Get the Taxid member data.
CSerialObject Tparent
CTaxon1_name_Base(const CTaxon1_name_Base &)
bool IsSetUname(void) const
Check if a value has been assigned to Uname data member.
bool CanGetUname(void) const
Check if it is safe to call GetUname method.
TCde & SetCde(void)
Assign a value to Cde data member.
TOname & SetOname(void)
Assign a value to Oname data member.
bool IsSetOname(void) const
Check if a value has been assigned to Oname data member.
void ResetCde(void)
Reset Cde data member.
bool CanGetOname(void) const
Check if it is safe to call GetOname method.
CTaxon1_name_Base & operator=(const CTaxon1_name_Base &)
TUname & SetUname(void)
Assign a value to Uname data member.
void ResetTaxid(void)
Reset Taxid data member.
bool IsSetTaxid(void) const
Check if a value has been assigned to Taxid data member.
bool IsSetCde(void) const
Check if a value has been assigned to Cde data member.
TCde GetCde(void) const
Get the Cde member data.
TTaxid & SetTaxid(void)
Assign a value to Taxid data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Apr 14 05:24:37 2024 by modify_doxy.py rev. 669887