NCBI C++ ToolKit
Author_.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 Author_.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/objtools/eutils/efetch/efetch.xsd">efetch.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/efetch/efetch.def">efetch.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 eutils__OBJTOOLS_EUTILS_EFETCH_AUTHOR_BASE_HPP
42 #define eutils__OBJTOOLS_EUTILS_EFETCH_AUTHOR_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 
50 #ifndef BEGIN_eutils_SCOPE
51 # define BEGIN_eutils_SCOPE BEGIN_SCOPE(eutils)
52 # define END_eutils_SCOPE END_SCOPE(eutils)
53 #endif
54 BEGIN_eutils_SCOPE // namespace eutils::
55 
56 
57 // forward declarations
58 class CAffiliationInfo;
59 class CCollectiveName;
60 class CForeName;
61 class CIdentifier;
62 class CInitials;
63 class CLastName;
64 class CSuffix;
65 
66 
67 // generated classes
68 
69 
70 /** @addtogroup dataspec_efetch
71  *
72  * @{
73  */
74 
75 /////////////////////////////////////////////////////////////////////////////
76 ///
77 /// CAuthor_Base --
78 ///
79 
80 class CAuthor_Base : public NCBI_NS_NCBI::CSerialObject
81 {
82  typedef NCBI_NS_NCBI::CSerialObject Tparent;
83 public:
84  // constructor
85  CAuthor_Base(void);
86  // destructor
87  virtual ~CAuthor_Base(void);
88 
89  // type info
91 
92  /////////////////////////////////////////////////////////////////////////////
93  ///
94  /// C_Attlist --
95  ///
96 
97  class C_Attlist : public NCBI_NS_NCBI::CSerialObject
98  {
99  typedef NCBI_NS_NCBI::CSerialObject Tparent;
100  public:
101  // constructor
102  C_Attlist(void);
103  // destructor
104  ~C_Attlist(void);
105 
106  // type info
108 
112  };
113 
114  /// Access to EAttlist_ValidYN's attributes (values, names) as defined in spec
115  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_ValidYN)(void);
116 
120  };
121 
122  /// Access to EAttlist_EqualContrib's attributes (values, names) as defined in spec
123  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_EqualContrib)(void);
124 
125  // types
128 
129  // member index
130  enum class E_memberIndex {
131  e__allMandatory = 0,
132  e_ValidYN,
134  };
136 
137  // getters
138  // setters
139 
140  /// Check if a value has been assigned to ValidYN data member.
141  ///
142  /// Data member ValidYN is optional with default eAttlist_ValidYN_Y;
143  /// its type is defined as 'typedef EAttlist_ValidYN TValidYN'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetValidYN(void) const;
148 
149  /// Check if it is safe to call GetValidYN method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetValidYN(void) const;
155 
156  /// Reset ValidYN data member.
157  void ResetValidYN(void);
158 
159  /// Assign default value to ValidYN data member.
160  void SetDefaultValidYN(void);
161 
162  /// Get the ValidYN member data.
163  ///
164  /// @return
165  /// Copy of the member data.
166  TValidYN GetValidYN(void) const;
167 
168  /// Assign a value to ValidYN data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetValidYN(TValidYN value);
173 
174  /// Assign a value to ValidYN data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TValidYN& SetValidYN(void);
179 
180  /// Check if a value has been assigned to EqualContrib data member.
181  ///
182  /// Data member EqualContrib is optional;
183  /// its type is defined as 'typedef EAttlist_EqualContrib TEqualContrib'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetEqualContrib(void) const;
188 
189  /// Check if it is safe to call GetEqualContrib method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetEqualContrib(void) const;
195 
196  /// Reset EqualContrib data member.
197  void ResetEqualContrib(void);
198 
199  /// Get the EqualContrib member data.
200  ///
201  /// @return
202  /// Copy of the member data.
203  TEqualContrib GetEqualContrib(void) const;
204 
205  /// Assign a value to EqualContrib data member.
206  ///
207  /// @param value
208  /// Value to assign
210 
211  /// Assign a value to EqualContrib data member.
212  ///
213  /// @return
214  /// Reference to the data value.
216 
217  /// Reset the whole object
218  void Reset(void);
219 
220 
221  private:
222  // Prohibit copy constructor and assignment operator
225 
226  // data
230  };
231  /////////////////////////////////////////////////////////////////////////////
232  ///
233  /// C_LC --
234  ///
235 
236  class C_LC : public NCBI_NS_NCBI::CSerialObject
237  {
238  typedef NCBI_NS_NCBI::CSerialObject Tparent;
239  public:
240  // constructor
241  C_LC(void);
242  // destructor
243  ~C_LC(void);
244 
245  // type info
247 
248  /////////////////////////////////////////////////////////////////////////////
249  ///
250  /// C_LFIS --
251  ///
252 
253  class C_LFIS : public NCBI_NS_NCBI::CSerialObject
254  {
255  typedef NCBI_NS_NCBI::CSerialObject Tparent;
256  public:
257  // constructor
258  C_LFIS(void);
259  // destructor
260  ~C_LFIS(void);
261 
262  // type info
264 
265  // types
269  typedef CSuffix TSuffix;
270 
271  // member index
272  enum class E_memberIndex {
273  e__allMandatory = 0,
274  e_LastName,
275  e_ForeName,
276  e_Initials,
277  e_Suffix
278  };
280 
281  // getters
282  // setters
283 
284  /// Check if a value has been assigned to LastName data member.
285  ///
286  /// Data member LastName is mandatory;
287  /// its type is defined as 'typedef CLastName TLastName'
288  /// @return
289  /// - true, if a value has been assigned.
290  /// - false, otherwise.
291  bool IsSetLastName(void) const;
292 
293  /// Check if it is safe to call GetLastName method.
294  ///
295  /// @return
296  /// - true, if the data member is getatable.
297  /// - false, otherwise.
298  bool CanGetLastName(void) const;
299 
300  /// Reset LastName data member.
301  void ResetLastName(void);
302 
303  /// Get the LastName member data.
304  ///
305  /// @return
306  /// Reference to the member data.
307  const TLastName& GetLastName(void) const;
308 
309  /// Assign a value to LastName data member.
310  ///
311  /// @param value
312  /// Reference to value.
313  void SetLastName(TLastName& value);
314 
315  /// Assign a value to LastName data member.
316  ///
317  /// @return
318  /// Reference to the data value.
319  TLastName& SetLastName(void);
320 
321  /// Check if a value has been assigned to ForeName data member.
322  ///
323  /// Data member ForeName is optional;
324  /// its type is defined as 'typedef CForeName TForeName'
325  /// @return
326  /// - true, if a value has been assigned.
327  /// - false, otherwise.
328  bool IsSetForeName(void) const;
329 
330  /// Check if it is safe to call GetForeName method.
331  ///
332  /// @return
333  /// - true, if the data member is getatable.
334  /// - false, otherwise.
335  bool CanGetForeName(void) const;
336 
337  /// Reset ForeName data member.
338  void ResetForeName(void);
339 
340  /// Get the ForeName member data.
341  ///
342  /// @return
343  /// Reference to the member data.
344  const TForeName& GetForeName(void) const;
345 
346  /// Assign a value to ForeName data member.
347  ///
348  /// @param value
349  /// Reference to value.
350  void SetForeName(TForeName& value);
351 
352  /// Assign a value to ForeName data member.
353  ///
354  /// @return
355  /// Reference to the data value.
356  TForeName& SetForeName(void);
357 
358  /// Check if a value has been assigned to Initials data member.
359  ///
360  /// Data member Initials is optional;
361  /// its type is defined as 'typedef CInitials TInitials'
362  /// @return
363  /// - true, if a value has been assigned.
364  /// - false, otherwise.
365  bool IsSetInitials(void) const;
366 
367  /// Check if it is safe to call GetInitials method.
368  ///
369  /// @return
370  /// - true, if the data member is getatable.
371  /// - false, otherwise.
372  bool CanGetInitials(void) const;
373 
374  /// Reset Initials data member.
375  void ResetInitials(void);
376 
377  /// Get the Initials member data.
378  ///
379  /// @return
380  /// Reference to the member data.
381  const TInitials& GetInitials(void) const;
382 
383  /// Assign a value to Initials data member.
384  ///
385  /// @param value
386  /// Reference to value.
387  void SetInitials(TInitials& value);
388 
389  /// Assign a value to Initials data member.
390  ///
391  /// @return
392  /// Reference to the data value.
393  TInitials& SetInitials(void);
394 
395  /// Check if a value has been assigned to Suffix data member.
396  ///
397  /// Data member Suffix is optional;
398  /// its type is defined as 'typedef CSuffix TSuffix'
399  /// @return
400  /// - true, if a value has been assigned.
401  /// - false, otherwise.
402  bool IsSetSuffix(void) const;
403 
404  /// Check if it is safe to call GetSuffix method.
405  ///
406  /// @return
407  /// - true, if the data member is getatable.
408  /// - false, otherwise.
409  bool CanGetSuffix(void) const;
410 
411  /// Reset Suffix data member.
412  void ResetSuffix(void);
413 
414  /// Get the Suffix member data.
415  ///
416  /// @return
417  /// Reference to the member data.
418  const TSuffix& GetSuffix(void) const;
419 
420  /// Assign a value to Suffix data member.
421  ///
422  /// @param value
423  /// Reference to value.
424  void SetSuffix(TSuffix& value);
425 
426  /// Assign a value to Suffix data member.
427  ///
428  /// @return
429  /// Reference to the data value.
430  TSuffix& SetSuffix(void);
431 
432  /// Reset the whole object
433  void Reset(void);
434 
435 
436  private:
437  // Prohibit copy constructor and assignment operator
438  C_LFIS(const C_LFIS&);
440 
441  // data
443  NCBI_NS_NCBI::CRef< TLastName > m_LastName;
444  NCBI_NS_NCBI::CRef< TForeName > m_ForeName;
445  NCBI_NS_NCBI::CRef< TInitials > m_Initials;
446  NCBI_NS_NCBI::CRef< TSuffix > m_Suffix;
447  };
448 
449  /// Choice variants.
450  enum E_Choice {
451  e_not_set = 0, ///< No variant selected
454  };
455  /// Maximum+1 value of the choice variant enumerator.
457  e_MaxChoice = 3 ///< == e_CollectiveName+1
458  };
459 
460  /// Reset the whole object
461  void Reset(void);
462 
463  /// Reset the selection (set it to e_not_set).
464  void ResetSelection(void);
465 
466  /// Which variant is currently selected.
467  ///
468  /// @return
469  /// Choice state enumerator.
470  E_Choice Which(void) const;
471 
472  /// Verify selection, throw exception if it differs from the expected.
473  ///
474  /// @param index
475  /// Expected selection.
476  void CheckSelected(E_Choice index) const;
477 
478  /// Throw 'InvalidSelection' exception.
479  ///
480  /// @param index
481  /// Expected selection.
482  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
483 
484  /// Retrieve selection name (for diagnostic purposes).
485  ///
486  /// @param index
487  /// One of possible selection states.
488  /// @return
489  /// Name string.
491 
492  /// Select the requested variant if needed.
493  ///
494  /// @param index
495  /// New selection state.
496  /// @param reset
497  /// Flag that defines the resetting of the variant data. The data will
498  /// be reset if either the current selection differs from the new one,
499  /// or the flag is set to eDoResetVariant.
501  /// Select the requested variant if needed,
502  /// allocating CObject variants from memory pool.
503  void Select(E_Choice index,
505  NCBI_NS_NCBI::CObjectMemoryPool* pool);
506 
507  // types
508  typedef C_LFIS TLFIS;
510 
511  // getters
512  // setters
513 
514 
515  /// Check if variant LFIS is selected.
516  ///
517  /// LFIS type is defined as 'typedef C_LFIS TLFIS'.
518  /// @return
519  /// - true, if the variant is selected.
520  /// - false, otherwise.
521  bool IsLFIS(void) const;
522 
523  /// Get the variant data.
524  ///
525  /// @return
526  /// Reference to the data.
527  const TLFIS& GetLFIS(void) const;
528 
529  /// Select the variant.
530  ///
531  /// @return
532  /// Reference to the variant data.
533  TLFIS& SetLFIS(void);
534  /// Select the variant and set its data.
535  ///
536  /// @param value
537  /// Reference to the data.
538  void SetLFIS(TLFIS& value);
539 
540 
541  /// Check if variant CollectiveName is selected.
542  ///
543  /// CollectiveName type is defined as 'typedef CCollectiveName TCollectiveName'.
544  /// @return
545  /// - true, if the variant is selected.
546  /// - false, otherwise.
547  bool IsCollectiveName(void) const;
548 
549  /// Get the variant data.
550  ///
551  /// @return
552  /// Reference to the data.
553  const TCollectiveName& GetCollectiveName(void) const;
554 
555  /// Select the variant.
556  ///
557  /// @return
558  /// Reference to the variant data.
560  /// Select the variant and set its data.
561  ///
562  /// @param value
563  /// Reference to the data.
565 
566 
567  private:
568  // copy constructor and assignment operator
569  C_LC(const C_LC& );
570  C_LC& operator=(const C_LC& );
571  // choice state
573  // helper methods
574  void DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool = 0);
575 
576  static const char* const sm_SelectionNames[];
577  // data
578  NCBI_NS_NCBI::CSerialObject *m_object;
579  };
580  // types
582  typedef C_LC TLC;
583  typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CIdentifier > > TIdentifier;
584  typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CAffiliationInfo > > TAffiliationInfo;
585 
586  // member index
587  enum class E_memberIndex {
588  e__allMandatory = 0,
589  e_Attlist,
590  e_LC,
591  e_Identifier,
593  };
595 
596  // getters
597  // setters
598 
599  /// Check if a value has been assigned to Attlist data member.
600  ///
601  /// Data member Attlist is mandatory;
602  /// its type is defined as 'typedef C_Attlist TAttlist'
603  /// @return
604  /// - true, if a value has been assigned.
605  /// - false, otherwise.
606  bool IsSetAttlist(void) const;
607 
608  /// Check if it is safe to call GetAttlist method.
609  ///
610  /// @return
611  /// - true, if the data member is getatable.
612  /// - false, otherwise.
613  bool CanGetAttlist(void) const;
614 
615  /// Reset Attlist data member.
616  void ResetAttlist(void);
617 
618  /// Get the Attlist member data.
619  ///
620  /// @return
621  /// Reference to the member data.
622  const TAttlist& GetAttlist(void) const;
623 
624  /// Assign a value to Attlist data member.
625  ///
626  /// @param value
627  /// Reference to value.
628  void SetAttlist(TAttlist& value);
629 
630  /// Assign a value to Attlist data member.
631  ///
632  /// @return
633  /// Reference to the data value.
634  TAttlist& SetAttlist(void);
635 
636  /// Check if a value has been assigned to LC data member.
637  ///
638  /// Data member LC is mandatory;
639  /// its type is defined as 'typedef C_LC TLC'
640  /// @return
641  /// - true, if a value has been assigned.
642  /// - false, otherwise.
643  bool IsSetLC(void) const;
644 
645  /// Check if it is safe to call GetLC method.
646  ///
647  /// @return
648  /// - true, if the data member is getatable.
649  /// - false, otherwise.
650  bool CanGetLC(void) const;
651 
652  /// Reset LC data member.
653  void ResetLC(void);
654 
655  /// Get the LC member data.
656  ///
657  /// @return
658  /// Reference to the member data.
659  const TLC& GetLC(void) const;
660 
661  /// Assign a value to LC data member.
662  ///
663  /// @param value
664  /// Reference to value.
665  void SetLC(TLC& value);
666 
667  /// Assign a value to LC data member.
668  ///
669  /// @return
670  /// Reference to the data value.
671  TLC& SetLC(void);
672 
673  /// Check if a value has been assigned to Identifier data member.
674  ///
675  /// Data member Identifier is optional;
676  /// its type is defined as 'typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CIdentifier > > TIdentifier'
677  /// @return
678  /// - true, if a value has been assigned.
679  /// - false, otherwise.
680  bool IsSetIdentifier(void) const;
681 
682  /// Check if it is safe to call GetIdentifier method.
683  ///
684  /// @return
685  /// - true, if the data member is getatable.
686  /// - false, otherwise.
687  bool CanGetIdentifier(void) const;
688 
689  /// Reset Identifier data member.
690  void ResetIdentifier(void);
691 
692  /// Get the Identifier member data.
693  ///
694  /// @return
695  /// Reference to the member data.
696  const TIdentifier& GetIdentifier(void) const;
697 
698  /// Assign a value to Identifier data member.
699  ///
700  /// @return
701  /// Reference to the data value.
702  TIdentifier& SetIdentifier(void);
703 
704  /// Check if a value has been assigned to AffiliationInfo data member.
705  ///
706  /// Data member AffiliationInfo is optional;
707  /// its type is defined as 'typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CAffiliationInfo > > TAffiliationInfo'
708  /// @return
709  /// - true, if a value has been assigned.
710  /// - false, otherwise.
711  bool IsSetAffiliationInfo(void) const;
712 
713  /// Check if it is safe to call GetAffiliationInfo method.
714  ///
715  /// @return
716  /// - true, if the data member is getatable.
717  /// - false, otherwise.
718  bool CanGetAffiliationInfo(void) const;
719 
720  /// Reset AffiliationInfo data member.
721  void ResetAffiliationInfo(void);
722 
723  /// Get the AffiliationInfo member data.
724  ///
725  /// @return
726  /// Reference to the member data.
727  const TAffiliationInfo& GetAffiliationInfo(void) const;
728 
729  /// Assign a value to AffiliationInfo data member.
730  ///
731  /// @return
732  /// Reference to the data value.
734 
735  /// Reset the whole object
736  virtual void Reset(void);
737 
738 
739 private:
740  // Prohibit copy constructor and assignment operator
743 
744  // data
745  Uint4 m_set_State[1];
746  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
747  NCBI_NS_NCBI::CRef< TLC > m_LC;
748  NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CIdentifier > > m_Identifier;
749  NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CAffiliationInfo > > m_AffiliationInfo;
750 };
751 
752 /* @} */
753 
754 
755 
756 
757 
758 ///////////////////////////////////////////////////////////
759 ///////////////////// inline methods //////////////////////
760 ///////////////////////////////////////////////////////////
761 inline
763 {
764  return ((m_set_State[0] & 0x3) != 0);
765 }
766 
767 inline
769 {
770  return true;
771 }
772 
773 inline
775 {
776  m_ValidYN = eAttlist_ValidYN_Y;
777  m_set_State[0] &= ~0x3;
778 }
779 
780 inline
782 {
783  ResetValidYN();
784  m_set_State[0] |= 0x1;
785 }
786 
787 inline
789 {
790  return m_ValidYN;
791 }
792 
793 inline
795 {
796  m_ValidYN = value;
797  m_set_State[0] |= 0x3;
798 }
799 
800 inline
802 {
803 #ifdef _DEBUG
804  if (!IsSetValidYN()) {
805  memset(&m_ValidYN,UnassignedByte(),sizeof(m_ValidYN));
806  }
807 #endif
808  m_set_State[0] |= 0x1;
809  return m_ValidYN;
810 }
811 
812 inline
814 {
815  return ((m_set_State[0] & 0xc) != 0);
816 }
817 
818 inline
820 {
821  return IsSetEqualContrib();
822 }
823 
824 inline
826 {
827  m_EqualContrib = (EAttlist_EqualContrib)(0);
828  m_set_State[0] &= ~0xc;
829 }
830 
831 inline
833 {
834  if (!CanGetEqualContrib()) {
835  ThrowUnassigned(1);
836  }
837  return m_EqualContrib;
838 }
839 
840 inline
842 {
843  m_EqualContrib = value;
844  m_set_State[0] |= 0xc;
845 }
846 
847 inline
849 {
850 #ifdef _DEBUG
851  if (!IsSetEqualContrib()) {
852  memset(&m_EqualContrib,UnassignedByte(),sizeof(m_EqualContrib));
853  }
854 #endif
855  m_set_State[0] |= 0x4;
856  return m_EqualContrib;
857 }
858 
859 inline
861 {
862  return m_LastName.NotEmpty();
863 }
864 
865 inline
867 {
868  return true;
869 }
870 
871 inline
873 {
874  if ( !m_LastName ) {
875  const_cast<C_LFIS*>(this)->ResetLastName();
876  }
877  return (*m_LastName);
878 }
879 
880 inline
882 {
883  if ( !m_LastName ) {
884  ResetLastName();
885  }
886  return (*m_LastName);
887 }
888 
889 inline
891 {
892  return m_ForeName.NotEmpty();
893 }
894 
895 inline
897 {
898  return IsSetForeName();
899 }
900 
901 inline
903 {
904  if (!CanGetForeName()) {
905  ThrowUnassigned(1);
906  }
907  return (*m_ForeName);
908 }
909 
910 inline
912 {
913  return m_Initials.NotEmpty();
914 }
915 
916 inline
918 {
919  return IsSetInitials();
920 }
921 
922 inline
924 {
925  if (!CanGetInitials()) {
926  ThrowUnassigned(2);
927  }
928  return (*m_Initials);
929 }
930 
931 inline
933 {
934  return m_Suffix.NotEmpty();
935 }
936 
937 inline
939 {
940  return IsSetSuffix();
941 }
942 
943 inline
945 {
946  if (!CanGetSuffix()) {
947  ThrowUnassigned(3);
948  }
949  return (*m_Suffix);
950 }
951 
952 inline
954 {
955  return m_choice;
956 }
957 
958 inline
960 {
961  if ( m_choice != index )
962  ThrowInvalidSelection(index);
963 }
964 
965 inline
966 void CAuthor_Base::C_LC::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
967 {
968  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
969  if ( m_choice != e_not_set )
970  ResetSelection();
971  DoSelect(index, pool);
972  }
973 }
974 
975 inline
977 {
978  Select(index, reset, 0);
979 }
980 
981 inline
983 {
984  return m_choice == e_LFIS;
985 }
986 
987 inline
989 {
990  return m_choice == e_CollectiveName;
991 }
992 
993 inline
995 {
996  return m_Attlist.NotEmpty();
997 }
998 
999 inline
1001 {
1002  return true;
1003 }
1004 
1005 inline
1007 {
1008  if ( !m_Attlist ) {
1009  const_cast<CAuthor_Base*>(this)->ResetAttlist();
1010  }
1011  return (*m_Attlist);
1012 }
1013 
1014 inline
1016 {
1017  if ( !m_Attlist ) {
1018  ResetAttlist();
1019  }
1020  return (*m_Attlist);
1021 }
1022 
1023 inline
1024 bool CAuthor_Base::IsSetLC(void) const
1025 {
1026  return m_LC.NotEmpty();
1027 }
1028 
1029 inline
1030 bool CAuthor_Base::CanGetLC(void) const
1031 {
1032  return true;
1033 }
1034 
1035 inline
1037 {
1038  if ( !m_LC ) {
1039  const_cast<CAuthor_Base*>(this)->ResetLC();
1040  }
1041  return (*m_LC);
1042 }
1043 
1044 inline
1046 {
1047  if ( !m_LC ) {
1048  ResetLC();
1049  }
1050  return (*m_LC);
1051 }
1052 
1053 inline
1055 {
1056  return ((m_set_State[0] & 0x30) != 0);
1057 }
1058 
1059 inline
1061 {
1062  return true;
1063 }
1064 
1065 inline
1067 {
1068  return m_Identifier;
1069 }
1070 
1071 inline
1073 {
1074  m_set_State[0] |= 0x10;
1075  return m_Identifier;
1076 }
1077 
1078 inline
1080 {
1081  return ((m_set_State[0] & 0xc0) != 0);
1082 }
1083 
1084 inline
1086 {
1087  return true;
1088 }
1089 
1090 inline
1092 {
1093  return m_AffiliationInfo;
1094 }
1095 
1096 inline
1098 {
1099  m_set_State[0] |= 0x40;
1100  return m_AffiliationInfo;
1101 }
1102 
1103 ///////////////////////////////////////////////////////////
1104 ////////////////// end of inline methods //////////////////
1105 ///////////////////////////////////////////////////////////
1106 
1107 
1108 
1109 
1110 
1111 END_eutils_SCOPE // namespace eutils::
1112 
1113 
1114 #endif // eutils__OBJTOOLS_EUTILS_EFETCH_AUTHOR_BASE_HPP
CAffiliationInfo –.
C_Attlist –.
Definition: Author_.hpp:98
CAuthor_Base –.
Definition: Author_.hpp:74
CCollectiveName –.
CForeName –.
Definition: ForeName.hpp:64
CIdentifier –.
Definition: Identifier.hpp:64
CInitials –.
Definition: Initials.hpp:64
CLastName –.
Definition: LastName.hpp:64
CSuffix –.
Definition: Suffix.hpp:64
string
Definition: cgiapp.hpp:687
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
EResetVariant
Definition: serialbase.hpp:76
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
@ eDoResetVariant
Definition: serialbase.hpp:77
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
Uint4 m_set_State[1]
Definition: Author_.hpp:322
bool IsCollectiveName(void) const
Check if variant CollectiveName is selected.
Definition: Author_.hpp:988
TValidYN GetValidYN(void) const
Get the ValidYN member data.
Definition: Author_.hpp:788
bool IsSetSuffix(void) const
Check if a value has been assigned to Suffix data member.
Definition: Author_.hpp:932
DECLARE_INTERNAL_TYPE_INFO()
void ResetLC(void)
Reset LC data member.
Definition: Author_.cpp:341
NCBI_NS_NCBI::CRef< TSuffix > m_Suffix
Definition: Author_.hpp:446
static NCBI_NS_STD::string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Author_.cpp:246
void ResetIdentifier(void)
Reset Identifier data member.
Definition: Author_.cpp:355
CCollectiveName TCollectiveName
Definition: Author_.hpp:509
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
Definition: Author_.hpp:456
bool CanGetLastName(void) const
Check if it is safe to call GetLastName method.
Definition: Author_.hpp:866
bool CanGetSuffix(void) const
Check if it is safe to call GetSuffix method.
Definition: Author_.hpp:938
TIdentifier & SetIdentifier(void)
Assign a value to Identifier data member.
Definition: Author_.hpp:1072
const TSuffix & GetSuffix(void) const
Get the Suffix member data.
Definition: Author_.hpp:944
void DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool *pool=0)
Definition: Author_.cpp:225
E_Choice Which(void) const
Which variant is currently selected.
Definition: Author_.hpp:953
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Author_.hpp:255
void Reset(void)
Reset the whole object.
Definition: Author_.cpp:169
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Author_.hpp:82
TCollectiveName & SetCollectiveName(void)
Select the variant.
Definition: Author_.cpp:284
static const char *const sm_SelectionNames[]
Definition: Author_.hpp:576
NCBI_NS_NCBI::CRef< TInitials > m_Initials
Definition: Author_.hpp:445
void ResetEqualContrib(void)
Reset EqualContrib data member.
Definition: Author_.hpp:825
EAttlist_ValidYN m_ValidYN
Definition: Author_.hpp:228
bool IsSetLastName(void) const
Check if a value has been assigned to LastName data member.
Definition: Author_.hpp:860
virtual ~CAuthor_Base(void)
C_LC & operator=(const C_LC &)
EAttlist_EqualContrib m_EqualContrib
Definition: Author_.hpp:229
void ResetInitials(void)
Reset Initials data member.
Definition: Author_.cpp:135
TInitials & SetInitials(void)
Assign a value to Initials data member.
Definition: Author_.cpp:145
bool IsSetAffiliationInfo(void) const
Check if a value has been assigned to AffiliationInfo data member.
Definition: Author_.hpp:1079
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CAffiliationInfo > > m_AffiliationInfo
Definition: Author_.hpp:749
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Definition: Author_.hpp:1000
CAuthor_Base(void)
void SetDefaultValidYN(void)
Assign default value to ValidYN data member.
Definition: Author_.hpp:781
bool CanGetEqualContrib(void) const
Check if it is safe to call GetEqualContrib method.
Definition: Author_.hpp:819
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Author_.cpp:212
bool CanGetForeName(void) const
Check if it is safe to call GetForeName method.
Definition: Author_.hpp:896
NCBI_NS_NCBI::CRef< TLastName > m_LastName
Definition: Author_.hpp:443
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Author_.hpp:279
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CAffiliationInfo > > TAffiliationInfo
Definition: Author_.hpp:584
NCBI_NS_NCBI::CSerialObject * m_object
Definition: Author_.hpp:578
TEqualContrib & SetEqualContrib(void)
Assign a value to EqualContrib data member.
Definition: Author_.hpp:848
TEqualContrib GetEqualContrib(void) const
Get the EqualContrib member data.
Definition: Author_.hpp:832
bool IsSetEqualContrib(void) const
Check if a value has been assigned to EqualContrib data member.
Definition: Author_.hpp:813
C_LFIS & operator=(const C_LFIS &)
bool IsLFIS(void) const
Check if variant LFIS is selected.
Definition: Author_.hpp:982
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Author_.cpp:251
bool CanGetIdentifier(void) const
Check if it is safe to call GetIdentifier method.
Definition: Author_.hpp:1060
C_LC(const C_LC &)
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Author_.hpp:238
const TLastName & GetLastName(void) const
Get the LastName member data.
Definition: Author_.hpp:872
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: Author_.hpp:959
void Reset(void)
Reset the whole object.
Definition: Author_.cpp:73
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CIdentifier > > TIdentifier
Definition: Author_.hpp:583
const TAffiliationInfo & GetAffiliationInfo(void) const
Get the AffiliationInfo member data.
Definition: Author_.hpp:1091
C_Attlist & operator=(const C_Attlist &)
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CIdentifier > > m_Identifier
Definition: Author_.hpp:748
void ResetAttlist(void)
Reset Attlist data member.
Definition: Author_.cpp:327
C_Attlist TAttlist
Definition: Author_.hpp:581
const TCollectiveName & GetCollectiveName(void) const
Get the variant data.
Definition: Author_.cpp:278
EAttlist_EqualContrib TEqualContrib
Definition: Author_.hpp:127
const TLFIS & GetLFIS(void) const
Get the variant data.
Definition: Author_.cpp:256
const TInitials & GetInitials(void) const
Get the Initials member data.
Definition: Author_.hpp:923
bool IsSetIdentifier(void) const
Check if a value has been assigned to Identifier data member.
Definition: Author_.hpp:1054
bool IsSetValidYN(void) const
Check if a value has been assigned to ValidYN data member.
Definition: Author_.hpp:762
TValidYN & SetValidYN(void)
Assign a value to ValidYN data member.
Definition: Author_.hpp:801
NCBI_NS_NCBI::CRef< TLC > m_LC
Definition: Author_.hpp:747
void ResetSuffix(void)
Reset Suffix data member.
Definition: Author_.cpp:152
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Author_.hpp:594
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
Definition: Author_.hpp:1015
const TForeName & GetForeName(void) const
Get the ForeName member data.
Definition: Author_.hpp:902
void ResetForeName(void)
Reset ForeName data member.
Definition: Author_.cpp:118
TSuffix & SetSuffix(void)
Assign a value to Suffix data member.
Definition: Author_.cpp:162
E_Choice m_choice
Definition: Author_.hpp:572
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Author_.hpp:99
void ResetValidYN(void)
Reset ValidYN data member.
Definition: Author_.hpp:774
bool IsSetInitials(void) const
Check if a value has been assigned to Initials data member.
Definition: Author_.hpp:911
CAuthor_Base(const CAuthor_Base &)
TAffiliationInfo & SetAffiliationInfo(void)
Assign a value to AffiliationInfo data member.
Definition: Author_.hpp:1097
TLastName & SetLastName(void)
Assign a value to LastName data member.
Definition: Author_.hpp:881
TLC & SetLC(void)
Assign a value to LC data member.
Definition: Author_.hpp:1045
EAttlist_ValidYN TValidYN
Definition: Author_.hpp:126
TForeName & SetForeName(void)
Assign a value to ForeName data member.
Definition: Author_.cpp:128
void Reset(void)
Reset the whole object.
Definition: Author_.cpp:206
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Definition: Author_.hpp:994
bool IsSetLC(void) const
Check if a value has been assigned to LC data member.
Definition: Author_.hpp:1024
CAuthor_Base & operator=(const CAuthor_Base &)
void ResetAffiliationInfo(void)
Reset AffiliationInfo data member.
Definition: Author_.cpp:361
bool CanGetLC(void) const
Check if it is safe to call GetLC method.
Definition: Author_.hpp:1030
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
Definition: Author_.hpp:746
void ResetLastName(void)
Reset LastName data member.
Definition: Author_.cpp:104
bool CanGetValidYN(void) const
Check if it is safe to call GetValidYN method.
Definition: Author_.hpp:768
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: Author_.hpp:135
virtual void Reset(void)
Reset the whole object.
const TLC & GetLC(void) const
Get the LC member data.
Definition: Author_.hpp:1036
const TIdentifier & GetIdentifier(void) const
Get the Identifier member data.
Definition: Author_.hpp:1066
void Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset=NCBI_NS_NCBI::eDoResetVariant)
Select the requested variant if needed.
Definition: Author_.hpp:976
E_Choice
Choice variants.
Definition: Author_.hpp:450
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
Definition: Author_.hpp:1006
NCBI_NS_NCBI::CRef< TForeName > m_ForeName
Definition: Author_.hpp:444
C_Attlist(const C_Attlist &)
bool IsSetForeName(void) const
Check if a value has been assigned to ForeName data member.
Definition: Author_.hpp:890
TLFIS & SetLFIS(void)
Select the variant.
Definition: Author_.cpp:262
bool CanGetInitials(void) const
Check if it is safe to call GetInitials method.
Definition: Author_.hpp:917
bool CanGetAffiliationInfo(void) const
Check if it is safe to call GetAffiliationInfo method.
Definition: Author_.hpp:1085
@ e_MaxChoice
== e_CollectiveName+1
Definition: Author_.hpp:457
@ e_not_set
No variant selected.
Definition: Author_.hpp:451
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define BEGIN_eutils_SCOPE
Definition: Author_.hpp:51
#define END_eutils_SCOPE
Definition: Author_.hpp:52
Modified on Fri Jul 19 17:09:37 2024 by modify_doxy.py rev. 669887