NCBI C++ ToolKit
Lib_.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  * 'msbuild_dataobj.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
43 BEGIN_msbuild_SCOPE // namespace msbuild::
44 
45 
46 // generated classes
47 
49 {
50  if ( m_choice != e_not_set )
52 }
53 
55 {
56  switch ( m_choice ) {
57  case e_AnyContent:
58  m_object->RemoveReference();
59  break;
60  default:
61  break;
62  }
63  m_choice = e_not_set;
64 }
65 
66 void CLib_Base::C_E::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
67 {
68  switch ( index ) {
69  case e_AnyContent:
70  (m_object = new(pool) ncbi::CAnyContentObject())->AddReference();
71  break;
72  default:
73  break;
74  }
75  m_choice = index;
76 }
77 
78 const char* const CLib_Base::C_E::sm_SelectionNames[] = {
79  "not set",
80  "AnyContent"
81 };
82 
84 {
85  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
86 }
87 
89 {
90  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
91 }
92 
94 {
95  CheckSelected(e_AnyContent);
96  return *static_cast<const TAnyContent*>(m_object);
97 }
98 
100 {
101  Select(e_AnyContent, NCBI_NS_NCBI::eDoNotResetVariant);
102  return *static_cast<TAnyContent*>(m_object);
103 }
104 
106 {
107  TAnyContent* ptr = &value;
108  if ( m_choice != e_AnyContent || m_object != ptr ) {
109  ResetSelection();
110  (m_object = ptr)->AddReference();
111  m_choice = e_AnyContent;
112  }
113 }
114 
115 // helper methods
116 
117 // type info
119 {
120  SET_INTERNAL_NAME("Lib", "E");
121  SET_CHOICE_MODULE("msbuild_dataobj");
122  SET_NAMESPACE("http://schemas.microsoft.com/developer/msbuild/2003")->SetNsQualified(true);
123  ADD_NAMED_REF_CHOICE_VARIANT("AnyContent", m_object, NCBI_NS_NCBI::CAnyContentObject)->SetNotag();
124  info->CodeVersion(22400);
125  info->DataSpec(ncbi::EDataSpec::eXSD);
126 }
128 
129 // constructor
131  : m_choice(e_not_set)
132 {
133 }
134 
135 // destructor
137 {
138  Reset();
139 }
140 
141 
143 {
144  m_data.clear();
145  m_set_State[0] &= ~0x3;
146 }
147 
149 {
150  SET_CLASS_MODULE("msbuild_dataobj");
151  SET_NAMESPACE("http://schemas.microsoft.com/developer/msbuild/2003")->SetNsQualified(true);
152  ADD_NAMED_MEMBER("", m_data, STL_list, (STL_CRef, (CLASS, (C_E))))->SetSetFlag(MEMBER_PTR(m_set_State[0]));
153  info->RandomOrder();
154  info->CodeVersion(22400);
155  info->DataSpec(ncbi::EDataSpec::eXSD);
156 }
158 
159 // constructor
161 {
162  memset(m_set_State,0,sizeof(m_set_State));
163 }
164 
165 // destructor
167 {
168 }
169 
170 
171 
172 END_msbuild_SCOPE // namespace msbuild::
173 
#define END_msbuild_SCOPE
#define BEGIN_msbuild_SCOPE
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO("Lib", CLib)
Definition: Lib_.cpp:148
BEGIN_NAMED_CHOICE_INFO("", CLib_Base::C_E)
Definition: Lib_.cpp:118
C_E –.
Definition: Lib_.hpp:88
CLib –.
Definition: Lib.hpp:64
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
@ eDoNotResetVariant
Definition: serialbase.hpp:78
const TAnyContent & GetAnyContent(void) const
Get the variant data.
Definition: Lib_.cpp:93
static const char *const sm_SelectionNames[]
Definition: Lib_.hpp:199
TAnyContent & SetAnyContent(void)
Select the variant.
Definition: Lib_.cpp:99
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_E > > m_data
Definition: Lib_.hpp:254
virtual ~CLib_Base(void)
Definition: Lib_.cpp:166
C_E(void)
Definition: Lib_.cpp:130
~C_E(void)
Definition: Lib_.cpp:136
void Reset(void)
Reset data member.
Definition: Lib_.cpp:142
E_Choice
Choice variants.
Definition: Lib_.hpp:101
void Reset(void)
Reset the whole object.
Definition: Lib_.cpp:48
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Lib_.cpp:88
Uint4 m_set_State[1]
Definition: Lib_.hpp:253
static NCBI_NS_STD::string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Lib_.cpp:83
NCBI_NS_NCBI::CAnyContentObject TAnyContent
Definition: Lib_.hpp:158
void DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool *pool=0)
Definition: Lib_.cpp:66
E_Choice m_choice
Definition: Lib_.hpp:195
CLib_Base(void)
Definition: Lib_.cpp:160
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Lib_.cpp:54
@ e_not_set
No variant selected.
Definition: Lib_.hpp:102
@ 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 Wed Sep 04 15:06:29 2024 by modify_doxy.py rev. 669887