NCBI C++ ToolKit
HG_Domain_.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 HG_Domain_.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/homologene/homologene.asn">homologene.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/homologene/homologene.def">homologene.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_HOMOLOGENE_HG_DOMAIN_BASE_HPP
42 #define OBJECTS_HOMOLOGENE_HG_DOMAIN_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_HomoloGene
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CHG_Domain_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CHG_Domain_Base(void);
78  // destructor
79  virtual ~CHG_Domain_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TBegin;
86  typedef int TEnd;
87  typedef int TPssm_id;
88  typedef string TCdd_id;
89  typedef string TCdd_name;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_begin,
95  e_end,
96  e_pssm_id,
97  e_cdd_id,
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Begin data member.
106  ///
107  /// Data member Begin is mandatory;
108  /// its type is defined as 'typedef int TBegin'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetBegin(void) const;
113 
114  /// Check if it is safe to call GetBegin method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetBegin(void) const;
120 
121  /// Reset Begin data member.
122  void ResetBegin(void);
123 
124  /// Get the Begin member data.
125  ///
126  /// @return
127  /// Copy of the member data.
128  TBegin GetBegin(void) const;
129 
130  /// Assign a value to Begin data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetBegin(TBegin value);
135 
136  /// Assign a value to Begin data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TBegin& SetBegin(void);
141 
142  /// Check if a value has been assigned to End data member.
143  ///
144  /// Data member End is mandatory;
145  /// its type is defined as 'typedef int TEnd'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetEnd(void) const;
150 
151  /// Check if it is safe to call GetEnd method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetEnd(void) const;
157 
158  /// Reset End data member.
159  void ResetEnd(void);
160 
161  /// Get the End member data.
162  ///
163  /// @return
164  /// Copy of the member data.
165  TEnd GetEnd(void) const;
166 
167  /// Assign a value to End data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetEnd(TEnd value);
172 
173  /// Assign a value to End data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TEnd& SetEnd(void);
178 
179  /// entrez uid
180  /// Check if a value has been assigned to Pssm_id data member.
181  ///
182  /// Data member Pssm_id is optional;
183  /// its type is defined as 'typedef int TPssm_id'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetPssm_id(void) const;
188 
189  /// Check if it is safe to call GetPssm_id method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetPssm_id(void) const;
195 
196  /// Reset Pssm_id data member.
197  void ResetPssm_id(void);
198 
199  /// Get the Pssm_id member data.
200  ///
201  /// @return
202  /// Copy of the member data.
203  TPssm_id GetPssm_id(void) const;
204 
205  /// Assign a value to Pssm_id data member.
206  ///
207  /// @param value
208  /// Value to assign
209  void SetPssm_id(TPssm_id value);
210 
211  /// Assign a value to Pssm_id data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TPssm_id& SetPssm_id(void);
216 
217  /// Check if a value has been assigned to Cdd_id data member.
218  ///
219  /// Data member Cdd_id is optional;
220  /// its type is defined as 'typedef string TCdd_id'
221  /// @return
222  /// - true, if a value has been assigned.
223  /// - false, otherwise.
224  bool IsSetCdd_id(void) const;
225 
226  /// Check if it is safe to call GetCdd_id method.
227  ///
228  /// @return
229  /// - true, if the data member is getatable.
230  /// - false, otherwise.
231  bool CanGetCdd_id(void) const;
232 
233  /// Reset Cdd_id data member.
234  void ResetCdd_id(void);
235 
236  /// Get the Cdd_id member data.
237  ///
238  /// @return
239  /// Reference to the member data.
240  const TCdd_id& GetCdd_id(void) const;
241 
242  /// Assign a value to Cdd_id data member.
243  ///
244  /// @param value
245  /// Value to assign
246  void SetCdd_id(const TCdd_id& value);
247  void SetCdd_id(TCdd_id&& value);
248 
249  /// Assign a value to Cdd_id data member.
250  ///
251  /// @return
252  /// Reference to the data value.
253  TCdd_id& SetCdd_id(void);
254 
255  /// Check if a value has been assigned to Cdd_name data member.
256  ///
257  /// Data member Cdd_name is optional;
258  /// its type is defined as 'typedef string TCdd_name'
259  /// @return
260  /// - true, if a value has been assigned.
261  /// - false, otherwise.
262  bool IsSetCdd_name(void) const;
263 
264  /// Check if it is safe to call GetCdd_name method.
265  ///
266  /// @return
267  /// - true, if the data member is getatable.
268  /// - false, otherwise.
269  bool CanGetCdd_name(void) const;
270 
271  /// Reset Cdd_name data member.
272  void ResetCdd_name(void);
273 
274  /// Get the Cdd_name member data.
275  ///
276  /// @return
277  /// Reference to the member data.
278  const TCdd_name& GetCdd_name(void) const;
279 
280  /// Assign a value to Cdd_name data member.
281  ///
282  /// @param value
283  /// Value to assign
284  void SetCdd_name(const TCdd_name& value);
285  void SetCdd_name(TCdd_name&& value);
286 
287  /// Assign a value to Cdd_name data member.
288  ///
289  /// @return
290  /// Reference to the data value.
291  TCdd_name& SetCdd_name(void);
292 
293  /// Reset the whole object
294  virtual void Reset(void);
295 
296 
297 private:
298  // Prohibit copy constructor and assignment operator
301 
302  // data
304  int m_Begin;
305  int m_End;
307  string m_Cdd_id;
308  string m_Cdd_name;
309 };
310 
311 /* @} */
312 
313 
314 
315 
316 
317 ///////////////////////////////////////////////////////////
318 ///////////////////// inline methods //////////////////////
319 ///////////////////////////////////////////////////////////
320 inline
322 {
323  return ((m_set_State[0] & 0x3) != 0);
324 }
325 
326 inline
328 {
329  return IsSetBegin();
330 }
331 
332 inline
334 {
335  m_Begin = 0;
336  m_set_State[0] &= ~0x3;
337 }
338 
339 inline
341 {
342  if (!CanGetBegin()) {
343  ThrowUnassigned(0);
344  }
345  return m_Begin;
346 }
347 
348 inline
350 {
351  m_Begin = value;
352  m_set_State[0] |= 0x3;
353 }
354 
355 inline
357 {
358 #ifdef _DEBUG
359  if (!IsSetBegin()) {
360  memset(&m_Begin,UnassignedByte(),sizeof(m_Begin));
361  }
362 #endif
363  m_set_State[0] |= 0x1;
364  return m_Begin;
365 }
366 
367 inline
369 {
370  return ((m_set_State[0] & 0xc) != 0);
371 }
372 
373 inline
375 {
376  return IsSetEnd();
377 }
378 
379 inline
381 {
382  m_End = 0;
383  m_set_State[0] &= ~0xc;
384 }
385 
386 inline
388 {
389  if (!CanGetEnd()) {
390  ThrowUnassigned(1);
391  }
392  return m_End;
393 }
394 
395 inline
397 {
398  m_End = value;
399  m_set_State[0] |= 0xc;
400 }
401 
402 inline
404 {
405 #ifdef _DEBUG
406  if (!IsSetEnd()) {
407  memset(&m_End,UnassignedByte(),sizeof(m_End));
408  }
409 #endif
410  m_set_State[0] |= 0x4;
411  return m_End;
412 }
413 
414 inline
416 {
417  return ((m_set_State[0] & 0x30) != 0);
418 }
419 
420 inline
422 {
423  return IsSetPssm_id();
424 }
425 
426 inline
428 {
429  m_Pssm_id = 0;
430  m_set_State[0] &= ~0x30;
431 }
432 
433 inline
435 {
436  if (!CanGetPssm_id()) {
437  ThrowUnassigned(2);
438  }
439  return m_Pssm_id;
440 }
441 
442 inline
444 {
445  m_Pssm_id = value;
446  m_set_State[0] |= 0x30;
447 }
448 
449 inline
451 {
452 #ifdef _DEBUG
453  if (!IsSetPssm_id()) {
454  memset(&m_Pssm_id,UnassignedByte(),sizeof(m_Pssm_id));
455  }
456 #endif
457  m_set_State[0] |= 0x10;
458  return m_Pssm_id;
459 }
460 
461 inline
463 {
464  return ((m_set_State[0] & 0xc0) != 0);
465 }
466 
467 inline
469 {
470  return IsSetCdd_id();
471 }
472 
473 inline
475 {
476  if (!CanGetCdd_id()) {
477  ThrowUnassigned(3);
478  }
479  return m_Cdd_id;
480 }
481 
482 inline
484 {
485  m_Cdd_id = value;
486  m_set_State[0] |= 0xc0;
487 }
488 
489 inline
491 {
492  m_Cdd_id = std::forward<CHG_Domain_Base::TCdd_id>(value);
493  m_set_State[0] |= 0xc0;
494 }
495 
496 inline
498 {
499 #ifdef _DEBUG
500  if (!IsSetCdd_id()) {
502  }
503 #endif
504  m_set_State[0] |= 0x40;
505  return m_Cdd_id;
506 }
507 
508 inline
510 {
511  return ((m_set_State[0] & 0x300) != 0);
512 }
513 
514 inline
516 {
517  return IsSetCdd_name();
518 }
519 
520 inline
522 {
523  if (!CanGetCdd_name()) {
524  ThrowUnassigned(4);
525  }
526  return m_Cdd_name;
527 }
528 
529 inline
531 {
532  m_Cdd_name = value;
533  m_set_State[0] |= 0x300;
534 }
535 
536 inline
538 {
539  m_Cdd_name = std::forward<CHG_Domain_Base::TCdd_name>(value);
540  m_set_State[0] |= 0x300;
541 }
542 
543 inline
545 {
546 #ifdef _DEBUG
547  if (!IsSetCdd_name()) {
549  }
550 #endif
551  m_set_State[0] |= 0x100;
552  return m_Cdd_name;
553 }
554 
555 ///////////////////////////////////////////////////////////
556 ////////////////// end of inline methods //////////////////
557 ///////////////////////////////////////////////////////////
558 
559 
560 
561 
562 
563 END_objects_SCOPE // namespace ncbi::objects::
564 
566 
567 
568 #endif // OBJECTS_HOMOLOGENE_HG_DOMAIN_BASE_HPP
CHG_Domain_Base –.
Definition: HG_Domain_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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
TPssm_id & SetPssm_id(void)
Assign a value to Pssm_id data member.
Definition: HG_Domain_.hpp:450
void ResetCdd_id(void)
Reset Cdd_id data member.
Definition: HG_Domain_.cpp:50
TBegin & SetBegin(void)
Assign a value to Begin data member.
Definition: HG_Domain_.hpp:356
bool CanGetEnd(void) const
Check if it is safe to call GetEnd method.
Definition: HG_Domain_.hpp:374
TEnd GetEnd(void) const
Get the End member data.
Definition: HG_Domain_.hpp:387
const TCdd_id & GetCdd_id(void) const
Get the Cdd_id member data.
Definition: HG_Domain_.hpp:474
bool IsSetCdd_id(void) const
Check if a value has been assigned to Cdd_id data member.
Definition: HG_Domain_.hpp:462
CHG_Domain_Base(void)
Definition: HG_Domain_.cpp:86
bool CanGetCdd_name(void) const
Check if it is safe to call GetCdd_name method.
Definition: HG_Domain_.hpp:515
TPssm_id GetPssm_id(void) const
Get the Pssm_id member data.
Definition: HG_Domain_.hpp:434
bool CanGetPssm_id(void) const
Check if it is safe to call GetPssm_id method.
Definition: HG_Domain_.hpp:421
void ResetEnd(void)
Reset End data member.
Definition: HG_Domain_.hpp:380
virtual void Reset(void)
Reset the whole object.
Definition: HG_Domain_.cpp:62
TBegin GetBegin(void) const
Get the Begin member data.
Definition: HG_Domain_.hpp:340
CHG_Domain_Base & operator=(const CHG_Domain_Base &)
CSerialObject Tparent
Definition: HG_Domain_.hpp:74
bool IsSetPssm_id(void) const
entrez uid Check if a value has been assigned to Pssm_id data member.
Definition: HG_Domain_.hpp:415
bool IsSetBegin(void) const
Check if a value has been assigned to Begin data member.
Definition: HG_Domain_.hpp:321
void ResetBegin(void)
Reset Begin data member.
Definition: HG_Domain_.hpp:333
bool CanGetCdd_id(void) const
Check if it is safe to call GetCdd_id method.
Definition: HG_Domain_.hpp:468
TCdd_name & SetCdd_name(void)
Assign a value to Cdd_name data member.
Definition: HG_Domain_.hpp:544
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
Definition: HG_Domain_.hpp:100
TCdd_id & SetCdd_id(void)
Assign a value to Cdd_id data member.
Definition: HG_Domain_.hpp:497
bool IsSetCdd_name(void) const
Check if a value has been assigned to Cdd_name data member.
Definition: HG_Domain_.hpp:509
CHG_Domain_Base(const CHG_Domain_Base &)
const TCdd_name & GetCdd_name(void) const
Get the Cdd_name member data.
Definition: HG_Domain_.hpp:521
void ResetCdd_name(void)
Reset Cdd_name data member.
Definition: HG_Domain_.cpp:56
bool CanGetBegin(void) const
Check if it is safe to call GetBegin method.
Definition: HG_Domain_.hpp:327
TEnd & SetEnd(void)
Assign a value to End data member.
Definition: HG_Domain_.hpp:403
bool IsSetEnd(void) const
Check if a value has been assigned to End data member.
Definition: HG_Domain_.hpp:368
Uint4 m_set_State[1]
Definition: HG_Domain_.hpp:303
void ResetPssm_id(void)
Reset Pssm_id data member.
Definition: HG_Domain_.hpp:427
virtual ~CHG_Domain_Base(void)
Definition: HG_Domain_.cpp:93
Modified on Sat Dec 09 04:45:19 2023 by modify_doxy.py rev. 669887