NCBI C++ ToolKit
Cn_content_.cpp
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  * File Description:
27  * This code was generated by application DATATOOL
28  * using the following specifications:
29  * 'pubmed_mathml3.xsd'.
30  *
31  * ATTENTION:
32  * Don't edit or commit this file into CVS as this file will
33  * be overridden (by DATATOOL) without warning!
34  * ===========================================================================
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 #include <serial/serialimpl.hpp>
40 
41 // generated includes
75 
76 BEGIN_objects_SCOPE // namespace ncbi::objects::
77 
78 
79 // generated classes
80 
82 {
83  if ( m_choice != e_not_set )
85 }
86 
88 {
89  switch ( m_choice ) {
90  case e_Mi:
91  case e_Mn:
92  case e_Mo:
93  case e_Mtext:
94  case e_Mspace:
95  case e_Ms:
96  m_object->RemoveReference();
97  break;
98  default:
99  break;
100  }
102 }
103 
105 {
106  switch ( index ) {
107  case e_Mi:
108  (m_object = new(pool) ncbi::objects::CMi())->AddReference();
109  break;
110  case e_Mn:
111  (m_object = new(pool) ncbi::objects::CMn())->AddReference();
112  break;
113  case e_Mo:
114  (m_object = new(pool) ncbi::objects::CMo())->AddReference();
115  break;
116  case e_Mtext:
117  (m_object = new(pool) ncbi::objects::CMtext())->AddReference();
118  break;
119  case e_Mspace:
120  (m_object = new(pool) ncbi::objects::CMspace())->AddReference();
121  break;
122  case e_Ms:
123  (m_object = new(pool) ncbi::objects::CMs())->AddReference();
124  break;
125  default:
126  break;
127  }
128  m_choice = index;
129 }
130 
132  "not set",
133  "mi",
134  "mn",
135  "mo",
136  "mtext",
137  "mspace",
138  "ms"
139 };
140 
142 {
143  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
144 }
145 
147 {
148  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
149 }
150 
152 {
153  CheckSelected(e_Mi);
154  return *static_cast<const TMi*>(m_object);
155 }
156 
158 {
160  return *static_cast<TMi*>(m_object);
161 }
162 
164 {
165  TMi* ptr = &value;
166  if ( m_choice != e_Mi || m_object != ptr ) {
167  ResetSelection();
168  (m_object = ptr)->AddReference();
169  m_choice = e_Mi;
170  }
171 }
172 
174 {
175  CheckSelected(e_Mn);
176  return *static_cast<const TMn*>(m_object);
177 }
178 
180 {
182  return *static_cast<TMn*>(m_object);
183 }
184 
186 {
187  TMn* ptr = &value;
188  if ( m_choice != e_Mn || m_object != ptr ) {
189  ResetSelection();
190  (m_object = ptr)->AddReference();
191  m_choice = e_Mn;
192  }
193 }
194 
196 {
197  CheckSelected(e_Mo);
198  return *static_cast<const TMo*>(m_object);
199 }
200 
202 {
204  return *static_cast<TMo*>(m_object);
205 }
206 
208 {
209  TMo* ptr = &value;
210  if ( m_choice != e_Mo || m_object != ptr ) {
211  ResetSelection();
212  (m_object = ptr)->AddReference();
213  m_choice = e_Mo;
214  }
215 }
216 
218 {
219  CheckSelected(e_Mtext);
220  return *static_cast<const TMtext*>(m_object);
221 }
222 
224 {
226  return *static_cast<TMtext*>(m_object);
227 }
228 
230 {
231  TMtext* ptr = &value;
232  if ( m_choice != e_Mtext || m_object != ptr ) {
233  ResetSelection();
234  (m_object = ptr)->AddReference();
235  m_choice = e_Mtext;
236  }
237 }
238 
240 {
241  CheckSelected(e_Mspace);
242  return *static_cast<const TMspace*>(m_object);
243 }
244 
246 {
249  value.SetMspace();
250  return value;
251 }
252 
254 {
255  CheckSelected(e_Ms);
256  return *static_cast<const TMs*>(m_object);
257 }
258 
260 {
262  return *static_cast<TMs*>(m_object);
263 }
264 
266 {
267  TMs* ptr = &value;
268  if ( m_choice != e_Ms || m_object != ptr ) {
269  ResetSelection();
270  (m_object = ptr)->AddReference();
271  m_choice = e_Ms;
272  }
273 }
274 
275 // helper methods
276 
277 // type info
279 {
280  SET_INTERNAL_NAME("cn.content.E.PresentationExpression", "TokenExpression");
281  SET_CHOICE_MODULE("pubmed_mathml3");
282  ADD_NAMED_REF_CHOICE_VARIANT("mi", m_object, CMi)->SetNsQualified(true);
283  ADD_NAMED_REF_CHOICE_VARIANT("mn", m_object, CMn)->SetNsQualified(true);
284  ADD_NAMED_REF_CHOICE_VARIANT("mo", m_object, CMo)->SetNsQualified(true);
285  ADD_NAMED_REF_CHOICE_VARIANT("mtext", m_object, CMtext)->SetNsQualified(true);
286  ADD_NAMED_REF_CHOICE_VARIANT("mspace", m_object, CMspace)->SetNsQualified(true);
287  ADD_NAMED_REF_CHOICE_VARIANT("ms", m_object, CMs)->SetNsQualified(true);
288  info->CodeVersion(22301);
289  info->DataSpec(ncbi::EDataSpec::eXSD);
290 }
292 
293 // constructor
296 {
297 }
298 
299 // destructor
301 {
302  Reset();
303 }
304 
305 
307 {
308  if ( m_choice != e_not_set )
309  ResetSelection();
310 }
311 
313 {
314  switch ( m_choice ) {
315  case e_Maligngroup:
316  case e_Malignmark:
317  m_object->RemoveReference();
318  break;
319  default:
320  break;
321  }
323 }
324 
326 {
327  switch ( index ) {
328  case e_Maligngroup:
329  (m_object = new(pool) ncbi::objects::CMaligngroup())->AddReference();
330  break;
331  case e_Malignmark:
332  (m_object = new(pool) ncbi::objects::CMalignmark())->AddReference();
333  break;
334  default:
335  break;
336  }
337  m_choice = index;
338 }
339 
341  "not set",
342  "maligngroup",
343  "malignmark"
344 };
345 
347 {
348  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
349 }
350 
352 {
353  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
354 }
355 
357 {
358  CheckSelected(e_Maligngroup);
359  return *static_cast<const TMaligngroup*>(m_object);
360 }
361 
363 {
366  value.SetMaligngroup();
367  return value;
368 }
369 
371 {
372  CheckSelected(e_Malignmark);
373  return *static_cast<const TMalignmark*>(m_object);
374 }
375 
377 {
380  value.SetMalignmark();
381  return value;
382 }
383 
384 // helper methods
385 
386 // type info
388 {
389  SET_INTERNAL_NAME("cn.content.E.PresentationExpression", "MalignExpression");
390  SET_CHOICE_MODULE("pubmed_mathml3");
391  ADD_NAMED_REF_CHOICE_VARIANT("maligngroup", m_object, CMaligngroup)->SetNsQualified(true);
392  ADD_NAMED_REF_CHOICE_VARIANT("malignmark", m_object, CMalignmark)->SetNsQualified(true);
393  info->CodeVersion(22301);
394  info->DataSpec(ncbi::EDataSpec::eXSD);
395 }
397 
398 // constructor
401 {
402 }
403 
404 // destructor
406 {
407  Reset();
408 }
409 
410 
412 {
413  if ( m_choice != e_not_set )
414  ResetSelection();
415 }
416 
418 {
419  switch ( m_choice ) {
420  case e_TokenExpression:
421  case e_MalignExpression:
422  case e_Mrow:
423  case e_Mfrac:
424  case e_Msqrt:
425  case e_Mroot:
426  case e_Mstyle:
427  case e_Merror:
428  case e_Mpadded:
429  case e_Mphantom:
430  case e_Mfenced:
431  case e_Menclose:
432  case e_Msub:
433  case e_Msup:
434  case e_Msubsup:
435  case e_Munder:
436  case e_Mover:
437  case e_Munderover:
438  case e_Mmultiscripts:
439  case e_Mtable:
440  case e_Mstack:
441  case e_Mlongdiv:
442  case e_Maction:
443  m_object->RemoveReference();
444  break;
445  default:
446  break;
447  }
449 }
450 
451 void CCn_content_Base::C_E::C_PresentationExpression::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
452 {
453  switch ( index ) {
454  case e_TokenExpression:
455  (m_object = new(pool) C_TokenExpression())->AddReference();
456  break;
457  case e_MalignExpression:
458  (m_object = new(pool) C_MalignExpression())->AddReference();
459  break;
460  case e_Mrow:
461  (m_object = new(pool) ncbi::objects::CMrow())->AddReference();
462  break;
463  case e_Mfrac:
464  (m_object = new(pool) ncbi::objects::CMfrac())->AddReference();
465  break;
466  case e_Msqrt:
467  (m_object = new(pool) ncbi::objects::CMsqrt())->AddReference();
468  break;
469  case e_Mroot:
470  (m_object = new(pool) ncbi::objects::CMroot())->AddReference();
471  break;
472  case e_Mstyle:
473  (m_object = new(pool) ncbi::objects::CMstyle())->AddReference();
474  break;
475  case e_Merror:
476  (m_object = new(pool) ncbi::objects::CMerror())->AddReference();
477  break;
478  case e_Mpadded:
479  (m_object = new(pool) ncbi::objects::CMpadded())->AddReference();
480  break;
481  case e_Mphantom:
482  (m_object = new(pool) ncbi::objects::CMphantom())->AddReference();
483  break;
484  case e_Mfenced:
485  (m_object = new(pool) ncbi::objects::CMfenced())->AddReference();
486  break;
487  case e_Menclose:
488  (m_object = new(pool) ncbi::objects::CMenclose())->AddReference();
489  break;
490  case e_Msub:
491  (m_object = new(pool) ncbi::objects::CMsub())->AddReference();
492  break;
493  case e_Msup:
494  (m_object = new(pool) ncbi::objects::CMsup())->AddReference();
495  break;
496  case e_Msubsup:
497  (m_object = new(pool) ncbi::objects::CMsubsup())->AddReference();
498  break;
499  case e_Munder:
500  (m_object = new(pool) ncbi::objects::CMunder())->AddReference();
501  break;
502  case e_Mover:
503  (m_object = new(pool) ncbi::objects::CMover())->AddReference();
504  break;
505  case e_Munderover:
506  (m_object = new(pool) ncbi::objects::CMunderover())->AddReference();
507  break;
508  case e_Mmultiscripts:
509  (m_object = new(pool) ncbi::objects::CMmultiscripts())->AddReference();
510  break;
511  case e_Mtable:
512  (m_object = new(pool) ncbi::objects::CMtable())->AddReference();
513  break;
514  case e_Mstack:
515  (m_object = new(pool) ncbi::objects::CMstack())->AddReference();
516  break;
517  case e_Mlongdiv:
518  (m_object = new(pool) ncbi::objects::CMlongdiv())->AddReference();
519  break;
520  case e_Maction:
521  (m_object = new(pool) ncbi::objects::CMaction())->AddReference();
522  break;
523  default:
524  break;
525  }
526  m_choice = index;
527 }
528 
530  "not set",
531  "TokenExpression",
532  "MalignExpression",
533  "mrow",
534  "mfrac",
535  "msqrt",
536  "mroot",
537  "mstyle",
538  "merror",
539  "mpadded",
540  "mphantom",
541  "mfenced",
542  "menclose",
543  "msub",
544  "msup",
545  "msubsup",
546  "munder",
547  "mover",
548  "munderover",
549  "mmultiscripts",
550  "mtable",
551  "mstack",
552  "mlongdiv",
553  "maction"
554 };
555 
557 {
558  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
559 }
560 
562 {
563  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
564 }
565 
567 {
569  return *static_cast<const TTokenExpression*>(m_object);
570 }
571 
573 {
575  return *static_cast<TTokenExpression*>(m_object);
576 }
577 
579 {
580  TTokenExpression* ptr = &value;
581  if ( m_choice != e_TokenExpression || m_object != ptr ) {
582  ResetSelection();
583  (m_object = ptr)->AddReference();
585  }
586 }
587 
589 {
591  return *static_cast<const TMalignExpression*>(m_object);
592 }
593 
595 {
597  return *static_cast<TMalignExpression*>(m_object);
598 }
599 
601 {
602  TMalignExpression* ptr = &value;
603  if ( m_choice != e_MalignExpression || m_object != ptr ) {
604  ResetSelection();
605  (m_object = ptr)->AddReference();
607  }
608 }
609 
611 {
613  return *static_cast<const TMrow*>(m_object);
614 }
615 
617 {
619  return *static_cast<TMrow*>(m_object);
620 }
621 
623 {
624  TMrow* ptr = &value;
625  if ( m_choice != e_Mrow || m_object != ptr ) {
626  ResetSelection();
627  (m_object = ptr)->AddReference();
628  m_choice = e_Mrow;
629  }
630 }
631 
633 {
635  return *static_cast<const TMfrac*>(m_object);
636 }
637 
639 {
641  return *static_cast<TMfrac*>(m_object);
642 }
643 
645 {
646  TMfrac* ptr = &value;
647  if ( m_choice != e_Mfrac || m_object != ptr ) {
648  ResetSelection();
649  (m_object = ptr)->AddReference();
650  m_choice = e_Mfrac;
651  }
652 }
653 
655 {
657  return *static_cast<const TMsqrt*>(m_object);
658 }
659 
661 {
663  return *static_cast<TMsqrt*>(m_object);
664 }
665 
667 {
668  TMsqrt* ptr = &value;
669  if ( m_choice != e_Msqrt || m_object != ptr ) {
670  ResetSelection();
671  (m_object = ptr)->AddReference();
672  m_choice = e_Msqrt;
673  }
674 }
675 
677 {
679  return *static_cast<const TMroot*>(m_object);
680 }
681 
683 {
685  return *static_cast<TMroot*>(m_object);
686 }
687 
689 {
690  TMroot* ptr = &value;
691  if ( m_choice != e_Mroot || m_object != ptr ) {
692  ResetSelection();
693  (m_object = ptr)->AddReference();
694  m_choice = e_Mroot;
695  }
696 }
697 
699 {
701  return *static_cast<const TMstyle*>(m_object);
702 }
703 
705 {
707  return *static_cast<TMstyle*>(m_object);
708 }
709 
711 {
712  TMstyle* ptr = &value;
713  if ( m_choice != e_Mstyle || m_object != ptr ) {
714  ResetSelection();
715  (m_object = ptr)->AddReference();
716  m_choice = e_Mstyle;
717  }
718 }
719 
721 {
723  return *static_cast<const TMerror*>(m_object);
724 }
725 
727 {
729  return *static_cast<TMerror*>(m_object);
730 }
731 
733 {
734  TMerror* ptr = &value;
735  if ( m_choice != e_Merror || m_object != ptr ) {
736  ResetSelection();
737  (m_object = ptr)->AddReference();
738  m_choice = e_Merror;
739  }
740 }
741 
743 {
745  return *static_cast<const TMpadded*>(m_object);
746 }
747 
749 {
751  return *static_cast<TMpadded*>(m_object);
752 }
753 
755 {
756  TMpadded* ptr = &value;
757  if ( m_choice != e_Mpadded || m_object != ptr ) {
758  ResetSelection();
759  (m_object = ptr)->AddReference();
761  }
762 }
763 
765 {
767  return *static_cast<const TMphantom*>(m_object);
768 }
769 
771 {
773  return *static_cast<TMphantom*>(m_object);
774 }
775 
777 {
778  TMphantom* ptr = &value;
779  if ( m_choice != e_Mphantom || m_object != ptr ) {
780  ResetSelection();
781  (m_object = ptr)->AddReference();
783  }
784 }
785 
787 {
789  return *static_cast<const TMfenced*>(m_object);
790 }
791 
793 {
795  return *static_cast<TMfenced*>(m_object);
796 }
797 
799 {
800  TMfenced* ptr = &value;
801  if ( m_choice != e_Mfenced || m_object != ptr ) {
802  ResetSelection();
803  (m_object = ptr)->AddReference();
805  }
806 }
807 
809 {
811  return *static_cast<const TMenclose*>(m_object);
812 }
813 
815 {
817  return *static_cast<TMenclose*>(m_object);
818 }
819 
821 {
822  TMenclose* ptr = &value;
823  if ( m_choice != e_Menclose || m_object != ptr ) {
824  ResetSelection();
825  (m_object = ptr)->AddReference();
827  }
828 }
829 
831 {
833  return *static_cast<const TMsub*>(m_object);
834 }
835 
837 {
839  return *static_cast<TMsub*>(m_object);
840 }
841 
843 {
844  TMsub* ptr = &value;
845  if ( m_choice != e_Msub || m_object != ptr ) {
846  ResetSelection();
847  (m_object = ptr)->AddReference();
848  m_choice = e_Msub;
849  }
850 }
851 
853 {
855  return *static_cast<const TMsup*>(m_object);
856 }
857 
859 {
861  return *static_cast<TMsup*>(m_object);
862 }
863 
865 {
866  TMsup* ptr = &value;
867  if ( m_choice != e_Msup || m_object != ptr ) {
868  ResetSelection();
869  (m_object = ptr)->AddReference();
870  m_choice = e_Msup;
871  }
872 }
873 
875 {
877  return *static_cast<const TMsubsup*>(m_object);
878 }
879 
881 {
883  return *static_cast<TMsubsup*>(m_object);
884 }
885 
887 {
888  TMsubsup* ptr = &value;
889  if ( m_choice != e_Msubsup || m_object != ptr ) {
890  ResetSelection();
891  (m_object = ptr)->AddReference();
893  }
894 }
895 
897 {
899  return *static_cast<const TMunder*>(m_object);
900 }
901 
903 {
905  return *static_cast<TMunder*>(m_object);
906 }
907 
909 {
910  TMunder* ptr = &value;
911  if ( m_choice != e_Munder || m_object != ptr ) {
912  ResetSelection();
913  (m_object = ptr)->AddReference();
914  m_choice = e_Munder;
915  }
916 }
917 
919 {
921  return *static_cast<const TMover*>(m_object);
922 }
923 
925 {
927  return *static_cast<TMover*>(m_object);
928 }
929 
931 {
932  TMover* ptr = &value;
933  if ( m_choice != e_Mover || m_object != ptr ) {
934  ResetSelection();
935  (m_object = ptr)->AddReference();
936  m_choice = e_Mover;
937  }
938 }
939 
941 {
943  return *static_cast<const TMunderover*>(m_object);
944 }
945 
947 {
949  return *static_cast<TMunderover*>(m_object);
950 }
951 
953 {
954  TMunderover* ptr = &value;
955  if ( m_choice != e_Munderover || m_object != ptr ) {
956  ResetSelection();
957  (m_object = ptr)->AddReference();
959  }
960 }
961 
963 {
965  return *static_cast<const TMmultiscripts*>(m_object);
966 }
967 
969 {
971  return *static_cast<TMmultiscripts*>(m_object);
972 }
973 
975 {
976  TMmultiscripts* ptr = &value;
977  if ( m_choice != e_Mmultiscripts || m_object != ptr ) {
978  ResetSelection();
979  (m_object = ptr)->AddReference();
981  }
982 }
983 
985 {
987  return *static_cast<const TMtable*>(m_object);
988 }
989 
991 {
993  return *static_cast<TMtable*>(m_object);
994 }
995 
997 {
998  TMtable* ptr = &value;
999  if ( m_choice != e_Mtable || m_object != ptr ) {
1000  ResetSelection();
1001  (m_object = ptr)->AddReference();
1002  m_choice = e_Mtable;
1003  }
1004 }
1005 
1007 {
1009  return *static_cast<const TMstack*>(m_object);
1010 }
1011 
1013 {
1015  return *static_cast<TMstack*>(m_object);
1016 }
1017 
1019 {
1020  TMstack* ptr = &value;
1021  if ( m_choice != e_Mstack || m_object != ptr ) {
1022  ResetSelection();
1023  (m_object = ptr)->AddReference();
1024  m_choice = e_Mstack;
1025  }
1026 }
1027 
1029 {
1031  return *static_cast<const TMlongdiv*>(m_object);
1032 }
1033 
1035 {
1037  return *static_cast<TMlongdiv*>(m_object);
1038 }
1039 
1041 {
1042  TMlongdiv* ptr = &value;
1043  if ( m_choice != e_Mlongdiv || m_object != ptr ) {
1044  ResetSelection();
1045  (m_object = ptr)->AddReference();
1046  m_choice = e_Mlongdiv;
1047  }
1048 }
1049 
1051 {
1053  return *static_cast<const TMaction*>(m_object);
1054 }
1055 
1057 {
1059  return *static_cast<TMaction*>(m_object);
1060 }
1061 
1063 {
1064  TMaction* ptr = &value;
1065  if ( m_choice != e_Maction || m_object != ptr ) {
1066  ResetSelection();
1067  (m_object = ptr)->AddReference();
1068  m_choice = e_Maction;
1069  }
1070 }
1071 
1072 // helper methods
1073 
1074 // type info
1076 {
1077  SET_INTERNAL_NAME("cn.content.E", "PresentationExpression");
1078  SET_CHOICE_MODULE("pubmed_mathml3");
1079  ADD_NAMED_REF_CHOICE_VARIANT("TokenExpression", m_object, C_TokenExpression)->SetNotag();
1080  ADD_NAMED_REF_CHOICE_VARIANT("MalignExpression", m_object, C_MalignExpression)->SetNotag();
1081  ADD_NAMED_REF_CHOICE_VARIANT("mrow", m_object, CMrow)->SetNsQualified(true);
1082  ADD_NAMED_REF_CHOICE_VARIANT("mfrac", m_object, CMfrac)->SetNsQualified(true);
1083  ADD_NAMED_REF_CHOICE_VARIANT("msqrt", m_object, CMsqrt)->SetNsQualified(true);
1084  ADD_NAMED_REF_CHOICE_VARIANT("mroot", m_object, CMroot)->SetNsQualified(true);
1085  ADD_NAMED_REF_CHOICE_VARIANT("mstyle", m_object, CMstyle)->SetNsQualified(true);
1086  ADD_NAMED_REF_CHOICE_VARIANT("merror", m_object, CMerror)->SetNsQualified(true);
1087  ADD_NAMED_REF_CHOICE_VARIANT("mpadded", m_object, CMpadded)->SetNsQualified(true);
1088  ADD_NAMED_REF_CHOICE_VARIANT("mphantom", m_object, CMphantom)->SetNsQualified(true);
1089  ADD_NAMED_REF_CHOICE_VARIANT("mfenced", m_object, CMfenced)->SetNsQualified(true);
1090  ADD_NAMED_REF_CHOICE_VARIANT("menclose", m_object, CMenclose)->SetNsQualified(true);
1091  ADD_NAMED_REF_CHOICE_VARIANT("msub", m_object, CMsub)->SetNsQualified(true);
1092  ADD_NAMED_REF_CHOICE_VARIANT("msup", m_object, CMsup)->SetNsQualified(true);
1093  ADD_NAMED_REF_CHOICE_VARIANT("msubsup", m_object, CMsubsup)->SetNsQualified(true);
1094  ADD_NAMED_REF_CHOICE_VARIANT("munder", m_object, CMunder)->SetNsQualified(true);
1095  ADD_NAMED_REF_CHOICE_VARIANT("mover", m_object, CMover)->SetNsQualified(true);
1096  ADD_NAMED_REF_CHOICE_VARIANT("munderover", m_object, CMunderover)->SetNsQualified(true);
1097  ADD_NAMED_REF_CHOICE_VARIANT("mmultiscripts", m_object, CMmultiscripts)->SetNsQualified(true);
1098  ADD_NAMED_REF_CHOICE_VARIANT("mtable", m_object, CMtable)->SetNsQualified(true);
1099  ADD_NAMED_REF_CHOICE_VARIANT("mstack", m_object, CMstack)->SetNsQualified(true);
1100  ADD_NAMED_REF_CHOICE_VARIANT("mlongdiv", m_object, CMlongdiv)->SetNsQualified(true);
1101  ADD_NAMED_REF_CHOICE_VARIANT("maction", m_object, CMaction)->SetNsQualified(true);
1102  info->CodeVersion(22301);
1103  info->DataSpec(ncbi::EDataSpec::eXSD);
1104 }
1106 
1107 // constructor
1109  : m_choice(e_not_set)
1110 {
1111 }
1112 
1113 // destructor
1115 {
1116  Reset();
1117 }
1118 
1119 
1121 {
1122  if ( m_choice != e_not_set )
1123  ResetSelection();
1124 }
1125 
1127 {
1128  switch ( m_choice ) {
1129  case e__CharData:
1130  m_string.Destruct();
1131  break;
1132  case e_Mglyph:
1133  case e_Sep:
1135  m_object->RemoveReference();
1136  break;
1137  default:
1138  break;
1139  }
1140  m_choice = e_not_set;
1141 }
1142 
1143 void CCn_content_Base::C_E::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
1144 {
1145  switch ( index ) {
1146  case e_Mglyph:
1147  (m_object = new(pool) ncbi::objects::CMglyph())->AddReference();
1148  break;
1149  case e_Sep:
1150  (m_object = new(pool) ncbi::objects::CSep())->AddReference();
1151  break;
1153  (m_object = new(pool) C_PresentationExpression())->AddReference();
1154  break;
1155  case e__CharData:
1156  m_string.Construct();
1157  break;
1158  default:
1159  break;
1160  }
1161  m_choice = index;
1162 }
1163 
1164 const char* const CCn_content_Base::C_E::sm_SelectionNames[] = {
1165  "not set",
1166  "-CharData",
1167  "mglyph",
1168  "sep",
1169  "PresentationExpression"
1170 };
1171 
1173 {
1174  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
1175 }
1176 
1178 {
1179  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
1180 }
1181 
1183 {
1185  *m_string = value;
1186 }
1187 
1189 {
1191  return *static_cast<const TMglyph*>(m_object);
1192 }
1193 
1195 {
1198  value.SetMglyph();
1199  return value;
1200 }
1201 
1203 {
1205  return *static_cast<const TSep*>(m_object);
1206 }
1207 
1209 {
1211  return *static_cast<TSep*>(m_object);
1212 }
1213 
1215 {
1216  TSep* ptr = &value;
1217  if ( m_choice != e_Sep || m_object != ptr ) {
1218  ResetSelection();
1219  (m_object = ptr)->AddReference();
1220  m_choice = e_Sep;
1221  }
1222 }
1223 
1225 {
1227  return *static_cast<const TPresentationExpression*>(m_object);
1228 }
1229 
1231 {
1233  return *static_cast<TPresentationExpression*>(m_object);
1234 }
1235 
1237 {
1239  if ( m_choice != e_PresentationExpression || m_object != ptr ) {
1240  ResetSelection();
1241  (m_object = ptr)->AddReference();
1243  }
1244 }
1245 
1246 // helper methods
1247 
1248 // type info
1250 {
1251  SET_INTERNAL_NAME("cn.content", "E");
1252  SET_CHOICE_MODULE("pubmed_mathml3");
1253  SET_NAMESPACE("http://www.w3.org/1998/Math/MathML")->SetNsQualified(false);
1254  ADD_NAMED_BUF_CHOICE_VARIANT("-CharData", m_string, STD, (string))->SetNotag();
1255  ADD_NAMED_REF_CHOICE_VARIANT("mglyph", m_object, CMglyph)->SetNsQualified(true);
1256  ADD_NAMED_REF_CHOICE_VARIANT("sep", m_object, CSep)->SetNsQualified(true);
1257  ADD_NAMED_REF_CHOICE_VARIANT("PresentationExpression", m_object, C_PresentationExpression)->SetNotag();
1258  info->CodeVersion(22301);
1259  info->DataSpec(ncbi::EDataSpec::eXSD);
1260 }
1262 
1263 // constructor
1265  : m_choice(e_not_set)
1266 {
1267 }
1268 
1269 // destructor
1271 {
1272  Reset();
1273 }
1274 
1275 
1277 {
1278  m_data.clear();
1279  m_set_State[0] &= ~0x3;
1280 }
1281 
1283 {
1284  SET_CLASS_MODULE("pubmed_mathml3");
1285  SET_NAMESPACE("http://www.w3.org/1998/Math/MathML")->SetNsQualified(false);
1286  ADD_NAMED_MEMBER("", m_data, STL_list, (STL_CRef, (CLASS, (C_E))))->SetSetFlag(MEMBER_PTR(m_set_State[0]));
1287  info->RandomOrder();
1288  info->CodeVersion(22301);
1289  info->DataSpec(ncbi::EDataSpec::eXSD);
1290 }
1292 
1293 // constructor
1295 {
1296  memset(m_set_State,0,sizeof(m_set_State));
1297 }
1298 
1299 // destructor
1301 {
1302 }
1303 
1304 
1305 
1306 END_objects_SCOPE // namespace ncbi::objects::
1307 
1309 
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CCn_content_Base::C_E::C_PresentationExpression::C_TokenExpression)
BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO("cn.content", CCn_content)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
C_PresentationExpression –.
CCn_content –.
Definition: Cn_content.hpp:66
CMaction –.
Definition: Maction.hpp:66
CMaligngroup –.
Definition: Maligngroup.hpp:66
CMalignmark –.
Definition: Malignmark.hpp:66
CMenclose –.
Definition: Menclose.hpp:66
CMerror –.
Definition: Merror.hpp:66
CMfenced –.
Definition: Mfenced.hpp:66
CMfrac –.
Definition: Mfrac.hpp:66
CMglyph –.
Definition: Mglyph.hpp:66
CMi –.
Definition: Mi.hpp:66
CMlongdiv –.
Definition: Mlongdiv.hpp:66
CMmultiscripts –.
CMn –.
Definition: Mn.hpp:66
CMo –.
Definition: Mo.hpp:66
CMover –.
Definition: Mover.hpp:66
CMpadded –.
Definition: Mpadded.hpp:66
CMphantom –.
Definition: Mphantom.hpp:66
CMroot –.
Definition: Mroot.hpp:66
CMrow –.
Definition: Mrow.hpp:66
CMs –.
Definition: Ms.hpp:66
CMspace –.
Definition: Mspace.hpp:66
CMsqrt –.
Definition: Msqrt.hpp:66
CMstack –.
Definition: Mstack.hpp:66
CMstyle –.
Definition: Mstyle.hpp:66
CMsub –.
Definition: Msub.hpp:66
CMsubsup –.
Definition: Msubsup.hpp:66
CMsup –.
Definition: Msup.hpp:66
CMtable –.
Definition: Mtable.hpp:66
CMtext –.
Definition: Mtext.hpp:66
CMunder –.
Definition: Munder.hpp:66
CMunderover –.
Definition: Munderover.hpp:66
CSep –.
Definition: Sep.hpp:66
char value[7]
Definition: config.c:431
string
Definition: cgiapp.hpp:687
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
#define MEMBER_PTR(MemberName)
Definition: serialimpl.hpp:284
#define ADD_NAMED_MEMBER(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:342
#define END_CLASS_INFO
Definition: serialimpl.hpp:456
#define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:400
#define SET_CLASS_MODULE(ModuleName)
Definition: serialimpl.hpp:444
#define SET_NAMESPACE(name)
Definition: serialimpl.hpp:450
#define END_CHOICE_INFO
Definition: serialimpl.hpp:506
#define SET_INTERNAL_NAME(OwnerName, MemberName)
Definition: serialimpl.hpp:447
#define SET_CHOICE_MODULE(ModuleName)
Definition: serialimpl.hpp:500
#define ADD_NAMED_BUF_CHOICE_VARIANT(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:385
@ eDoNotResetVariant
Definition: serialbase.hpp:78
void AddReference(void) const
Add reference to object.
Definition: ncbiobj.hpp:489
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const TTokenExpression & GetTokenExpression(void) const
Get the variant data.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TMaction & GetMaction(void) const
Get the variant data.
TMstack & SetMstack(void)
Select the variant.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
TMtable & SetMtable(void)
Select the variant.
const TMalignExpression & GetMalignExpression(void) const
Get the variant data.
void Reset(void)
Reset data member.
const TMtext & GetMtext(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
const TMfenced & GetMfenced(void) const
Get the variant data.
const TMover & GetMover(void) const
Get the variant data.
TMroot & SetMroot(void)
Select the variant.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
const TMaligngroup & GetMaligngroup(void) const
Get the variant data.
const TMstyle & GetMstyle(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
TMlongdiv & SetMlongdiv(void)
Select the variant.
const TMlongdiv & GetMlongdiv(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
const TMo & GetMo(void) const
Get the variant data.
static const char *const sm_SelectionNames[]
const TMglyph & GetMglyph(void) const
Get the variant data.
const TMi & GetMi(void) const
Get the variant data.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TMfenced & SetMfenced(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TMpadded & GetMpadded(void) const
Get the variant data.
T_CharData & Set_CharData(void)
Select the variant.
const TMerror & GetMerror(void) const
Get the variant data.
list< CRef< C_E > > m_data
const TMsub & GetMsub(void) const
Get the variant data.
const TMs & GetMs(void) const
Get the variant data.
const TMmultiscripts & GetMmultiscripts(void) const
Get the variant data.
TMsub & SetMsub(void)
Select the variant.
TMpadded & SetMpadded(void)
Select the variant.
const TMspace & GetMspace(void) const
Get the variant data.
TMsubsup & SetMsubsup(void)
Select the variant.
const TMunderover & GetMunderover(void) const
Get the variant data.
TMstyle & SetMstyle(void)
Select the variant.
const TMroot & GetMroot(void) const
Get the variant data.
virtual ~CCn_content_Base(void)
const TMn & GetMn(void) const
Get the variant data.
TMunder & SetMunder(void)
Select the variant.
const TMsubsup & GetMsubsup(void) const
Get the variant data.
TMmultiscripts & SetMmultiscripts(void)
Select the variant.
TSep & SetSep(void)
Select the variant.
TMsup & SetMsup(void)
Select the variant.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
const TMstack & GetMstack(void) const
Get the variant data.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
const TMsqrt & GetMsqrt(void) const
Get the variant data.
TMaction & SetMaction(void)
Select the variant.
const TMsup & GetMsup(void) const
Get the variant data.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TMrow & SetMrow(void)
Select the variant.
NCBI_NS_NCBI::CSerialObject * m_object
void Reset(void)
Reset the whole object.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
const TMtable & GetMtable(void) const
Get the variant data.
const TSep & GetSep(void) const
Get the variant data.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
TMsqrt & SetMsqrt(void)
Select the variant.
TMunderover & SetMunderover(void)
Select the variant.
TMalignExpression & SetMalignExpression(void)
Select the variant.
E_Choice
Choice variants.
TMphantom & SetMphantom(void)
Select the variant.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Cn_content_.cpp:87
TPresentationExpression & SetPresentationExpression(void)
Select the variant.
const TMrow & GetMrow(void) const
Get the variant data.
const TMalignmark & GetMalignmark(void) const
Get the variant data.
void Reset(void)
Reset the whole object.
const TMphantom & GetMphantom(void) const
Get the variant data.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
TMerror & SetMerror(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
TTokenExpression & SetTokenExpression(void)
Select the variant.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
const TMenclose & GetMenclose(void) const
Get the variant data.
const TMunder & GetMunder(void) const
Get the variant data.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
const TMfrac & GetMfrac(void) const
Get the variant data.
TMglyph & SetMglyph(void)
Select the variant.
TMenclose & SetMenclose(void)
Select the variant.
TMover & SetMover(void)
Select the variant.
TMfrac & SetMfrac(void)
Select the variant.
const TPresentationExpression & GetPresentationExpression(void) const
Get the variant data.
@ e_not_set
No variant selected.
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Fri Dec 01 04:46:26 2023 by modify_doxy.py rev. 669887