NCBI C++ ToolKit
PC_XRefData_.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  * 'pcsubstance.asn'.
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
44 
45 BEGIN_objects_SCOPE // namespace ncbi::objects::
46 
47 
48 // generated classes
49 
51 {
52  if ( m_choice != e_not_set )
54 }
55 
57 {
58  switch ( m_choice ) {
59  case e_Regid:
60  case e_Rn:
61  case e_Mesh:
62  case e_Dburl:
63  case e_Sburl:
64  case e_Asurl:
65  case e_Patent:
68  case e_Doi:
69  case e_Citation:
70  m_string.Destruct();
71  break;
72  default:
73  break;
74  }
76 }
77 
78 void CPC_XRefData_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
79 {
80  switch ( index ) {
81  case e_Pmid:
82  m_Pmid = 0;
83  break;
84  case e_Gi:
85  m_Gi = 0;
86  break;
87  case e_Mmdb:
88  m_Mmdb = 0;
89  break;
90  case e_Sid:
91  m_Sid = 0;
92  break;
93  case e_Cid:
94  m_Cid = 0;
95  break;
96  case e_Protein_gi:
97  m_Protein_gi = 0;
98  break;
99  case e_Nucleotide_gi:
100  m_Nucleotide_gi = 0;
101  break;
102  case e_Taxonomy:
103  m_Taxonomy = 0;
104  break;
105  case e_Aid:
106  m_Aid = 0;
107  break;
108  case e_Mim:
109  m_Mim = 0;
110  break;
111  case e_Gene:
112  m_Gene = 0;
113  break;
114  case e_Probe:
115  m_Probe = 0;
116  break;
117  case e_Biosystem:
118  m_Biosystem = 0;
119  break;
120  case e_Geogse:
121  m_Geogse = 0;
122  break;
123  case e_Geogsm:
124  m_Geogsm = 0;
125  break;
126  case e_Regid:
127  case e_Rn:
128  case e_Mesh:
129  case e_Dburl:
130  case e_Sburl:
131  case e_Asurl:
132  case e_Patent:
133  case e_Protein_accession:
135  case e_Doi:
136  case e_Citation:
137  m_string.Construct();
138  break;
139  default:
140  break;
141  }
142  m_choice = index;
143 }
144 
145 const char* const CPC_XRefData_Base::sm_SelectionNames[] = {
146  "not set",
147  "regid",
148  "rn",
149  "mesh",
150  "pmid",
151  "gi",
152  "mmdb",
153  "sid",
154  "cid",
155  "dburl",
156  "sburl",
157  "asurl",
158  "protein-gi",
159  "nucleotide-gi",
160  "taxonomy",
161  "aid",
162  "mim",
163  "gene",
164  "probe",
165  "biosystem",
166  "geogse",
167  "geogsm",
168  "patent",
169  "protein-accession",
170  "nucleotide-accession",
171  "doi",
172  "citation"
173 };
174 
176 {
177  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
178 }
179 
181 {
182  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
183 }
184 
186 {
188  *m_string = value;
189 }
190 
192 {
194  *m_string = value;
195 }
196 
198 {
200  *m_string = value;
201 }
202 
204 {
206  *m_string = value;
207 }
208 
210 {
212  *m_string = value;
213 }
214 
216 {
218  *m_string = value;
219 }
220 
222 {
224  *m_string = value;
225 }
226 
228 {
230  *m_string = value;
231 }
232 
234 {
236  *m_string = value;
237 }
238 
240 {
242  *m_string = value;
243 }
244 
246 {
248  *m_string = value;
249 }
250 
251 // helper methods
252 
253 // type info
255 {
256  SET_CHOICE_MODULE("NCBI-PCSubstance");
257  ADD_NAMED_BUF_CHOICE_VARIANT("regid", m_string, STD, (string));
258  ADD_NAMED_BUF_CHOICE_VARIANT("rn", m_string, STD, (string));
259  ADD_NAMED_BUF_CHOICE_VARIANT("mesh", m_string, STD, (string));
260  ADD_NAMED_STD_CHOICE_VARIANT("pmid", m_Pmid);
261  ADD_NAMED_STD_CHOICE_VARIANT("gi", m_Gi);
262  ADD_NAMED_STD_CHOICE_VARIANT("mmdb", m_Mmdb);
263  ADD_NAMED_STD_CHOICE_VARIANT("sid", m_Sid);
264  ADD_NAMED_STD_CHOICE_VARIANT("cid", m_Cid);
265  ADD_NAMED_BUF_CHOICE_VARIANT("dburl", m_string, STD, (string));
266  ADD_NAMED_BUF_CHOICE_VARIANT("sburl", m_string, STD, (string));
267  ADD_NAMED_BUF_CHOICE_VARIANT("asurl", m_string, STD, (string));
268  ADD_NAMED_STD_CHOICE_VARIANT("protein-gi", m_Protein_gi);
269  ADD_NAMED_STD_CHOICE_VARIANT("nucleotide-gi", m_Nucleotide_gi);
270  ADD_NAMED_STD_CHOICE_VARIANT("taxonomy", m_Taxonomy);
271  ADD_NAMED_STD_CHOICE_VARIANT("aid", m_Aid);
272  ADD_NAMED_STD_CHOICE_VARIANT("mim", m_Mim);
273  ADD_NAMED_STD_CHOICE_VARIANT("gene", m_Gene);
274  ADD_NAMED_STD_CHOICE_VARIANT("probe", m_Probe);
275  ADD_NAMED_STD_CHOICE_VARIANT("biosystem", m_Biosystem);
276  ADD_NAMED_STD_CHOICE_VARIANT("geogse", m_Geogse);
277  ADD_NAMED_STD_CHOICE_VARIANT("geogsm", m_Geogsm);
278  ADD_NAMED_BUF_CHOICE_VARIANT("patent", m_string, STD, (string));
279  ADD_NAMED_BUF_CHOICE_VARIANT("protein-accession", m_string, STD, (string));
280  ADD_NAMED_BUF_CHOICE_VARIANT("nucleotide-accession", m_string, STD, (string));
281  ADD_NAMED_BUF_CHOICE_VARIANT("doi", m_string, STD, (string));
282  ADD_NAMED_BUF_CHOICE_VARIANT("citation", m_string, STD, (string));
283  info->CodeVersion(22301);
284  info->DataSpec(ncbi::EDataSpec::eASN);
285 }
287 
288 // constructor
290  : m_choice(e_not_set)
291 {
292 }
293 
294 // destructor
296 {
297  Reset();
298 }
299 
300 
301 
302 END_objects_SCOPE // namespace ncbi::objects::
303 
305 
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_CHOICE_INFO("PC-XRefData", CPC_XRefData)
CPC_XRefData –.
Definition: PC_XRefData.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 ADD_NAMED_STD_CHOICE_VARIANT(MemberAlias, MemberName)
Definition: serialimpl.hpp:388
#define END_CHOICE_INFO
Definition: serialimpl.hpp:506
#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
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
string TNucleotide_accession
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
TNucleotide_gi m_Nucleotide_gi
TRn & SetRn(void)
Select the variant.
TRegid & SetRegid(void)
Select the variant.
TMesh & SetMesh(void)
Select the variant.
TNucleotide_accession & SetNucleotide_accession(void)
Select the variant.
TPatent & SetPatent(void)
Select the variant.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
TDoi & SetDoi(void)
Select the variant.
virtual ~CPC_XRefData_Base(void)
TCitation & SetCitation(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TProtein_accession & SetProtein_accession(void)
Select the variant.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TSburl & SetSburl(void)
Select the variant.
TDburl & SetDburl(void)
Select the variant.
TAsurl & SetAsurl(void)
Select the variant.
TBiosystem m_Biosystem
virtual void Reset(void)
Reset the whole object.
TProtein_gi m_Protein_gi
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
E_Choice
Choice variants.
static const char *const sm_SelectionNames[]
@ e_Protein_gi
GenBank General ID for a Protein Note: Must be greater than "0" or, if invalid, "0".
@ e_Protein_accession
GenBank Accession for a Protein.
@ e_Nucleotide_accession
GenBank Accession for a Nucleotide.
@ e_Cid
PubChem Compound ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Citation
citation when PMID or DOI are not available
@ e_Rn
Registry Number (e.g., EC Number, CAS Number)
@ e_Dburl
Depositor Source Database Homepage.
@ e_Nucleotide_gi
GenBank General ID for a Nucleotide Note: Must be greater than "0" or, if invalid,...
@ e_Geogsm
Gene Expression Omnibus Sample Accession (GEO GSM) ID Note: Must be greater than "0" or,...
@ e_Aid
PubChem BioAssay ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Doi
digital object identifier (DOI)
@ e_Gene
Entrez Gene ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Gi
GenBank General ID Note: Please use protein-gi or nucleotide-gi, if possible Note: Must be greater th...
@ e_Probe
Probe ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Biosystem
BioSystem ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Pmid
PubMed ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Mmdb
MMDB ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Mesh
MESH Index Term.
@ e_Regid
External Database Registry ID.
@ e_Sid
PubChem Substance ID Note: Must be greater than "0" or, if invalid, "0".
@ e_Asurl
Depositor Homepage for an Assay.
@ e_Mim
MIM, Mendelian Inheritance in Man, Number Note: Must be greater than "0" or, if invalid,...
@ e_Geogse
Gene Expression Omnibus Series Accession (GEO GSE) ID Note: Must be greater than "0" or,...
@ e_Sburl
Depositor Homepage for a Substance.
@ e_Taxonomy
Taxonomy ID for an Organism Note: Must be greater than "0" or, if invalid, "0".
@ e_not_set
No variant selected.
@ e_Patent
Patent Identifier (e.g., USPTO, EPO, WPO, JPO, CPO)
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Mon Feb 26 04:01:08 2024 by modify_doxy.py rev. 669887