NCBI C++ ToolKit
PRF_ExtraSrc_.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 PRF_ExtraSrc_.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/seqblock/seqblock.asn">seqblock.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqblock/seqblock.def">seqblock.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_SEQBLOCK_PRF_EXTRASRC_BASE_HPP
42 #define OBJECTS_SEQBLOCK_PRF_EXTRASRC_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_PRF_General
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CPRF_ExtraSrc_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CPRF_ExtraSrc_Base(void);
78  // destructor
79  virtual ~CPRF_ExtraSrc_Base(void);
80 
81  // type info
83 
84  // types
85  typedef string THost;
86  typedef string TPart;
87  typedef string TState;
88  typedef string TStrain;
89  typedef string TTaxon;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_host,
95  e_part,
96  e_state,
97  e_strain,
98  e_taxon
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Host data member.
106  ///
107  /// Data member Host is optional;
108  /// its type is defined as 'typedef string THost'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetHost(void) const;
113 
114  /// Check if it is safe to call GetHost method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetHost(void) const;
120 
121  /// Reset Host data member.
122  void ResetHost(void);
123 
124  /// Get the Host member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const THost& GetHost(void) const;
129 
130  /// Assign a value to Host data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetHost(const THost& value);
135  void SetHost(THost&& value);
136 
137  /// Assign a value to Host data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  THost& SetHost(void);
142 
143  /// Check if a value has been assigned to Part data member.
144  ///
145  /// Data member Part is optional;
146  /// its type is defined as 'typedef string TPart'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetPart(void) const;
151 
152  /// Check if it is safe to call GetPart method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetPart(void) const;
158 
159  /// Reset Part data member.
160  void ResetPart(void);
161 
162  /// Get the Part member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TPart& GetPart(void) const;
167 
168  /// Assign a value to Part data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetPart(const TPart& value);
173  void SetPart(TPart&& value);
174 
175  /// Assign a value to Part data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TPart& SetPart(void);
180 
181  /// Check if a value has been assigned to State data member.
182  ///
183  /// Data member State is optional;
184  /// its type is defined as 'typedef string TState'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetState(void) const;
189 
190  /// Check if it is safe to call GetState method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetState(void) const;
196 
197  /// Reset State data member.
198  void ResetState(void);
199 
200  /// Get the State member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TState& GetState(void) const;
205 
206  /// Assign a value to State data member.
207  ///
208  /// @param value
209  /// Value to assign
210  void SetState(const TState& value);
211  void SetState(TState&& value);
212 
213  /// Assign a value to State data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  TState& SetState(void);
218 
219  /// Check if a value has been assigned to Strain data member.
220  ///
221  /// Data member Strain is optional;
222  /// its type is defined as 'typedef string TStrain'
223  /// @return
224  /// - true, if a value has been assigned.
225  /// - false, otherwise.
226  bool IsSetStrain(void) const;
227 
228  /// Check if it is safe to call GetStrain method.
229  ///
230  /// @return
231  /// - true, if the data member is getatable.
232  /// - false, otherwise.
233  bool CanGetStrain(void) const;
234 
235  /// Reset Strain data member.
236  void ResetStrain(void);
237 
238  /// Get the Strain member data.
239  ///
240  /// @return
241  /// Reference to the member data.
242  const TStrain& GetStrain(void) const;
243 
244  /// Assign a value to Strain data member.
245  ///
246  /// @param value
247  /// Value to assign
248  void SetStrain(const TStrain& value);
249  void SetStrain(TStrain&& value);
250 
251  /// Assign a value to Strain data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TStrain& SetStrain(void);
256 
257  /// Check if a value has been assigned to Taxon data member.
258  ///
259  /// Data member Taxon is optional;
260  /// its type is defined as 'typedef string TTaxon'
261  /// @return
262  /// - true, if a value has been assigned.
263  /// - false, otherwise.
264  bool IsSetTaxon(void) const;
265 
266  /// Check if it is safe to call GetTaxon method.
267  ///
268  /// @return
269  /// - true, if the data member is getatable.
270  /// - false, otherwise.
271  bool CanGetTaxon(void) const;
272 
273  /// Reset Taxon data member.
274  void ResetTaxon(void);
275 
276  /// Get the Taxon member data.
277  ///
278  /// @return
279  /// Reference to the member data.
280  const TTaxon& GetTaxon(void) const;
281 
282  /// Assign a value to Taxon data member.
283  ///
284  /// @param value
285  /// Value to assign
286  void SetTaxon(const TTaxon& value);
287  void SetTaxon(TTaxon&& value);
288 
289  /// Assign a value to Taxon data member.
290  ///
291  /// @return
292  /// Reference to the data value.
293  TTaxon& SetTaxon(void);
294 
295  /// Reset the whole object
296  virtual void Reset(void);
297 
298 
299 private:
300  // Prohibit copy constructor and assignment operator
303 
304  // data
305  Uint4 m_set_State[1];
306  string m_Host;
307  string m_Part;
308  string m_State;
309  string m_Strain;
310  string m_Taxon;
311 };
312 
313 /* @} */
314 
315 
316 
317 
318 
319 ///////////////////////////////////////////////////////////
320 ///////////////////// inline methods //////////////////////
321 ///////////////////////////////////////////////////////////
322 inline
324 {
325  return ((m_set_State[0] & 0x3) != 0);
326 }
327 
328 inline
330 {
331  return IsSetHost();
332 }
333 
334 inline
336 {
337  if (!CanGetHost()) {
338  ThrowUnassigned(0);
339  }
340  return m_Host;
341 }
342 
343 inline
345 {
346  m_Host = value;
347  m_set_State[0] |= 0x3;
348 }
349 
350 inline
352 {
353  m_Host = std::forward<CPRF_ExtraSrc_Base::THost>(value);
354  m_set_State[0] |= 0x3;
355 }
356 
357 inline
359 {
360 #ifdef _DEBUG
361  if (!IsSetHost()) {
363  }
364 #endif
365  m_set_State[0] |= 0x1;
366  return m_Host;
367 }
368 
369 inline
371 {
372  return ((m_set_State[0] & 0xc) != 0);
373 }
374 
375 inline
377 {
378  return IsSetPart();
379 }
380 
381 inline
383 {
384  if (!CanGetPart()) {
385  ThrowUnassigned(1);
386  }
387  return m_Part;
388 }
389 
390 inline
392 {
393  m_Part = value;
394  m_set_State[0] |= 0xc;
395 }
396 
397 inline
399 {
400  m_Part = std::forward<CPRF_ExtraSrc_Base::TPart>(value);
401  m_set_State[0] |= 0xc;
402 }
403 
404 inline
406 {
407 #ifdef _DEBUG
408  if (!IsSetPart()) {
410  }
411 #endif
412  m_set_State[0] |= 0x4;
413  return m_Part;
414 }
415 
416 inline
418 {
419  return ((m_set_State[0] & 0x30) != 0);
420 }
421 
422 inline
424 {
425  return IsSetState();
426 }
427 
428 inline
430 {
431  if (!CanGetState()) {
432  ThrowUnassigned(2);
433  }
434  return m_State;
435 }
436 
437 inline
439 {
440  m_State = value;
441  m_set_State[0] |= 0x30;
442 }
443 
444 inline
446 {
447  m_State = std::forward<CPRF_ExtraSrc_Base::TState>(value);
448  m_set_State[0] |= 0x30;
449 }
450 
451 inline
453 {
454 #ifdef _DEBUG
455  if (!IsSetState()) {
457  }
458 #endif
459  m_set_State[0] |= 0x10;
460  return m_State;
461 }
462 
463 inline
465 {
466  return ((m_set_State[0] & 0xc0) != 0);
467 }
468 
469 inline
471 {
472  return IsSetStrain();
473 }
474 
475 inline
477 {
478  if (!CanGetStrain()) {
479  ThrowUnassigned(3);
480  }
481  return m_Strain;
482 }
483 
484 inline
486 {
487  m_Strain = value;
488  m_set_State[0] |= 0xc0;
489 }
490 
491 inline
493 {
494  m_Strain = std::forward<CPRF_ExtraSrc_Base::TStrain>(value);
495  m_set_State[0] |= 0xc0;
496 }
497 
498 inline
500 {
501 #ifdef _DEBUG
502  if (!IsSetStrain()) {
504  }
505 #endif
506  m_set_State[0] |= 0x40;
507  return m_Strain;
508 }
509 
510 inline
512 {
513  return ((m_set_State[0] & 0x300) != 0);
514 }
515 
516 inline
518 {
519  return IsSetTaxon();
520 }
521 
522 inline
524 {
525  if (!CanGetTaxon()) {
526  ThrowUnassigned(4);
527  }
528  return m_Taxon;
529 }
530 
531 inline
533 {
534  m_Taxon = value;
535  m_set_State[0] |= 0x300;
536 }
537 
538 inline
540 {
541  m_Taxon = std::forward<CPRF_ExtraSrc_Base::TTaxon>(value);
542  m_set_State[0] |= 0x300;
543 }
544 
545 inline
547 {
548 #ifdef _DEBUG
549  if (!IsSetTaxon()) {
551  }
552 #endif
553  m_set_State[0] |= 0x100;
554  return m_Taxon;
555 }
556 
557 ///////////////////////////////////////////////////////////
558 ////////////////// end of inline methods //////////////////
559 ///////////////////////////////////////////////////////////
560 
561 
562 
563 
564 
565 END_objects_SCOPE // namespace ncbi::objects::
566 
568 
569 
570 #endif // OBJECTS_SEQBLOCK_PRF_EXTRASRC_BASE_HPP
CPRF_ExtraSrc_Base –.
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_SEQBLOCK_EXPORT
Definition: ncbi_export.h:752
const TTaxon & GetTaxon(void) const
Get the Taxon member data.
bool IsSetStrain(void) const
Check if a value has been assigned to Strain data member.
TTaxon & SetTaxon(void)
Assign a value to Taxon data member.
const TPart & GetPart(void) const
Get the Part member data.
bool IsSetPart(void) const
Check if a value has been assigned to Part data member.
bool IsSetState(void) const
Check if a value has been assigned to State data member.
bool CanGetState(void) const
Check if it is safe to call GetState method.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
const THost & GetHost(void) const
Get the Host member data.
TState & SetState(void)
Assign a value to State data member.
CSerialObject Tparent
bool IsSetHost(void) const
Check if a value has been assigned to Host data member.
TStrain & SetStrain(void)
Assign a value to Strain data member.
const TStrain & GetStrain(void) const
Get the Strain member data.
bool CanGetHost(void) const
Check if it is safe to call GetHost method.
CPRF_ExtraSrc_Base & operator=(const CPRF_ExtraSrc_Base &)
const TState & GetState(void) const
Get the State member data.
bool CanGetStrain(void) const
Check if it is safe to call GetStrain method.
CPRF_ExtraSrc_Base(const CPRF_ExtraSrc_Base &)
bool IsSetTaxon(void) const
Check if a value has been assigned to Taxon data member.
TPart & SetPart(void)
Assign a value to Part data member.
bool CanGetTaxon(void) const
Check if it is safe to call GetTaxon method.
bool CanGetPart(void) const
Check if it is safe to call GetPart method.
THost & SetHost(void)
Assign a value to Host data member.
Uint4 GetHost(TEndpointKey key)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void SetTaxon(objects::CBioSource &src, size_t taxon)
Modified on Fri Sep 20 14:57:02 2024 by modify_doxy.py rev. 669887