NCBI C++ ToolKit
Affil_.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 Affil_.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/biblio/biblio.asn">biblio.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/biblio/biblio.def">biblio.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_BIBLIO_AFFIL_BASE_HPP
42 #define OBJECTS_BIBLIO_AFFIL_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_Biblio
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CAffil_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CAffil_Base(void);
78  // destructor
79  virtual ~CAffil_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  /// std representation
86  ///
87  /// C_Std --
88  ///
89 
91  {
93  public:
94  // constructor
95  C_Std(void);
96  // destructor
97  ~C_Std(void);
98 
99  // type info
101 
102  // types
103  typedef string TAffil;
104  typedef string TDiv;
105  typedef string TCity;
106  typedef string TSub;
107  typedef string TCountry;
108  typedef string TStreet;
109  typedef string TEmail;
110  typedef string TFax;
111  typedef string TPhone;
112  typedef string TPostal_code;
113 
114  // member index
115  enum class E_memberIndex {
116  e__allMandatory = 0,
117  e_affil,
118  e_div,
119  e_city,
120  e_sub,
121  e_country,
122  e_street,
123  e_email,
124  e_fax,
125  e_phone,
126  e_postal_code
127  };
129 
130  // getters
131  // setters
132 
133  /// Author Affiliation, Name
134  /// Check if a value has been assigned to Affil data member.
135  ///
136  /// Data member Affil is optional;
137  /// its type is defined as 'typedef string TAffil'
138  /// @return
139  /// - true, if a value has been assigned.
140  /// - false, otherwise.
141  bool IsSetAffil(void) const;
142 
143  /// Check if it is safe to call GetAffil method.
144  ///
145  /// @return
146  /// - true, if the data member is getatable.
147  /// - false, otherwise.
148  bool CanGetAffil(void) const;
149 
150  /// Reset Affil data member.
151  void ResetAffil(void);
152 
153  /// Get the Affil member data.
154  ///
155  /// @return
156  /// Reference to the member data.
157  const TAffil& GetAffil(void) const;
158 
159  /// Assign a value to Affil data member.
160  ///
161  /// @param value
162  /// Value to assign
163  void SetAffil(const TAffil& value);
164  void SetAffil(TAffil&& value);
165 
166  /// Assign a value to Affil data member.
167  ///
168  /// @return
169  /// Reference to the data value.
170  TAffil& SetAffil(void);
171 
172  /// Author Affiliation, Division
173  /// Check if a value has been assigned to Div data member.
174  ///
175  /// Data member Div is optional;
176  /// its type is defined as 'typedef string TDiv'
177  /// @return
178  /// - true, if a value has been assigned.
179  /// - false, otherwise.
180  bool IsSetDiv(void) const;
181 
182  /// Check if it is safe to call GetDiv method.
183  ///
184  /// @return
185  /// - true, if the data member is getatable.
186  /// - false, otherwise.
187  bool CanGetDiv(void) const;
188 
189  /// Reset Div data member.
190  void ResetDiv(void);
191 
192  /// Get the Div member data.
193  ///
194  /// @return
195  /// Reference to the member data.
196  const TDiv& GetDiv(void) const;
197 
198  /// Assign a value to Div data member.
199  ///
200  /// @param value
201  /// Value to assign
202  void SetDiv(const TDiv& value);
203  void SetDiv(TDiv&& value);
204 
205  /// Assign a value to Div data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TDiv& SetDiv(void);
210 
211  /// Author Affiliation, City
212  /// Check if a value has been assigned to City data member.
213  ///
214  /// Data member City is optional;
215  /// its type is defined as 'typedef string TCity'
216  /// @return
217  /// - true, if a value has been assigned.
218  /// - false, otherwise.
219  bool IsSetCity(void) const;
220 
221  /// Check if it is safe to call GetCity method.
222  ///
223  /// @return
224  /// - true, if the data member is getatable.
225  /// - false, otherwise.
226  bool CanGetCity(void) const;
227 
228  /// Reset City data member.
229  void ResetCity(void);
230 
231  /// Get the City member data.
232  ///
233  /// @return
234  /// Reference to the member data.
235  const TCity& GetCity(void) const;
236 
237  /// Assign a value to City data member.
238  ///
239  /// @param value
240  /// Value to assign
241  void SetCity(const TCity& value);
242  void SetCity(TCity&& value);
243 
244  /// Assign a value to City data member.
245  ///
246  /// @return
247  /// Reference to the data value.
248  TCity& SetCity(void);
249 
250  /// Author Affiliation, County Sub
251  /// Check if a value has been assigned to Sub data member.
252  ///
253  /// Data member Sub is optional;
254  /// its type is defined as 'typedef string TSub'
255  /// @return
256  /// - true, if a value has been assigned.
257  /// - false, otherwise.
258  bool IsSetSub(void) const;
259 
260  /// Check if it is safe to call GetSub method.
261  ///
262  /// @return
263  /// - true, if the data member is getatable.
264  /// - false, otherwise.
265  bool CanGetSub(void) const;
266 
267  /// Reset Sub data member.
268  void ResetSub(void);
269 
270  /// Get the Sub member data.
271  ///
272  /// @return
273  /// Reference to the member data.
274  const TSub& GetSub(void) const;
275 
276  /// Assign a value to Sub data member.
277  ///
278  /// @param value
279  /// Value to assign
280  void SetSub(const TSub& value);
281  void SetSub(TSub&& value);
282 
283  /// Assign a value to Sub data member.
284  ///
285  /// @return
286  /// Reference to the data value.
287  TSub& SetSub(void);
288 
289  /// Author Affiliation, Country
290  /// Check if a value has been assigned to Country data member.
291  ///
292  /// Data member Country is optional;
293  /// its type is defined as 'typedef string TCountry'
294  /// @return
295  /// - true, if a value has been assigned.
296  /// - false, otherwise.
297  bool IsSetCountry(void) const;
298 
299  /// Check if it is safe to call GetCountry method.
300  ///
301  /// @return
302  /// - true, if the data member is getatable.
303  /// - false, otherwise.
304  bool CanGetCountry(void) const;
305 
306  /// Reset Country data member.
307  void ResetCountry(void);
308 
309  /// Get the Country member data.
310  ///
311  /// @return
312  /// Reference to the member data.
313  const TCountry& GetCountry(void) const;
314 
315  /// Assign a value to Country data member.
316  ///
317  /// @param value
318  /// Value to assign
319  void SetCountry(const TCountry& value);
320  void SetCountry(TCountry&& value);
321 
322  /// Assign a value to Country data member.
323  ///
324  /// @return
325  /// Reference to the data value.
326  TCountry& SetCountry(void);
327 
328  /// street address, not ANSI
329  /// Check if a value has been assigned to Street data member.
330  ///
331  /// Data member Street is optional;
332  /// its type is defined as 'typedef string TStreet'
333  /// @return
334  /// - true, if a value has been assigned.
335  /// - false, otherwise.
336  bool IsSetStreet(void) const;
337 
338  /// Check if it is safe to call GetStreet method.
339  ///
340  /// @return
341  /// - true, if the data member is getatable.
342  /// - false, otherwise.
343  bool CanGetStreet(void) const;
344 
345  /// Reset Street data member.
346  void ResetStreet(void);
347 
348  /// Get the Street member data.
349  ///
350  /// @return
351  /// Reference to the member data.
352  const TStreet& GetStreet(void) const;
353 
354  /// Assign a value to Street data member.
355  ///
356  /// @param value
357  /// Value to assign
358  void SetStreet(const TStreet& value);
359  void SetStreet(TStreet&& value);
360 
361  /// Assign a value to Street data member.
362  ///
363  /// @return
364  /// Reference to the data value.
365  TStreet& SetStreet(void);
366 
367  /// Check if a value has been assigned to Email data member.
368  ///
369  /// Data member Email is optional;
370  /// its type is defined as 'typedef string TEmail'
371  /// @return
372  /// - true, if a value has been assigned.
373  /// - false, otherwise.
374  bool IsSetEmail(void) const;
375 
376  /// Check if it is safe to call GetEmail method.
377  ///
378  /// @return
379  /// - true, if the data member is getatable.
380  /// - false, otherwise.
381  bool CanGetEmail(void) const;
382 
383  /// Reset Email data member.
384  void ResetEmail(void);
385 
386  /// Get the Email member data.
387  ///
388  /// @return
389  /// Reference to the member data.
390  const TEmail& GetEmail(void) const;
391 
392  /// Assign a value to Email data member.
393  ///
394  /// @param value
395  /// Value to assign
396  void SetEmail(const TEmail& value);
397  void SetEmail(TEmail&& value);
398 
399  /// Assign a value to Email data member.
400  ///
401  /// @return
402  /// Reference to the data value.
403  TEmail& SetEmail(void);
404 
405  /// Check if a value has been assigned to Fax data member.
406  ///
407  /// Data member Fax is optional;
408  /// its type is defined as 'typedef string TFax'
409  /// @return
410  /// - true, if a value has been assigned.
411  /// - false, otherwise.
412  bool IsSetFax(void) const;
413 
414  /// Check if it is safe to call GetFax method.
415  ///
416  /// @return
417  /// - true, if the data member is getatable.
418  /// - false, otherwise.
419  bool CanGetFax(void) const;
420 
421  /// Reset Fax data member.
422  void ResetFax(void);
423 
424  /// Get the Fax member data.
425  ///
426  /// @return
427  /// Reference to the member data.
428  const TFax& GetFax(void) const;
429 
430  /// Assign a value to Fax data member.
431  ///
432  /// @param value
433  /// Value to assign
434  void SetFax(const TFax& value);
435  void SetFax(TFax&& value);
436 
437  /// Assign a value to Fax data member.
438  ///
439  /// @return
440  /// Reference to the data value.
441  TFax& SetFax(void);
442 
443  /// Check if a value has been assigned to Phone data member.
444  ///
445  /// Data member Phone is optional;
446  /// its type is defined as 'typedef string TPhone'
447  /// @return
448  /// - true, if a value has been assigned.
449  /// - false, otherwise.
450  bool IsSetPhone(void) const;
451 
452  /// Check if it is safe to call GetPhone method.
453  ///
454  /// @return
455  /// - true, if the data member is getatable.
456  /// - false, otherwise.
457  bool CanGetPhone(void) const;
458 
459  /// Reset Phone data member.
460  void ResetPhone(void);
461 
462  /// Get the Phone member data.
463  ///
464  /// @return
465  /// Reference to the member data.
466  const TPhone& GetPhone(void) const;
467 
468  /// Assign a value to Phone data member.
469  ///
470  /// @param value
471  /// Value to assign
472  void SetPhone(const TPhone& value);
473  void SetPhone(TPhone&& value);
474 
475  /// Assign a value to Phone data member.
476  ///
477  /// @return
478  /// Reference to the data value.
479  TPhone& SetPhone(void);
480 
481  /// Check if a value has been assigned to Postal_code data member.
482  ///
483  /// Data member Postal_code is optional;
484  /// its type is defined as 'typedef string TPostal_code'
485  /// @return
486  /// - true, if a value has been assigned.
487  /// - false, otherwise.
488  bool IsSetPostal_code(void) const;
489 
490  /// Check if it is safe to call GetPostal_code method.
491  ///
492  /// @return
493  /// - true, if the data member is getatable.
494  /// - false, otherwise.
495  bool CanGetPostal_code(void) const;
496 
497  /// Reset Postal_code data member.
498  void ResetPostal_code(void);
499 
500  /// Get the Postal_code member data.
501  ///
502  /// @return
503  /// Reference to the member data.
504  const TPostal_code& GetPostal_code(void) const;
505 
506  /// Assign a value to Postal_code data member.
507  ///
508  /// @param value
509  /// Value to assign
510  void SetPostal_code(const TPostal_code& value);
511  void SetPostal_code(TPostal_code&& value);
512 
513  /// Assign a value to Postal_code data member.
514  ///
515  /// @return
516  /// Reference to the data value.
517  TPostal_code& SetPostal_code(void);
518 
519  /// Reset the whole object
520  void Reset(void);
521 
522 
523  private:
524  // Prohibit copy constructor and assignment operator
525  C_Std(const C_Std&);
527 
528  // data
529  Uint4 m_set_State[1];
530  string m_Affil;
531  string m_Div;
532  string m_City;
533  string m_Sub;
534  string m_Country;
535  string m_Street;
536  string m_Email;
537  string m_Fax;
538  string m_Phone;
540  };
541 
542  /// Choice variants.
543  enum E_Choice {
544  e_not_set = 0, ///< No variant selected
545  e_Str, ///< unparsed string
546  e_Std
547  };
548  /// Maximum+1 value of the choice variant enumerator.
550  e_MaxChoice = 3 ///< == e_Std+1
551  };
552 
553  /// Reset the whole object
554  virtual void Reset(void);
555 
556  /// Reset the selection (set it to e_not_set).
557  virtual void ResetSelection(void);
558 
559  /// Which variant is currently selected.
560  ///
561  /// @return
562  /// Choice state enumerator.
563  E_Choice Which(void) const;
564 
565  /// Verify selection, throw exception if it differs from the expected.
566  ///
567  /// @param index
568  /// Expected selection.
569  void CheckSelected(E_Choice index) const;
570 
571  /// Throw 'InvalidSelection' exception.
572  ///
573  /// @param index
574  /// Expected selection.
575  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
576 
577  /// Retrieve selection name (for diagnostic purposes).
578  ///
579  /// @param index
580  /// One of possible selection states.
581  /// @return
582  /// Name string.
583  static string SelectionName(E_Choice index);
584 
585  /// Select the requested variant if needed.
586  ///
587  /// @param index
588  /// New selection state.
589  /// @param reset
590  /// Flag that defines the resetting of the variant data. The data will
591  /// be reset if either the current selection differs from the new one,
592  /// or the flag is set to eDoResetVariant.
594  /// Select the requested variant if needed,
595  /// allocating CObject variants from memory pool.
596  void Select(E_Choice index,
597  EResetVariant reset,
598  CObjectMemoryPool* pool);
599 
600  // types
601  typedef string TStr;
602  typedef C_Std TStd;
603 
604  // getters
605  // setters
606 
607 
608  /// Check if variant Str is selected.
609  ///
610  /// Str type is defined as 'typedef string TStr'.
611  /// @return
612  /// - true, if the variant is selected.
613  /// - false, otherwise.
614  bool IsStr(void) const;
615 
616  /// Get the variant data.
617  ///
618  /// @return
619  /// Reference to the data.
620  const TStr& GetStr(void) const;
621 
622  /// Select the variant.
623  ///
624  /// @return
625  /// Reference to the variant data.
626  TStr& SetStr(void);
627 
628  /// Select the variant and set its data.
629  ///
630  /// @param value
631  /// Variant data.
632  void SetStr(const TStr& value);
633 
634 
635  /// Check if variant Std is selected.
636  ///
637  /// Std type is defined as 'typedef C_Std TStd'.
638  /// @return
639  /// - true, if the variant is selected.
640  /// - false, otherwise.
641  bool IsStd(void) const;
642 
643  /// Get the variant data.
644  ///
645  /// @return
646  /// Reference to the data.
647  const TStd& GetStd(void) const;
648 
649  /// Select the variant.
650  ///
651  /// @return
652  /// Reference to the variant data.
653  TStd& SetStd(void);
654  /// Select the variant and set its data.
655  ///
656  /// @param value
657  /// Reference to the data.
658  void SetStd(TStd& value);
659 
660 
661 private:
662  // copy constructor and assignment operator
665  // choice state
667  // helper methods
668  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
669 
670  static const char* const sm_SelectionNames[];
671  // data
672  union {
673  NCBI_NS_NCBI::CUnionBuffer<NCBI_NS_STD::string> m_string;
674  NCBI_NS_NCBI::CSerialObject *m_object;
675  };
676 };
677 
678 /* @} */
679 
680 
681 
682 
683 
684 ///////////////////////////////////////////////////////////
685 ///////////////////// inline methods //////////////////////
686 ///////////////////////////////////////////////////////////
687 inline
689 {
690  return ((m_set_State[0] & 0x3) != 0);
691 }
692 
693 inline
695 {
696  return IsSetAffil();
697 }
698 
699 inline
701 {
702  if (!CanGetAffil()) {
703  ThrowUnassigned(0);
704  }
705  return m_Affil;
706 }
707 
708 inline
710 {
711  m_Affil = value;
712  m_set_State[0] |= 0x3;
713 }
714 
715 inline
717 {
718  m_Affil = std::forward<CAffil_Base::C_Std::TAffil>(value);
719  m_set_State[0] |= 0x3;
720 }
721 
722 inline
724 {
725 #ifdef _DEBUG
726  if (!IsSetAffil()) {
727  m_Affil = UnassignedString();
728  }
729 #endif
730  m_set_State[0] |= 0x1;
731  return m_Affil;
732 }
733 
734 inline
736 {
737  return ((m_set_State[0] & 0xc) != 0);
738 }
739 
740 inline
742 {
743  return IsSetDiv();
744 }
745 
746 inline
748 {
749  if (!CanGetDiv()) {
750  ThrowUnassigned(1);
751  }
752  return m_Div;
753 }
754 
755 inline
757 {
758  m_Div = value;
759  m_set_State[0] |= 0xc;
760 }
761 
762 inline
764 {
765  m_Div = std::forward<CAffil_Base::C_Std::TDiv>(value);
766  m_set_State[0] |= 0xc;
767 }
768 
769 inline
771 {
772 #ifdef _DEBUG
773  if (!IsSetDiv()) {
774  m_Div = UnassignedString();
775  }
776 #endif
777  m_set_State[0] |= 0x4;
778  return m_Div;
779 }
780 
781 inline
783 {
784  return ((m_set_State[0] & 0x30) != 0);
785 }
786 
787 inline
789 {
790  return IsSetCity();
791 }
792 
793 inline
795 {
796  if (!CanGetCity()) {
797  ThrowUnassigned(2);
798  }
799  return m_City;
800 }
801 
802 inline
804 {
805  m_City = value;
806  m_set_State[0] |= 0x30;
807 }
808 
809 inline
811 {
812  m_City = std::forward<CAffil_Base::C_Std::TCity>(value);
813  m_set_State[0] |= 0x30;
814 }
815 
816 inline
818 {
819 #ifdef _DEBUG
820  if (!IsSetCity()) {
821  m_City = UnassignedString();
822  }
823 #endif
824  m_set_State[0] |= 0x10;
825  return m_City;
826 }
827 
828 inline
830 {
831  return ((m_set_State[0] & 0xc0) != 0);
832 }
833 
834 inline
836 {
837  return IsSetSub();
838 }
839 
840 inline
842 {
843  if (!CanGetSub()) {
844  ThrowUnassigned(3);
845  }
846  return m_Sub;
847 }
848 
849 inline
851 {
852  m_Sub = value;
853  m_set_State[0] |= 0xc0;
854 }
855 
856 inline
858 {
859  m_Sub = std::forward<CAffil_Base::C_Std::TSub>(value);
860  m_set_State[0] |= 0xc0;
861 }
862 
863 inline
865 {
866 #ifdef _DEBUG
867  if (!IsSetSub()) {
868  m_Sub = UnassignedString();
869  }
870 #endif
871  m_set_State[0] |= 0x40;
872  return m_Sub;
873 }
874 
875 inline
877 {
878  return ((m_set_State[0] & 0x300) != 0);
879 }
880 
881 inline
883 {
884  return IsSetCountry();
885 }
886 
887 inline
889 {
890  if (!CanGetCountry()) {
891  ThrowUnassigned(4);
892  }
893  return m_Country;
894 }
895 
896 inline
898 {
899  m_Country = value;
900  m_set_State[0] |= 0x300;
901 }
902 
903 inline
905 {
906  m_Country = std::forward<CAffil_Base::C_Std::TCountry>(value);
907  m_set_State[0] |= 0x300;
908 }
909 
910 inline
912 {
913 #ifdef _DEBUG
914  if (!IsSetCountry()) {
915  m_Country = UnassignedString();
916  }
917 #endif
918  m_set_State[0] |= 0x100;
919  return m_Country;
920 }
921 
922 inline
924 {
925  return ((m_set_State[0] & 0xc00) != 0);
926 }
927 
928 inline
930 {
931  return IsSetStreet();
932 }
933 
934 inline
936 {
937  if (!CanGetStreet()) {
938  ThrowUnassigned(5);
939  }
940  return m_Street;
941 }
942 
943 inline
945 {
946  m_Street = value;
947  m_set_State[0] |= 0xc00;
948 }
949 
950 inline
952 {
953  m_Street = std::forward<CAffil_Base::C_Std::TStreet>(value);
954  m_set_State[0] |= 0xc00;
955 }
956 
957 inline
959 {
960 #ifdef _DEBUG
961  if (!IsSetStreet()) {
962  m_Street = UnassignedString();
963  }
964 #endif
965  m_set_State[0] |= 0x400;
966  return m_Street;
967 }
968 
969 inline
971 {
972  return ((m_set_State[0] & 0x3000) != 0);
973 }
974 
975 inline
977 {
978  return IsSetEmail();
979 }
980 
981 inline
983 {
984  if (!CanGetEmail()) {
985  ThrowUnassigned(6);
986  }
987  return m_Email;
988 }
989 
990 inline
992 {
993  m_Email = value;
994  m_set_State[0] |= 0x3000;
995 }
996 
997 inline
999 {
1000  m_Email = std::forward<CAffil_Base::C_Std::TEmail>(value);
1001  m_set_State[0] |= 0x3000;
1002 }
1003 
1004 inline
1006 {
1007 #ifdef _DEBUG
1008  if (!IsSetEmail()) {
1009  m_Email = UnassignedString();
1010  }
1011 #endif
1012  m_set_State[0] |= 0x1000;
1013  return m_Email;
1014 }
1015 
1016 inline
1018 {
1019  return ((m_set_State[0] & 0xc000) != 0);
1020 }
1021 
1022 inline
1024 {
1025  return IsSetFax();
1026 }
1027 
1028 inline
1030 {
1031  if (!CanGetFax()) {
1032  ThrowUnassigned(7);
1033  }
1034  return m_Fax;
1035 }
1036 
1037 inline
1039 {
1040  m_Fax = value;
1041  m_set_State[0] |= 0xc000;
1042 }
1043 
1044 inline
1046 {
1047  m_Fax = std::forward<CAffil_Base::C_Std::TFax>(value);
1048  m_set_State[0] |= 0xc000;
1049 }
1050 
1051 inline
1053 {
1054 #ifdef _DEBUG
1055  if (!IsSetFax()) {
1056  m_Fax = UnassignedString();
1057  }
1058 #endif
1059  m_set_State[0] |= 0x4000;
1060  return m_Fax;
1061 }
1062 
1063 inline
1065 {
1066  return ((m_set_State[0] & 0x30000) != 0);
1067 }
1068 
1069 inline
1071 {
1072  return IsSetPhone();
1073 }
1074 
1075 inline
1077 {
1078  if (!CanGetPhone()) {
1079  ThrowUnassigned(8);
1080  }
1081  return m_Phone;
1082 }
1083 
1084 inline
1086 {
1087  m_Phone = value;
1088  m_set_State[0] |= 0x30000;
1089 }
1090 
1091 inline
1093 {
1094  m_Phone = std::forward<CAffil_Base::C_Std::TPhone>(value);
1095  m_set_State[0] |= 0x30000;
1096 }
1097 
1098 inline
1100 {
1101 #ifdef _DEBUG
1102  if (!IsSetPhone()) {
1103  m_Phone = UnassignedString();
1104  }
1105 #endif
1106  m_set_State[0] |= 0x10000;
1107  return m_Phone;
1108 }
1109 
1110 inline
1112 {
1113  return ((m_set_State[0] & 0xc0000) != 0);
1114 }
1115 
1116 inline
1118 {
1119  return IsSetPostal_code();
1120 }
1121 
1122 inline
1124 {
1125  if (!CanGetPostal_code()) {
1126  ThrowUnassigned(9);
1127  }
1128  return m_Postal_code;
1129 }
1130 
1131 inline
1133 {
1134  m_Postal_code = value;
1135  m_set_State[0] |= 0xc0000;
1136 }
1137 
1138 inline
1140 {
1141  m_Postal_code = std::forward<CAffil_Base::C_Std::TPostal_code>(value);
1142  m_set_State[0] |= 0xc0000;
1143 }
1144 
1145 inline
1147 {
1148 #ifdef _DEBUG
1149  if (!IsSetPostal_code()) {
1150  m_Postal_code = UnassignedString();
1151  }
1152 #endif
1153  m_set_State[0] |= 0x40000;
1154  return m_Postal_code;
1155 }
1156 
1157 inline
1159 {
1160  return m_choice;
1161 }
1162 
1163 inline
1165 {
1166  if ( m_choice != index )
1167  ThrowInvalidSelection(index);
1168 }
1169 
1170 inline
1171 void CAffil_Base::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
1172 {
1173  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
1174  if ( m_choice != e_not_set )
1175  ResetSelection();
1176  DoSelect(index, pool);
1177  }
1178 }
1179 
1180 inline
1182 {
1183  Select(index, reset, 0);
1184 }
1185 
1186 inline
1187 bool CAffil_Base::IsStr(void) const
1188 {
1189  return m_choice == e_Str;
1190 }
1191 
1192 inline
1194 {
1196  return *m_string;
1197 }
1198 
1199 inline
1201 {
1203  return *m_string;
1204 }
1205 
1206 inline
1207 bool CAffil_Base::IsStd(void) const
1208 {
1209  return m_choice == e_Std;
1210 }
1211 
1212 ///////////////////////////////////////////////////////////
1213 ////////////////// end of inline methods //////////////////
1214 ///////////////////////////////////////////////////////////
1215 
1216 
1217 
1218 
1219 
1220 END_objects_SCOPE // namespace ncbi::objects::
1221 
1223 
1224 
1225 #endif // OBJECTS_BIBLIO_AFFIL_BASE_HPP
std representation
Definition: Affil_.hpp:91
CAffil_Base –.
Definition: Affil_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
void ThrowUnassigned(TMemberIndex index) const
EResetVariant
Definition: serialbase.hpp:76
static string UnassignedString(void)
Definition: serialbase.hpp:175
@ eDoResetVariant
Definition: serialbase.hpp:77
@ eDoNotResetVariant
Definition: serialbase.hpp:78
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_BIBLIO_EXPORT
Definition: ncbi_export.h:312
C_Std(const C_Std &)
TSub & SetSub(void)
Assign a value to Sub data member.
Definition: Affil_.hpp:864
bool CanGetCity(void) const
Check if it is safe to call GetCity method.
Definition: Affil_.hpp:788
TCity & SetCity(void)
Assign a value to City data member.
Definition: Affil_.hpp:817
NCBI_NS_NCBI::CSerialObject * m_object
Definition: Affil_.hpp:674
bool IsSetPhone(void) const
Check if a value has been assigned to Phone data member.
Definition: Affil_.hpp:1064
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Affil_.cpp:177
bool IsSetStreet(void) const
street address, not ANSI Check if a value has been assigned to Street data member.
Definition: Affil_.hpp:923
bool CanGetSub(void) const
Check if it is safe to call GetSub method.
Definition: Affil_.hpp:835
const TStr & GetStr(void) const
Get the variant data.
Definition: Affil_.hpp:1193
bool CanGetCountry(void) const
Check if it is safe to call GetCountry method.
Definition: Affil_.hpp:882
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetCity(void) const
Author Affiliation, City Check if a value has been assigned to City data member.
Definition: Affil_.hpp:782
DECLARE_INTERNAL_TYPE_INFO()
const TEmail & GetEmail(void) const
Get the Email member data.
Definition: Affil_.hpp:982
C_Std TStd
Definition: Affil_.hpp:602
TStreet & SetStreet(void)
Assign a value to Street data member.
Definition: Affil_.hpp:958
bool CanGetEmail(void) const
Check if it is safe to call GetEmail method.
Definition: Affil_.hpp:976
bool IsSetEmail(void) const
Check if a value has been assigned to Email data member.
Definition: Affil_.hpp:970
const TStreet & GetStreet(void) const
Get the Street member data.
Definition: Affil_.hpp:935
const TAffil & GetAffil(void) const
Get the Affil member data.
Definition: Affil_.hpp:700
CSerialObject Tparent
Definition: Affil_.hpp:74
TDiv & SetDiv(void)
Assign a value to Div data member.
Definition: Affil_.hpp:770
string TPostal_code
Definition: Affil_.hpp:112
const TSub & GetSub(void) const
Get the Sub member data.
Definition: Affil_.hpp:841
bool IsStr(void) const
Check if variant Str is selected.
Definition: Affil_.hpp:1187
TFax & SetFax(void)
Assign a value to Fax data member.
Definition: Affil_.hpp:1052
TStr & SetStr(void)
Select the variant.
Definition: Affil_.hpp:1200
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: Affil_.hpp:1164
E_Choice Which(void) const
Which variant is currently selected.
Definition: Affil_.hpp:1158
bool CanGetPostal_code(void) const
Check if it is safe to call GetPostal_code method.
Definition: Affil_.hpp:1117
bool IsSetFax(void) const
Check if a value has been assigned to Fax data member.
Definition: Affil_.hpp:1017
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Affil_.cpp:203
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
Definition: Affil_.hpp:549
bool IsSetDiv(void) const
Author Affiliation, Division Check if a value has been assigned to Div data member.
Definition: Affil_.hpp:735
string TStr
Definition: Affil_.hpp:601
const TCountry & GetCountry(void) const
Get the Country member data.
Definition: Affil_.hpp:888
bool CanGetFax(void) const
Check if it is safe to call GetFax method.
Definition: Affil_.hpp:1023
CAffil_Base & operator=(const CAffil_Base &)
const TPostal_code & GetPostal_code(void) const
Get the Postal_code member data.
Definition: Affil_.hpp:1123
E_Choice m_choice
Definition: Affil_.hpp:666
E_Choice
Choice variants.
Definition: Affil_.hpp:543
const TPhone & GetPhone(void) const
Get the Phone member data.
Definition: Affil_.hpp:1076
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
Definition: Affil_.hpp:673
TPostal_code & SetPostal_code(void)
Assign a value to Postal_code data member.
Definition: Affil_.hpp:1146
TPhone & SetPhone(void)
Assign a value to Phone data member.
Definition: Affil_.hpp:1099
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Affil_.cpp:162
TAffil & SetAffil(void)
Assign a value to Affil data member.
Definition: Affil_.hpp:723
Uint4 m_set_State[1]
Definition: Affil_.hpp:529
bool CanGetPhone(void) const
Check if it is safe to call GetPhone method.
Definition: Affil_.hpp:1070
string m_Postal_code
Definition: Affil_.hpp:539
const TFax & GetFax(void) const
Get the Fax member data.
Definition: Affil_.hpp:1029
bool IsStd(void) const
Check if variant Std is selected.
Definition: Affil_.hpp:1207
bool CanGetStreet(void) const
Check if it is safe to call GetStreet method.
Definition: Affil_.hpp:929
CSerialObject Tparent
Definition: Affil_.hpp:92
bool CanGetDiv(void) const
Check if it is safe to call GetDiv method.
Definition: Affil_.hpp:741
bool IsSetPostal_code(void) const
Check if a value has been assigned to Postal_code data member.
Definition: Affil_.hpp:1111
bool IsSetCountry(void) const
Author Affiliation, Country Check if a value has been assigned to Country data member.
Definition: Affil_.hpp:876
Tparent::CMemberIndex< E_memberIndex, 11 > TmemberIndex
Definition: Affil_.hpp:128
CAffil_Base(const CAffil_Base &)
C_Std & operator=(const C_Std &)
bool CanGetAffil(void) const
Check if it is safe to call GetAffil method.
Definition: Affil_.hpp:694
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
Definition: Affil_.hpp:673
const TCity & GetCity(void) const
Get the City member data.
Definition: Affil_.hpp:794
bool IsSetAffil(void) const
Author Affiliation, Name Check if a value has been assigned to Affil data member.
Definition: Affil_.hpp:688
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TDiv & GetDiv(void) const
Get the Div member data.
Definition: Affil_.hpp:747
TEmail & SetEmail(void)
Assign a value to Email data member.
Definition: Affil_.hpp:1005
TCountry & SetCountry(void)
Assign a value to Country data member.
Definition: Affil_.hpp:911
bool IsSetSub(void) const
Author Affiliation, County Sub Check if a value has been assigned to Sub data member.
Definition: Affil_.hpp:829
@ e_not_set
No variant selected.
Definition: Affil_.hpp:544
@ e_Str
unparsed string
Definition: Affil_.hpp:545
@ e_not_set
void SetDiv(CRef< objects::CSeq_entry > entry, string div)
Modified on Fri Mar 01 10:07:20 2024 by modify_doxy.py rev. 669887