NCBI C++ ToolKit
Cdd_descr_.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  * 'cdd.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
46 #include <objects/general/Date.hpp>
47 #include <objects/pub/Pub.hpp>
50 
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52 
53 
54 // generated classes
55 
57 {
58  SET_ENUM_INTERNAL_NAME("Cdd-descr", "status");
59  SET_ENUM_MODULE("NCBI-Cdd");
60  ADD_ENUM_VALUE("unassigned", eStatus_unassigned);
61  ADD_ENUM_VALUE("finished-ok", eStatus_finished_ok);
62  ADD_ENUM_VALUE("pending-release", eStatus_pending_release);
63  ADD_ENUM_VALUE("other-asis", eStatus_other_asis);
64  ADD_ENUM_VALUE("matrix-only", eStatus_matrix_only);
65  ADD_ENUM_VALUE("update-running", eStatus_update_running);
66  ADD_ENUM_VALUE("auto-updated", eStatus_auto_updated);
67  ADD_ENUM_VALUE("claimed", eStatus_claimed);
68  ADD_ENUM_VALUE("curated-complete", eStatus_curated_complete);
69  ADD_ENUM_VALUE("other", eStatus_other);
70 }
72 
73 BEGIN_NAMED_ENUM_IN_INFO("", CCdd_descr_Base::, ECuration_status, true)
74 {
75  SET_ENUM_INTERNAL_NAME("Cdd-descr", "curation-status");
76  SET_ENUM_MODULE("NCBI-Cdd");
77  ADD_ENUM_VALUE("unassigned", eCuration_status_unassigned);
78  ADD_ENUM_VALUE("prein", eCuration_status_prein);
79  ADD_ENUM_VALUE("ofc", eCuration_status_ofc);
80  ADD_ENUM_VALUE("iac", eCuration_status_iac);
81  ADD_ENUM_VALUE("ofv1", eCuration_status_ofv1);
82  ADD_ENUM_VALUE("iav1", eCuration_status_iav1);
83  ADD_ENUM_VALUE("ofv2", eCuration_status_ofv2);
84  ADD_ENUM_VALUE("iav2", eCuration_status_iav2);
85  ADD_ENUM_VALUE("postin", eCuration_status_postin);
86  ADD_ENUM_VALUE("other", eCuration_status_other);
87 }
89 
90 BEGIN_NAMED_ENUM_IN_INFO("", CCdd_descr_Base::, EReadonly_status, true)
91 {
92  SET_ENUM_INTERNAL_NAME("Cdd-descr", "readonly-status");
93  SET_ENUM_MODULE("NCBI-Cdd");
94  ADD_ENUM_VALUE("unassigned", eReadonly_status_unassigned);
95  ADD_ENUM_VALUE("readonly", eReadonly_status_readonly);
96  ADD_ENUM_VALUE("readwrite", eReadonly_status_readwrite);
97  ADD_ENUM_VALUE("other", eReadonly_status_other);
98 }
100 
102 {
103  if ( m_choice != e_not_set )
104  ResetSelection();
105 }
106 
108 {
109  switch ( m_choice ) {
110  case e_Scrapbook:
111  m_Scrapbook.Destruct();
112  break;
113  case e_Othername:
114  case e_Category:
115  case e_Comment:
116  case e_Source:
117  case e_Title:
118  m_string.Destruct();
119  break;
120  case e_Reference:
121  case e_Create_date:
122  case e_Tax_source:
123  case e_Update_date:
124  case e_Source_id:
125  case e_Repeats:
126  case e_Old_root:
127  case e_Book_ref:
128  case e_Attribution:
129  m_object->RemoveReference();
130  break;
131  default:
132  break;
133  }
135 }
136 
137 void CCdd_descr_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
138 {
139  switch ( index ) {
140  case e_Reference:
141  (m_object = new(pool) ncbi::objects::CPub())->AddReference();
142  break;
143  case e_Create_date:
144  (m_object = new(pool) ncbi::objects::CDate())->AddReference();
145  break;
146  case e_Tax_source:
147  (m_object = new(pool) ncbi::objects::COrg_ref())->AddReference();
148  break;
149  case e_Status:
150  m_Status = (EStatus)(0);
151  break;
152  case e_Update_date:
153  (m_object = new(pool) ncbi::objects::CDate())->AddReference();
154  break;
155  case e_Scrapbook:
156  m_Scrapbook.Construct();
157  break;
158  case e_Source_id:
159  (m_object = new(pool) ncbi::objects::CCdd_id_set())->AddReference();
160  break;
161  case e_Repeats:
162  (m_object = new(pool) ncbi::objects::CCdd_repeat())->AddReference();
163  break;
164  case e_Old_root:
165  (m_object = new(pool) ncbi::objects::CCdd_id_set())->AddReference();
166  break;
167  case e_Curation_status:
169  break;
170  case e_Readonly_status:
172  break;
173  case e_Book_ref:
174  (m_object = new(pool) ncbi::objects::CCdd_book_ref())->AddReference();
175  break;
176  case e_Attribution:
177  (m_object = new(pool) ncbi::objects::CPub())->AddReference();
178  break;
179  case e_Othername:
180  case e_Category:
181  case e_Comment:
182  case e_Source:
183  case e_Title:
184  m_string.Construct();
185  break;
186  default:
187  break;
188  }
189  m_choice = index;
190 }
191 
192 const char* const CCdd_descr_Base::sm_SelectionNames[] = {
193  "not set",
194  "othername",
195  "category",
196  "comment",
197  "reference",
198  "create-date",
199  "tax-source",
200  "source",
201  "status",
202  "update-date",
203  "scrapbook",
204  "source-id",
205  "repeats",
206  "old-root",
207  "curation-status",
208  "readonly-status",
209  "book-ref",
210  "attribution",
211  "title"
212 };
213 
215 {
216  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
217 }
218 
220 {
221  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
222 }
223 
225 {
227  *m_string = value;
228 }
229 
231 {
233  *m_string = value;
234 }
235 
237 {
239  *m_string = value;
240 }
241 
243 {
245  return *static_cast<const TReference*>(m_object);
246 }
247 
249 {
251  return *static_cast<TReference*>(m_object);
252 }
253 
255 {
256  TReference* ptr = &value;
257  if ( m_choice != e_Reference || m_object != ptr ) {
258  ResetSelection();
259  (m_object = ptr)->AddReference();
261  }
262 }
263 
265 {
267  return *static_cast<const TCreate_date*>(m_object);
268 }
269 
271 {
273  return *static_cast<TCreate_date*>(m_object);
274 }
275 
277 {
278  TCreate_date* ptr = &value;
279  if ( m_choice != e_Create_date || m_object != ptr ) {
280  ResetSelection();
281  (m_object = ptr)->AddReference();
283  }
284 }
285 
287 {
289  return *static_cast<const TTax_source*>(m_object);
290 }
291 
293 {
295  return *static_cast<TTax_source*>(m_object);
296 }
297 
299 {
300  TTax_source* ptr = &value;
301  if ( m_choice != e_Tax_source || m_object != ptr ) {
302  ResetSelection();
303  (m_object = ptr)->AddReference();
305  }
306 }
307 
309 {
311  *m_string = value;
312 }
313 
315 {
317  return *static_cast<const TUpdate_date*>(m_object);
318 }
319 
321 {
323  return *static_cast<TUpdate_date*>(m_object);
324 }
325 
327 {
328  TUpdate_date* ptr = &value;
329  if ( m_choice != e_Update_date || m_object != ptr ) {
330  ResetSelection();
331  (m_object = ptr)->AddReference();
333  }
334 }
335 
337 {
339  return *static_cast<const TSource_id*>(m_object);
340 }
341 
343 {
345  return *static_cast<TSource_id*>(m_object);
346 }
347 
349 {
350  TSource_id* ptr = &value;
351  if ( m_choice != e_Source_id || m_object != ptr ) {
352  ResetSelection();
353  (m_object = ptr)->AddReference();
355  }
356 }
357 
359 {
361  return *static_cast<const TRepeats*>(m_object);
362 }
363 
365 {
367  return *static_cast<TRepeats*>(m_object);
368 }
369 
371 {
372  TRepeats* ptr = &value;
373  if ( m_choice != e_Repeats || m_object != ptr ) {
374  ResetSelection();
375  (m_object = ptr)->AddReference();
377  }
378 }
379 
381 {
383  return *static_cast<const TOld_root*>(m_object);
384 }
385 
387 {
389  return *static_cast<TOld_root*>(m_object);
390 }
391 
393 {
394  TOld_root* ptr = &value;
395  if ( m_choice != e_Old_root || m_object != ptr ) {
396  ResetSelection();
397  (m_object = ptr)->AddReference();
399  }
400 }
401 
403 {
405  return *static_cast<const TBook_ref*>(m_object);
406 }
407 
409 {
411  return *static_cast<TBook_ref*>(m_object);
412 }
413 
415 {
416  TBook_ref* ptr = &value;
417  if ( m_choice != e_Book_ref || m_object != ptr ) {
418  ResetSelection();
419  (m_object = ptr)->AddReference();
421  }
422 }
423 
425 {
427  return *static_cast<const TAttribution*>(m_object);
428 }
429 
431 {
433  return *static_cast<TAttribution*>(m_object);
434 }
435 
437 {
438  TAttribution* ptr = &value;
439  if ( m_choice != e_Attribution || m_object != ptr ) {
440  ResetSelection();
441  (m_object = ptr)->AddReference();
443  }
444 }
445 
447 {
449  *m_string = value;
450 }
451 
452 // helper methods
453 
454 // type info
456 {
457  SET_CHOICE_MODULE("NCBI-Cdd");
458  ADD_NAMED_BUF_CHOICE_VARIANT("othername", m_string, STD, (string));
459  ADD_NAMED_BUF_CHOICE_VARIANT("category", m_string, STD, (string));
460  ADD_NAMED_BUF_CHOICE_VARIANT("comment", m_string, STD, (string));
461  ADD_NAMED_REF_CHOICE_VARIANT("reference", m_object, CPub);
462  ADD_NAMED_REF_CHOICE_VARIANT("create-date", m_object, CDate);
463  ADD_NAMED_REF_CHOICE_VARIANT("tax-source", m_object, COrg_ref);
464  ADD_NAMED_BUF_CHOICE_VARIANT("source", m_string, STD, (string));
465  ADD_NAMED_ENUM_CHOICE_VARIANT("status", m_Status, EStatus);
466  ADD_NAMED_REF_CHOICE_VARIANT("update-date", m_object, CDate);
467  ADD_NAMED_BUF_CHOICE_VARIANT("scrapbook", m_Scrapbook, STL_list, (STD, (string)));
468  ADD_NAMED_REF_CHOICE_VARIANT("source-id", m_object, CCdd_id_set);
469  ADD_NAMED_REF_CHOICE_VARIANT("repeats", m_object, CCdd_repeat);
470  ADD_NAMED_REF_CHOICE_VARIANT("old-root", m_object, CCdd_id_set);
471  ADD_NAMED_ENUM_CHOICE_VARIANT("curation-status", m_Curation_status, ECuration_status);
472  ADD_NAMED_ENUM_CHOICE_VARIANT("readonly-status", m_Readonly_status, EReadonly_status);
473  ADD_NAMED_REF_CHOICE_VARIANT("book-ref", m_object, CCdd_book_ref);
474  ADD_NAMED_REF_CHOICE_VARIANT("attribution", m_object, CPub);
475  ADD_NAMED_BUF_CHOICE_VARIANT("title", m_string, STD, (string));
476  info->CodeVersion(22400);
477  info->DataSpec(ncbi::EDataSpec::eASN);
478 }
480 
481 // constructor
483  : m_choice(e_not_set)
484 {
485 }
486 
487 // destructor
489 {
490  Reset();
491 }
492 
493 
494 
495 END_objects_SCOPE // namespace ncbi::objects::
496 
498 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_CHOICE_INFO("Cdd-descr", CCdd_descr)
Definition: Cdd_descr_.cpp:455
BEGIN_NAMED_ENUM_IN_INFO("", CCdd_descr_Base::, EStatus, true)
Definition: Cdd_descr_.cpp:56
User-defined methods of the data storage class.
User-defined methods of the data storage class.
END_ENUM_INFO
Definition: aln_errors.cpp:58
EStatus
CCdd_book_ref –.
The description of CDD's refers to the specific set of aligned sequences, the region that is being al...
Definition: Cdd_descr_.hpp:90
CCdd_descr –.
Definition: Cdd_descr.hpp:66
CCdd_id_set –.
Definition: Cdd_id_set.hpp:66
CCdd_repeat –.
Definition: Cdd_repeat.hpp:66
Definition: Date.hpp:53
Definition: Pub.hpp:56
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 SET_ENUM_INTERNAL_NAME(OwnerName, MemberName)
Definition: serialimpl.hpp:559
#define SET_ENUM_MODULE(ModuleName)
Definition: serialimpl.hpp:553
#define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:400
#define ADD_ENUM_VALUE(EnumValueName, EnumValueValue)
Definition: serialimpl.hpp:562
#define ADD_NAMED_ENUM_CHOICE_VARIANT(MemberAlias, MemberName, EnumName)
Definition: serialimpl.hpp:391
#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
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 TTax_source & GetTax_source(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:286
E_Choice
Choice variants.
Definition: Cdd_descr_.hpp:145
TReadonly_status m_Readonly_status
Definition: Cdd_descr_.hpp:728
NCBI_NS_NCBI::CSerialObject * m_object
Definition: Cdd_descr_.hpp:730
const TRepeats & GetRepeats(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:358
static const char *const sm_SelectionNames[]
Definition: Cdd_descr_.hpp:722
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: Cdd_descr_.hpp:750
const TCreate_date & GetCreate_date(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:264
TCreate_date & SetCreate_date(void)
Select the variant.
Definition: Cdd_descr_.cpp:270
TTax_source & SetTax_source(void)
Select the variant.
Definition: Cdd_descr_.cpp:292
TTitle & SetTitle(void)
Select the variant.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Cdd_descr_.cpp:219
TOld_root & SetOld_root(void)
Select the variant.
Definition: Cdd_descr_.cpp:386
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Cdd_descr_.cpp:214
TUpdate_date & SetUpdate_date(void)
Select the variant.
Definition: Cdd_descr_.cpp:320
TCuration_status m_Curation_status
Definition: Cdd_descr_.hpp:727
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
E_Choice m_choice
Definition: Cdd_descr_.hpp:718
TRepeats & SetRepeats(void)
Select the variant.
Definition: Cdd_descr_.cpp:364
TAttribution & SetAttribution(void)
Select the variant.
Definition: Cdd_descr_.cpp:430
TReference & SetReference(void)
Select the variant.
Definition: Cdd_descr_.cpp:248
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Cdd_descr_.cpp:137
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Cdd_descr_.cpp:107
virtual ~CCdd_descr_Base(void)
Definition: Cdd_descr_.cpp:488
NCBI_NS_NCBI::CUnionBuffer< TScrapbook > m_Scrapbook
Definition: Cdd_descr_.hpp:726
const TSource_id & GetSource_id(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:336
TSource_id & SetSource_id(void)
Select the variant.
Definition: Cdd_descr_.cpp:342
TComment & SetComment(void)
Select the variant.
Definition: Cdd_descr_.hpp:826
const TBook_ref & GetBook_ref(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:402
TOthername & SetOthername(void)
Select the variant.
Definition: Cdd_descr_.hpp:786
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
Definition: Cdd_descr_.hpp:729
const TOld_root & GetOld_root(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:380
virtual void Reset(void)
Reset the whole object.
Definition: Cdd_descr_.cpp:101
TBook_ref & SetBook_ref(void)
Select the variant.
Definition: Cdd_descr_.cpp:408
const TAttribution & GetAttribution(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:424
const TUpdate_date & GetUpdate_date(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:314
const TReference & GetReference(void) const
Get the variant data.
Definition: Cdd_descr_.cpp:242
TCategory & SetCategory(void)
Select the variant.
Definition: Cdd_descr_.hpp:806
TSource & SetSource(void)
Select the variant.
Definition: Cdd_descr_.hpp:864
@ e_Repeats
to record repeat counts
Definition: Cdd_descr_.hpp:158
@ e_Title
hold short descriptive text
Definition: Cdd_descr_.hpp:164
@ e_Comment
this is where descriptions go
Definition: Cdd_descr_.hpp:149
@ e_Reference
a citation describing the domain
Definition: Cdd_descr_.hpp:150
@ e_Source_id
for linking back to source db
Definition: Cdd_descr_.hpp:157
@ e_Othername
alternative names for the CDD if domain has several common names
Definition: Cdd_descr_.hpp:147
@ e_not_set
No variant selected.
Definition: Cdd_descr_.hpp:146
@ e_Book_ref
links to Entrez/books
Definition: Cdd_descr_.hpp:162
@ e_Update_date
Date of last version change.
Definition: Cdd_descr_.hpp:155
@ e_Scrapbook
for storing curation notes those won't make it into public distributions
Definition: Cdd_descr_.hpp:156
@ e_Source
the database the seeds were created from, e.g. SMART, PFAM, etc..
Definition: Cdd_descr_.hpp:153
@ e_Category
intracellular, extracellular, etc. to record spatial and/or temporal expression in free-text format
Definition: Cdd_descr_.hpp:148
@ e_Attribution
add citations and/or author names
Definition: Cdd_descr_.hpp:163
@ e_Tax_source
holds the highest common tax node
Definition: Cdd_descr_.hpp:152
@ e_Old_root
to record short-term history
Definition: Cdd_descr_.hpp:159
@ e_Create_date
Date of first creation/dump.
Definition: Cdd_descr_.hpp:151
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 17 05:09:15 2024 by modify_doxy.py rev. 669887