NCBI C++ ToolKit
PC_CompoundType_.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  SET_ENUM_INTERNAL_NAME("PC-CompoundType", "type");
53  SET_ENUM_MODULE("NCBI-PCSubstance");
54  ADD_ENUM_VALUE("deposited", eType_deposited);
55  ADD_ENUM_VALUE("standardized", eType_standardized);
56  ADD_ENUM_VALUE("component", eType_component);
57  ADD_ENUM_VALUE("neutralized", eType_neutralized);
58  ADD_ENUM_VALUE("mixture", eType_mixture);
59  ADD_ENUM_VALUE("tautomer", eType_tautomer);
60  ADD_ENUM_VALUE("pka-state", eType_pka_state);
61  ADD_ENUM_VALUE("unknown", eType_unknown);
62 }
64 
66 {
67  if ( m_choice != e_not_set )
69 }
70 
72 {
73  m_choice = e_not_set;
74 }
75 
76 void CPC_CompoundType_Base::C_Id::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
77 {
78  switch ( index ) {
79  case e_Cid:
80  m_Cid = 0;
81  break;
82  case e_Sid:
83  m_Sid = 0;
84  break;
85  case e_Xid:
86  m_Xid = 0;
87  break;
88  default:
89  break;
90  }
91  m_choice = index;
92 }
93 
95  "not set",
96  "cid",
97  "sid",
98  "xid"
99 };
100 
102 {
103  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
104 }
105 
107 {
108  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
109 }
110 
111 // helper methods
112 
113 // type info
115 {
116  SET_INTERNAL_NAME("PC-CompoundType", "id");
117  SET_CHOICE_MODULE("NCBI-PCSubstance");
118  ADD_NAMED_STD_CHOICE_VARIANT("cid", m_Cid);
119  ADD_NAMED_STD_CHOICE_VARIANT("sid", m_Sid);
120  ADD_NAMED_STD_CHOICE_VARIANT("xid", m_Xid);
121  info->CodeVersion(22400);
122  info->DataSpec(ncbi::EDataSpec::eASN);
123 }
125 
126 // constructor
128  : m_choice(e_not_set)
129 {
130 }
131 
132 // destructor
134 {
135  Reset();
136 }
137 
138 
140 {
141  m_Id.Reset();
142 }
143 
145 {
146  m_Id.Reset(&value);
147 }
148 
150 {
151  if ( !m_Id )
152  m_Id.Reset(new TId());
153  return (*m_Id);
154 }
155 
157 {
158  ResetType();
159  ResetId();
160 }
161 
163 {
164  SET_CLASS_MODULE("NCBI-PCSubstance");
165  ADD_NAMED_ENUM_MEMBER("type", m_Type, EType)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
166  ADD_NAMED_REF_MEMBER("id", m_Id, C_Id)->SetOptional();
167  info->RandomOrder();
168  info->CodeVersion(22400);
169  info->DataSpec(ncbi::EDataSpec::eASN);
170 }
172 
173 // constructor
175  : m_Type((EType)(0))
176 {
177  memset(m_set_State,0,sizeof(m_set_State));
178 }
179 
180 // destructor
182 {
183 }
184 
185 
186 
187 END_objects_SCOPE // namespace ncbi::objects::
188 
190 
User-defined methods of the data storage class.
BEGIN_NAMED_ENUM_IN_INFO("", CPC_CompoundType_Base::, EType, true)
BEGIN_NAMED_BASE_CLASS_INFO("PC-CompoundType", CPC_CompoundType)
BEGIN_NAMED_CHOICE_INFO("", CPC_CompoundType_Base::C_Id)
END_ENUM_INFO
Definition: aln_errors.cpp:58
Compound Namespace and ID (absent for "deposited" type compounds)
Qualification used to describe the type of Compound deposited, standardized, or derived.
CPC_CompoundType –.
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 SET_ENUM_INTERNAL_NAME(OwnerName, MemberName)
Definition: serialimpl.hpp:559
#define ADD_NAMED_REF_MEMBER(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:357
#define SET_ENUM_MODULE(ModuleName)
Definition: serialimpl.hpp:553
#define END_CLASS_INFO
Definition: serialimpl.hpp:456
#define SET_CLASS_MODULE(ModuleName)
Definition: serialimpl.hpp:444
#define ADD_NAMED_ENUM_MEMBER(MemberAlias, MemberName, EnumName)
Definition: serialimpl.hpp:351
#define ADD_ENUM_VALUE(EnumValueName, EnumValueValue)
Definition: serialimpl.hpp:562
#define ADD_NAMED_STD_CHOICE_VARIANT(MemberAlias, MemberName)
Definition: serialimpl.hpp:388
#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 END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
virtual void Reset(void)
Reset the whole object.
void Reset(void)
Reset the whole object.
void ResetId(void)
Reset Id data member.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void ResetType(void)
Reset Type data member.
EType
Compound Qualifier or Type For Compound Depositions.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
virtual ~CPC_CompoundType_Base(void)
static const char *const sm_SelectionNames[]
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TId & SetId(void)
Assign a value to Id data member.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
@ e_not_set
No variant selected.
@ 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 Tue Jun 18 13:38:09 2024 by modify_doxy.py rev. 669887