|
NCBI Home IEB Home C++ Toolkit docs C Toolkit source browser C Toolkit source browser (2) |
NCBI C++ Toolkit Cross ReferenceC++/src/objects/entrezgene/Maps_.cpp |
source navigation diff markup identifier search freetext search file search |
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 * 'entrezgene.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
42 #include <objects/entrezgene/Maps.hpp>
43 BEGIN_NCBI_SCOPE
44
45 BEGIN_objects_SCOPE // namespace ncbi::objects::
46
47
48 // generated classes
49
50 BEGIN_NAMED_ENUM_IN_INFO("", CMaps_Base::C_Method::, EMethod_map_type, false)
51 {
52 ADD_ENUM_VALUE("cyto", eMethod_map_type_cyto);
53 ADD_ENUM_VALUE("bp", eMethod_map_type_bp);
54 ADD_ENUM_VALUE("cM", eMethod_map_type_cM);
55 ADD_ENUM_VALUE("cR", eMethod_map_type_cR);
56 ADD_ENUM_VALUE("min", eMethod_map_type_min);
57 }
58 END_ENUM_INFO
59
60 void CMaps_Base::C_Method::Reset(void)
61 {
62 switch ( m_choice ) {
63 case e_Proxy:
64 m_string.Destruct();
65 break;
66 default:
67 break;
68 }
69 m_choice = e_not_set;
70 }
71
72 void CMaps_Base::C_Method::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
73 {
74 switch ( index ) {
75 case e_Map_type:
76 m_Map_type = (EMethod_map_type)(0);
77 break;
78 case e_Proxy:
79 m_string.Construct();
80 break;
81 default:
82 break;
83 }
84 m_choice = index;
85 }
86
87 const char* const CMaps_Base::C_Method::sm_SelectionNames[] = {
88 "not set",
89 "proxy",
90 "map-type"
91 };
92
93 NCBI_NS_STD::string CMaps_Base::C_Method::SelectionName(E_Choice index)
94 {
95 return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
96 }
97
98 void CMaps_Base::C_Method::ThrowInvalidSelection(E_Choice index) const
99 {
100 throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
101 }
102
103 void CMaps_Base::C_Method::SetProxy(const CMaps_Base::C_Method::TProxy& value)
104 {
105 Select(e_Proxy, NCBI_NS_NCBI::eDoNotResetVariant);
106 *m_string = value;
107 }
108
109 // helper methods
110
111 // type info
112 BEGIN_NAMED_CHOICE_INFO("", CMaps_Base::C_Method)
113 {
114 ADD_NAMED_BUF_CHOICE_VARIANT("proxy", m_string, STD, (string));
115 ADD_NAMED_ENUM_CHOICE_VARIANT("map-type", m_Map_type, EMethod_map_type);
116 }
117 END_CHOICE_INFO
118
119 // constructor
120 CMaps_Base::C_Method::C_Method(void)
121 : m_choice(e_not_set)
122 {
123 }
124
125 // destructor
126 CMaps_Base::C_Method::~C_Method(void)
127 {
128 if ( m_choice != e_not_set )
129 Reset();
130 }
131
132
133 void CMaps_Base::ResetDisplay_str(void)
134 {
135 m_Display_str.erase();
136 m_set_State[0] &= ~0x3;
137 }
138
139 void CMaps_Base::ResetMethod(void)
140 {
141 if ( !m_Method ) {
142 m_Method.Reset(new TMethod());
143 return;
144 }
145 (*m_Method).Reset();
146 }
147
148 void CMaps_Base::SetMethod(CMaps_Base::TMethod& value)
149 {
150 m_Method.Reset(&value);
151 }
152
153 void CMaps_Base::Reset(void)
154 {
155 ResetDisplay_str();
156 ResetMethod();
157 }
158
159 BEGIN_NAMED_BASE_CLASS_INFO("Maps", CMaps)
160 {
161 SET_CLASS_MODULE("NCBI-Entrezgene");
162 ADD_NAMED_STD_MEMBER("display-str", m_Display_str)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
163 ADD_NAMED_REF_MEMBER("method", m_Method, C_Method);
164 info->RandomOrder();
165 }
166 END_CLASS_INFO
167
168 // constructor
169 CMaps_Base::CMaps_Base(void)
170 {
171 memset(m_set_State,0,sizeof(m_set_State));
172 if ( !IsAllocatedInPool() ) {
173 ResetMethod();
174 }
175 }
176
177 // destructor
178 CMaps_Base::~CMaps_Base(void)
179 {
180 }
181
182
183
184 END_objects_SCOPE // namespace ncbi::objects::
185
186 END_NCBI_SCOPE
187
188 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |