NCBI C++ ToolKit
GCClient_Error_.hpp
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  */
27 
28 /// @file GCClient_Error_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genomecoll/gencoll_client.asn">gencoll_client.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genomecoll/gencoll_client.def">gencoll_client.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef OBJECTS_GENOMECOLL_GCCLIENT_ERROR_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GCCLIENT_ERROR_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_GencollClient
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CGCClient_Error_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CGCClient_Error_Base(void);
80 
81  // type info
83 
84  enum EError_id {
86  eError_id_other = 255
87  };
88 
89  /// Access to EError_id's attributes (values, names) as defined in spec
90  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EError_id)(void);
91 
92  // types
93  typedef int TError_id;
94  typedef string TDescription;
95 
96  // member index
97  enum class E_memberIndex {
98  e__allMandatory = 0,
99  e_error_id,
101  };
103 
104  // getters
105  // setters
106 
107  /// Check if a value has been assigned to Error_id data member.
108  ///
109  /// Data member Error_id is mandatory;
110  /// its type is defined as 'typedef int TError_id'
111  /// @return
112  /// - true, if a value has been assigned.
113  /// - false, otherwise.
114  bool IsSetError_id(void) const;
115 
116  /// Check if it is safe to call GetError_id method.
117  ///
118  /// @return
119  /// - true, if the data member is getatable.
120  /// - false, otherwise.
121  bool CanGetError_id(void) const;
122 
123  /// Reset Error_id data member.
124  void ResetError_id(void);
125 
126  /// Get the Error_id member data.
127  ///
128  /// @return
129  /// Copy of the member data.
130  TError_id GetError_id(void) const;
131 
132  /// Assign a value to Error_id data member.
133  ///
134  /// @param value
135  /// Value to assign
137 
138  /// Assign a value to Error_id data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TError_id& SetError_id(void);
143 
144  /// Check if a value has been assigned to Description data member.
145  ///
146  /// Data member Description is optional;
147  /// its type is defined as 'typedef string TDescription'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetDescription(void) const;
152 
153  /// Check if it is safe to call GetDescription method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetDescription(void) const;
159 
160  /// Reset Description data member.
161  void ResetDescription(void);
162 
163  /// Get the Description member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TDescription& GetDescription(void) const;
168 
169  /// Assign a value to Description data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetDescription(const TDescription& value);
175 
176  /// Assign a value to Description data member.
177  ///
178  /// @return
179  /// Reference to the data value.
181 
182  /// Reset the whole object
183  virtual void Reset(void);
184 
185 
186 private:
187  // Prohibit copy constructor and assignment operator
190 
191  // data
195 };
196 
197 /* @} */
198 
199 
200 
201 
202 
203 ///////////////////////////////////////////////////////////
204 ///////////////////// inline methods //////////////////////
205 ///////////////////////////////////////////////////////////
206 inline
208 {
209  return ((m_set_State[0] & 0x3) != 0);
210 }
211 
212 inline
214 {
215  return IsSetError_id();
216 }
217 
218 inline
220 {
221  m_Error_id = (EError_id)(0);
222  m_set_State[0] &= ~0x3;
223 }
224 
225 inline
227 {
228  if (!CanGetError_id()) {
229  ThrowUnassigned(0);
230  }
231  return m_Error_id;
232 }
233 
234 inline
236 {
237  m_Error_id = value;
238  m_set_State[0] |= 0x3;
239 }
240 
241 inline
243 {
244 #ifdef _DEBUG
245  if (!IsSetError_id()) {
246  memset(&m_Error_id,UnassignedByte(),sizeof(m_Error_id));
247  }
248 #endif
249  m_set_State[0] |= 0x1;
250  return m_Error_id;
251 }
252 
253 inline
255 {
256  return ((m_set_State[0] & 0xc) != 0);
257 }
258 
259 inline
261 {
262  return IsSetDescription();
263 }
264 
265 inline
267 {
268  if (!CanGetDescription()) {
269  ThrowUnassigned(1);
270  }
271  return m_Description;
272 }
273 
274 inline
276 {
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284  m_Description = std::forward<CGCClient_Error_Base::TDescription>(value);
285  m_set_State[0] |= 0xc;
286 }
287 
288 inline
290 {
291 #ifdef _DEBUG
292  if (!IsSetDescription()) {
294  }
295 #endif
296  m_set_State[0] |= 0x4;
297  return m_Description;
298 }
299 
300 ///////////////////////////////////////////////////////////
301 ////////////////// end of inline methods //////////////////
302 ///////////////////////////////////////////////////////////
303 
304 
305 
306 
307 
308 END_objects_SCOPE // namespace ncbi::objects::
309 
311 
312 
313 #endif // OBJECTS_GENOMECOLL_GCCLIENT_ERROR_BASE_HPP
CGCClient_Error_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
static string UnassignedString(void)
Definition: serialbase.hpp:175
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TDescription & SetDescription(void)
Assign a value to Description data member.
CGCClient_Error_Base & operator=(const CGCClient_Error_Base &)
bool CanGetError_id(void) const
Check if it is safe to call GetError_id method.
virtual void Reset(void)
Reset the whole object.
void ResetError_id(void)
Reset Error_id data member.
virtual ~CGCClient_Error_Base(void)
TError_id GetError_id(void) const
Get the Error_id member data.
bool IsSetError_id(void) const
Check if a value has been assigned to Error_id data member.
void ResetDescription(void)
Reset Description data member.
bool IsSetDescription(void) const
Check if a value has been assigned to Description data member.
const TDescription & GetDescription(void) const
Get the Description member data.
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TError_id & SetError_id(void)
Assign a value to Error_id data member.
CGCClient_Error_Base(const CGCClient_Error_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Jul 14 04:57:49 2024 by modify_doxy.py rev. 669887