NCBI C++ ToolKit
Cdd_book_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 Cdd_book_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/cdd/cdd.asn">cdd.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/cdd/cdd.def">cdd.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_CDD_CDD_BOOK_REF_BASE_HPP
42 #define OBJECTS_CDD_CDD_BOOK_REF_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_Cdd
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// record a link to Entrez Books
69 ///
70 /// CCdd_book_ref_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CCdd_book_ref_Base(void);
79  // destructor
80  virtual ~CCdd_book_ref_Base(void);
81 
82  // type info
84 
85  enum ETextelement {
86  eTextelement_unassigned = 0, ///< type of element
87  eTextelement_section = 1, ///< a section or paragraph
88  eTextelement_figgrp = 2, ///< a figure or set of figures
89  eTextelement_table = 3, ///< a table
90  eTextelement_chapter = 4, ///< a whole chapter
91  eTextelement_biblist = 5, ///< a lisf of references
92  eTextelement_box = 6, ///< an inserted box
93  eTextelement_glossary = 7, ///< glossary
94  eTextelement_appendix = 8, ///< appendix
95  eTextelement_other = 255
96  };
97 
98  /// Access to ETextelement's attributes (values, names) as defined in spec
99  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ETextelement)(void);
100 
101  // types
102  typedef string TBookname;
104  typedef int TElementid;
105  typedef int TSubelementid;
106  typedef string TCelementid;
107  typedef string TCsubelementid;
108 
109  // member index
110  enum class E_memberIndex {
111  e__allMandatory = 0,
112  e_bookname,
113  e_textelement,
114  e_elementid,
115  e_subelementid,
116  e_celementid,
117  e_csubelementid
118  };
120 
121  // getters
122  // setters
123 
124  /// abbreviated book title
125  /// Check if a value has been assigned to Bookname data member.
126  ///
127  /// Data member Bookname is mandatory;
128  /// its type is defined as 'typedef string TBookname'
129  /// @return
130  /// - true, if a value has been assigned.
131  /// - false, otherwise.
132  bool IsSetBookname(void) const;
133 
134  /// Check if it is safe to call GetBookname method.
135  ///
136  /// @return
137  /// - true, if the data member is getatable.
138  /// - false, otherwise.
139  bool CanGetBookname(void) const;
140 
141  /// Reset Bookname data member.
142  void ResetBookname(void);
143 
144  /// Get the Bookname member data.
145  ///
146  /// @return
147  /// Reference to the member data.
148  const TBookname& GetBookname(void) const;
149 
150  /// Assign a value to Bookname data member.
151  ///
152  /// @param value
153  /// Value to assign
154  void SetBookname(const TBookname& value);
155  void SetBookname(TBookname&& value);
156 
157  /// Assign a value to Bookname data member.
158  ///
159  /// @return
160  /// Reference to the data value.
161  TBookname& SetBookname(void);
162 
163  /// Check if a value has been assigned to Textelement data member.
164  ///
165  /// Data member Textelement is mandatory;
166  /// its type is defined as 'typedef ETextelement TTextelement'
167  /// @return
168  /// - true, if a value has been assigned.
169  /// - false, otherwise.
170  bool IsSetTextelement(void) const;
171 
172  /// Check if it is safe to call GetTextelement method.
173  ///
174  /// @return
175  /// - true, if the data member is getatable.
176  /// - false, otherwise.
177  bool CanGetTextelement(void) const;
178 
179  /// Reset Textelement data member.
180  void ResetTextelement(void);
181 
182  /// Get the Textelement member data.
183  ///
184  /// @return
185  /// Copy of the member data.
186  TTextelement GetTextelement(void) const;
187 
188  /// Assign a value to Textelement data member.
189  ///
190  /// @param value
191  /// Value to assign
192  void SetTextelement(TTextelement value);
193 
194  /// Assign a value to Textelement data member.
195  ///
196  /// @return
197  /// Reference to the data value.
198  TTextelement& SetTextelement(void);
199 
200  /// numerical address of the text-element
201  /// Check if a value has been assigned to Elementid data member.
202  ///
203  /// Data member Elementid is optional;
204  /// its type is defined as 'typedef int TElementid'
205  /// @return
206  /// - true, if a value has been assigned.
207  /// - false, otherwise.
208  bool IsSetElementid(void) const;
209 
210  /// Check if it is safe to call GetElementid method.
211  ///
212  /// @return
213  /// - true, if the data member is getatable.
214  /// - false, otherwise.
215  bool CanGetElementid(void) const;
216 
217  /// Reset Elementid data member.
218  void ResetElementid(void);
219 
220  /// Get the Elementid member data.
221  ///
222  /// @return
223  /// Copy of the member data.
224  TElementid GetElementid(void) const;
225 
226  /// Assign a value to Elementid data member.
227  ///
228  /// @param value
229  /// Value to assign
230  void SetElementid(TElementid value);
231 
232  /// Assign a value to Elementid data member.
233  ///
234  /// @return
235  /// Reference to the data value.
236  TElementid& SetElementid(void);
237 
238  /// exact address, used with section
239  /// Check if a value has been assigned to Subelementid data member.
240  ///
241  /// Data member Subelementid is optional;
242  /// its type is defined as 'typedef int TSubelementid'
243  /// @return
244  /// - true, if a value has been assigned.
245  /// - false, otherwise.
246  bool IsSetSubelementid(void) const;
247 
248  /// Check if it is safe to call GetSubelementid method.
249  ///
250  /// @return
251  /// - true, if the data member is getatable.
252  /// - false, otherwise.
253  bool CanGetSubelementid(void) const;
254 
255  /// Reset Subelementid data member.
256  void ResetSubelementid(void);
257 
258  /// Get the Subelementid member data.
259  ///
260  /// @return
261  /// Copy of the member data.
262  TSubelementid GetSubelementid(void) const;
263 
264  /// Assign a value to Subelementid data member.
265  ///
266  /// @param value
267  /// Value to assign
268  void SetSubelementid(TSubelementid value);
269 
270  /// Assign a value to Subelementid data member.
271  ///
272  /// @return
273  /// Reference to the data value.
274  TSubelementid& SetSubelementid(void);
275 
276  /// address of the text element, if character string
277  /// Check if a value has been assigned to Celementid data member.
278  ///
279  /// Data member Celementid is optional;
280  /// its type is defined as 'typedef string TCelementid'
281  /// @return
282  /// - true, if a value has been assigned.
283  /// - false, otherwise.
284  bool IsSetCelementid(void) const;
285 
286  /// Check if it is safe to call GetCelementid method.
287  ///
288  /// @return
289  /// - true, if the data member is getatable.
290  /// - false, otherwise.
291  bool CanGetCelementid(void) const;
292 
293  /// Reset Celementid data member.
294  void ResetCelementid(void);
295 
296  /// Get the Celementid member data.
297  ///
298  /// @return
299  /// Reference to the member data.
300  const TCelementid& GetCelementid(void) const;
301 
302  /// Assign a value to Celementid data member.
303  ///
304  /// @param value
305  /// Value to assign
306  void SetCelementid(const TCelementid& value);
307  void SetCelementid(TCelementid&& value);
308 
309  /// Assign a value to Celementid data member.
310  ///
311  /// @return
312  /// Reference to the data value.
313  TCelementid& SetCelementid(void);
314 
315  /// exact address, if character string
316  /// Check if a value has been assigned to Csubelementid data member.
317  ///
318  /// Data member Csubelementid is optional;
319  /// its type is defined as 'typedef string TCsubelementid'
320  /// @return
321  /// - true, if a value has been assigned.
322  /// - false, otherwise.
323  bool IsSetCsubelementid(void) const;
324 
325  /// Check if it is safe to call GetCsubelementid method.
326  ///
327  /// @return
328  /// - true, if the data member is getatable.
329  /// - false, otherwise.
330  bool CanGetCsubelementid(void) const;
331 
332  /// Reset Csubelementid data member.
333  void ResetCsubelementid(void);
334 
335  /// Get the Csubelementid member data.
336  ///
337  /// @return
338  /// Reference to the member data.
339  const TCsubelementid& GetCsubelementid(void) const;
340 
341  /// Assign a value to Csubelementid data member.
342  ///
343  /// @param value
344  /// Value to assign
345  void SetCsubelementid(const TCsubelementid& value);
346  void SetCsubelementid(TCsubelementid&& value);
347 
348  /// Assign a value to Csubelementid data member.
349  ///
350  /// @return
351  /// Reference to the data value.
352  TCsubelementid& SetCsubelementid(void);
353 
354  /// Reset the whole object
355  virtual void Reset(void);
356 
357 
358 private:
359  // Prohibit copy constructor and assignment operator
362 
363  // data
364  Uint4 m_set_State[1];
365  string m_Bookname;
369  string m_Celementid;
371 };
372 
373 /* @} */
374 
375 
376 
377 
378 
379 ///////////////////////////////////////////////////////////
380 ///////////////////// inline methods //////////////////////
381 ///////////////////////////////////////////////////////////
382 inline
384 {
385  return ((m_set_State[0] & 0x3) != 0);
386 }
387 
388 inline
390 {
391  return IsSetBookname();
392 }
393 
394 inline
396 {
397  if (!CanGetBookname()) {
398  ThrowUnassigned(0);
399  }
400  return m_Bookname;
401 }
402 
403 inline
405 {
406  m_Bookname = value;
407  m_set_State[0] |= 0x3;
408 }
409 
410 inline
412 {
413  m_Bookname = std::forward<CCdd_book_ref_Base::TBookname>(value);
414  m_set_State[0] |= 0x3;
415 }
416 
417 inline
419 {
420 #ifdef _DEBUG
421  if (!IsSetBookname()) {
423  }
424 #endif
425  m_set_State[0] |= 0x1;
426  return m_Bookname;
427 }
428 
429 inline
431 {
432  return ((m_set_State[0] & 0xc) != 0);
433 }
434 
435 inline
437 {
438  return IsSetTextelement();
439 }
440 
441 inline
443 {
445  m_set_State[0] &= ~0xc;
446 }
447 
448 inline
450 {
451  if (!CanGetTextelement()) {
452  ThrowUnassigned(1);
453  }
454  return m_Textelement;
455 }
456 
457 inline
459 {
461  m_set_State[0] |= 0xc;
462 }
463 
464 inline
466 {
467 #ifdef _DEBUG
468  if (!IsSetTextelement()) {
469  memset(&m_Textelement,UnassignedByte(),sizeof(m_Textelement));
470  }
471 #endif
472  m_set_State[0] |= 0x4;
473  return m_Textelement;
474 }
475 
476 inline
478 {
479  return ((m_set_State[0] & 0x30) != 0);
480 }
481 
482 inline
484 {
485  return IsSetElementid();
486 }
487 
488 inline
490 {
491  m_Elementid = 0;
492  m_set_State[0] &= ~0x30;
493 }
494 
495 inline
497 {
498  if (!CanGetElementid()) {
499  ThrowUnassigned(2);
500  }
501  return m_Elementid;
502 }
503 
504 inline
506 {
507  m_Elementid = value;
508  m_set_State[0] |= 0x30;
509 }
510 
511 inline
513 {
514 #ifdef _DEBUG
515  if (!IsSetElementid()) {
516  memset(&m_Elementid,UnassignedByte(),sizeof(m_Elementid));
517  }
518 #endif
519  m_set_State[0] |= 0x10;
520  return m_Elementid;
521 }
522 
523 inline
525 {
526  return ((m_set_State[0] & 0xc0) != 0);
527 }
528 
529 inline
531 {
532  return IsSetSubelementid();
533 }
534 
535 inline
537 {
538  m_Subelementid = 0;
539  m_set_State[0] &= ~0xc0;
540 }
541 
542 inline
544 {
545  if (!CanGetSubelementid()) {
546  ThrowUnassigned(3);
547  }
548  return m_Subelementid;
549 }
550 
551 inline
553 {
555  m_set_State[0] |= 0xc0;
556 }
557 
558 inline
560 {
561 #ifdef _DEBUG
562  if (!IsSetSubelementid()) {
563  memset(&m_Subelementid,UnassignedByte(),sizeof(m_Subelementid));
564  }
565 #endif
566  m_set_State[0] |= 0x40;
567  return m_Subelementid;
568 }
569 
570 inline
572 {
573  return ((m_set_State[0] & 0x300) != 0);
574 }
575 
576 inline
578 {
579  return IsSetCelementid();
580 }
581 
582 inline
584 {
585  if (!CanGetCelementid()) {
586  ThrowUnassigned(4);
587  }
588  return m_Celementid;
589 }
590 
591 inline
593 {
595  m_set_State[0] |= 0x300;
596 }
597 
598 inline
600 {
601  m_Celementid = std::forward<CCdd_book_ref_Base::TCelementid>(value);
602  m_set_State[0] |= 0x300;
603 }
604 
605 inline
607 {
608 #ifdef _DEBUG
609  if (!IsSetCelementid()) {
611  }
612 #endif
613  m_set_State[0] |= 0x100;
614  return m_Celementid;
615 }
616 
617 inline
619 {
620  return ((m_set_State[0] & 0xc00) != 0);
621 }
622 
623 inline
625 {
626  return IsSetCsubelementid();
627 }
628 
629 inline
631 {
632  if (!CanGetCsubelementid()) {
633  ThrowUnassigned(5);
634  }
635  return m_Csubelementid;
636 }
637 
638 inline
640 {
642  m_set_State[0] |= 0xc00;
643 }
644 
645 inline
647 {
648  m_Csubelementid = std::forward<CCdd_book_ref_Base::TCsubelementid>(value);
649  m_set_State[0] |= 0xc00;
650 }
651 
652 inline
654 {
655 #ifdef _DEBUG
656  if (!IsSetCsubelementid()) {
658  }
659 #endif
660  m_set_State[0] |= 0x400;
661  return m_Csubelementid;
662 }
663 
664 ///////////////////////////////////////////////////////////
665 ////////////////// end of inline methods //////////////////
666 ///////////////////////////////////////////////////////////
667 
668 
669 
670 
671 
672 END_objects_SCOPE // namespace ncbi::objects::
673 
675 
676 
677 #endif // OBJECTS_CDD_CDD_BOOK_REF_BASE_HPP
record a link to Entrez Books
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
#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_CDD_EXPORT
Definition: ncbi_export.h:368
const TBookname & GetBookname(void) const
Get the Bookname member data.
bool CanGetCelementid(void) const
Check if it is safe to call GetCelementid method.
bool IsSetCsubelementid(void) const
exact address, if character string Check if a value has been assigned to Csubelementid data member.
bool IsSetCelementid(void) const
address of the text element, if character string Check if a value has been assigned to Celementid dat...
void ResetElementid(void)
Reset Elementid data member.
bool IsSetElementid(void) const
numerical address of the text-element Check if a value has been assigned to Elementid data member.
CCdd_book_ref_Base(const CCdd_book_ref_Base &)
ETextelement TTextelement
const TCelementid & GetCelementid(void) const
Get the Celementid member data.
TSubelementid & SetSubelementid(void)
Assign a value to Subelementid data member.
CCdd_book_ref_Base & operator=(const CCdd_book_ref_Base &)
bool IsSetTextelement(void) const
Check if a value has been assigned to Textelement data member.
bool CanGetSubelementid(void) const
Check if it is safe to call GetSubelementid method.
TTextelement GetTextelement(void) const
Get the Textelement member data.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
bool CanGetCsubelementid(void) const
Check if it is safe to call GetCsubelementid method.
TBookname & SetBookname(void)
Assign a value to Bookname data member.
bool IsSetSubelementid(void) const
exact address, used with section Check if a value has been assigned to Subelementid data member.
bool CanGetBookname(void) const
Check if it is safe to call GetBookname method.
void ResetSubelementid(void)
Reset Subelementid data member.
TCsubelementid & SetCsubelementid(void)
Assign a value to Csubelementid data member.
bool CanGetElementid(void) const
Check if it is safe to call GetElementid method.
TElementid GetElementid(void) const
Get the Elementid member data.
CSerialObject Tparent
bool CanGetTextelement(void) const
Check if it is safe to call GetTextelement method.
bool IsSetBookname(void) const
abbreviated book title Check if a value has been assigned to Bookname data member.
TTextelement & SetTextelement(void)
Assign a value to Textelement data member.
ETextelement m_Textelement
const TCsubelementid & GetCsubelementid(void) const
Get the Csubelementid member data.
TSubelementid GetSubelementid(void) const
Get the Subelementid member data.
void ResetTextelement(void)
Reset Textelement data member.
TElementid & SetElementid(void)
Assign a value to Elementid data member.
TCelementid & SetCelementid(void)
Assign a value to Celementid data member.
Modified on Mon Dec 11 02:36:11 2023 by modify_doxy.py rev. 669887