NCBI C++ ToolKit
Taxon1_info_.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 Taxon1_info_.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/taxon1/taxon1.asn">taxon1.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/taxon1/taxon1.def">taxon1.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_TAXON1_TAXON1_INFO_BASE_HPP
42 #define OBJECTS_TAXON1_TAXON1_INFO_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_Taxon1
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CTaxon1_info_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CTaxon1_info_Base(void);
78  // destructor
79  virtual ~CTaxon1_info_Base(void);
80 
81  // type info
83 
84  // types
87  typedef string TSval;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_ival1,
93  e_ival2,
94  e_sval
95  };
97 
98  // getters
99  // setters
100 
101  /// Check if a value has been assigned to Ival1 data member.
102  ///
103  /// Data member Ival1 is mandatory;
104  /// its type is defined as 'typedef NCBI_NS_NCBI::TIntId TIval1'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetIval1(void) const;
109 
110  /// Check if it is safe to call GetIval1 method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetIval1(void) const;
116 
117  /// Reset Ival1 data member.
118  void ResetIval1(void);
119 
120  /// Get the Ival1 member data.
121  ///
122  /// @return
123  /// Copy of the member data.
124  TIval1 GetIval1(void) const;
125 
126  /// Assign a value to Ival1 data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetIval1(TIval1 value);
131 
132  /// Assign a value to Ival1 data member.
133  ///
134  /// @return
135  /// Reference to the data value.
136  TIval1& SetIval1(void);
137 
138  /// Check if a value has been assigned to Ival2 data member.
139  ///
140  /// Data member Ival2 is mandatory;
141  /// its type is defined as 'typedef NCBI_NS_NCBI::TIntId TIval2'
142  /// @return
143  /// - true, if a value has been assigned.
144  /// - false, otherwise.
145  bool IsSetIval2(void) const;
146 
147  /// Check if it is safe to call GetIval2 method.
148  ///
149  /// @return
150  /// - true, if the data member is getatable.
151  /// - false, otherwise.
152  bool CanGetIval2(void) const;
153 
154  /// Reset Ival2 data member.
155  void ResetIval2(void);
156 
157  /// Get the Ival2 member data.
158  ///
159  /// @return
160  /// Copy of the member data.
161  TIval2 GetIval2(void) const;
162 
163  /// Assign a value to Ival2 data member.
164  ///
165  /// @param value
166  /// Value to assign
167  void SetIval2(TIval2 value);
168 
169  /// Assign a value to Ival2 data member.
170  ///
171  /// @return
172  /// Reference to the data value.
173  TIval2& SetIval2(void);
174 
175  /// Check if a value has been assigned to Sval data member.
176  ///
177  /// Data member Sval is optional;
178  /// its type is defined as 'typedef string TSval'
179  /// @return
180  /// - true, if a value has been assigned.
181  /// - false, otherwise.
182  bool IsSetSval(void) const;
183 
184  /// Check if it is safe to call GetSval method.
185  ///
186  /// @return
187  /// - true, if the data member is getatable.
188  /// - false, otherwise.
189  bool CanGetSval(void) const;
190 
191  /// Reset Sval data member.
192  void ResetSval(void);
193 
194  /// Get the Sval member data.
195  ///
196  /// @return
197  /// Reference to the member data.
198  const TSval& GetSval(void) const;
199 
200  /// Assign a value to Sval data member.
201  ///
202  /// @param value
203  /// Value to assign
204  void SetSval(const TSval& value);
205  void SetSval(TSval&& value);
206 
207  /// Assign a value to Sval data member.
208  ///
209  /// @return
210  /// Reference to the data value.
211  TSval& SetSval(void);
212 
213  /// Reset the whole object
214  virtual void Reset(void);
215 
216 
217 private:
218  // Prohibit copy constructor and assignment operator
221 
222  // data
223  Uint4 m_set_State[1];
226  string m_Sval;
227 };
228 
229 /* @} */
230 
231 
232 
233 
234 
235 ///////////////////////////////////////////////////////////
236 ///////////////////// inline methods //////////////////////
237 ///////////////////////////////////////////////////////////
238 inline
240 {
241  return ((m_set_State[0] & 0x3) != 0);
242 }
243 
244 inline
246 {
247  return IsSetIval1();
248 }
249 
250 inline
252 {
253  m_Ival1 = 0;
254  m_set_State[0] &= ~0x3;
255 }
256 
257 inline
259 {
260  if (!CanGetIval1()) {
261  ThrowUnassigned(0);
262  }
263  return m_Ival1;
264 }
265 
266 inline
268 {
269  m_Ival1 = value;
270  m_set_State[0] |= 0x3;
271 }
272 
273 inline
275 {
276 #ifdef _DEBUG
277  if (!IsSetIval1()) {
278  memset(&m_Ival1,UnassignedByte(),sizeof(m_Ival1));
279  }
280 #endif
281  m_set_State[0] |= 0x1;
282  return m_Ival1;
283 }
284 
285 inline
287 {
288  return ((m_set_State[0] & 0xc) != 0);
289 }
290 
291 inline
293 {
294  return IsSetIval2();
295 }
296 
297 inline
299 {
300  m_Ival2 = 0;
301  m_set_State[0] &= ~0xc;
302 }
303 
304 inline
306 {
307  if (!CanGetIval2()) {
308  ThrowUnassigned(1);
309  }
310  return m_Ival2;
311 }
312 
313 inline
315 {
316  m_Ival2 = value;
317  m_set_State[0] |= 0xc;
318 }
319 
320 inline
322 {
323 #ifdef _DEBUG
324  if (!IsSetIval2()) {
325  memset(&m_Ival2,UnassignedByte(),sizeof(m_Ival2));
326  }
327 #endif
328  m_set_State[0] |= 0x4;
329  return m_Ival2;
330 }
331 
332 inline
334 {
335  return ((m_set_State[0] & 0x30) != 0);
336 }
337 
338 inline
340 {
341  return IsSetSval();
342 }
343 
344 inline
346 {
347  if (!CanGetSval()) {
348  ThrowUnassigned(2);
349  }
350  return m_Sval;
351 }
352 
353 inline
355 {
356  m_Sval = value;
357  m_set_State[0] |= 0x30;
358 }
359 
360 inline
362 {
363  m_Sval = std::forward<CTaxon1_info_Base::TSval>(value);
364  m_set_State[0] |= 0x30;
365 }
366 
367 inline
369 {
370 #ifdef _DEBUG
371  if (!IsSetSval()) {
373  }
374 #endif
375  m_set_State[0] |= 0x10;
376  return m_Sval;
377 }
378 
379 ///////////////////////////////////////////////////////////
380 ////////////////// end of inline methods //////////////////
381 ///////////////////////////////////////////////////////////
382 
383 
384 
385 
386 
387 END_objects_SCOPE // namespace ncbi::objects::
388 
390 
391 
392 #endif // OBJECTS_TAXON1_TAXON1_INFO_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTaxon1_info_Base –.
Int8 TIntId
Definition: ncbimisc.hpp:999
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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
#define NCBI_TAXON1_EXPORT
Definition: ncbi_export.h:857
TSval & SetSval(void)
Assign a value to Sval data member.
bool IsSetIval1(void) const
Check if a value has been assigned to Ival1 data member.
NCBI_NS_NCBI::TIntId m_Ival1
bool CanGetSval(void) const
Check if it is safe to call GetSval method.
TIval1 GetIval1(void) const
Get the Ival1 member data.
NCBI_NS_NCBI::TIntId TIval2
CTaxon1_info_Base & operator=(const CTaxon1_info_Base &)
void ResetIval2(void)
Reset Ival2 data member.
bool CanGetIval2(void) const
Check if it is safe to call GetIval2 method.
CTaxon1_info_Base(const CTaxon1_info_Base &)
TIval2 & SetIval2(void)
Assign a value to Ival2 data member.
TIval2 GetIval2(void) const
Get the Ival2 member data.
void ResetIval1(void)
Reset Ival1 data member.
bool IsSetIval2(void) const
Check if a value has been assigned to Ival2 data member.
NCBI_NS_NCBI::TIntId TIval1
NCBI_NS_NCBI::TIntId m_Ival2
TIval1 & SetIval1(void)
Assign a value to Ival1 data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool CanGetIval1(void) const
Check if it is safe to call GetIval1 method.
CSerialObject Tparent
bool IsSetSval(void) const
Check if a value has been assigned to Sval data member.
const TSval & GetSval(void) const
Get the Sval member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:54 2024 by modify_doxy.py rev. 669887