NCBI C++ ToolKit
Mim_cit_.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 Mim_cit_.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/mim/mim.asn">mim.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/mim/mim.def">mim.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_MIM_MIM_CIT_BASE_HPP
42 #define OBJECTS_MIM_MIM_CIT_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_Mim
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CMim_cit_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CMim_cit_Base(void);
78  // destructor
79  virtual ~CMim_cit_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TNumber;
86  typedef string TAuthor;
87  typedef string TOthers;
88  typedef int TYear;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_number,
94  e_author,
95  e_others,
96  e_year
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to Number data member.
104  ///
105  /// Data member Number is mandatory;
106  /// its type is defined as 'typedef int TNumber'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetNumber(void) const;
111 
112  /// Check if it is safe to call GetNumber method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetNumber(void) const;
118 
119  /// Reset Number data member.
120  void ResetNumber(void);
121 
122  /// Get the Number member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TNumber GetNumber(void) const;
127 
128  /// Assign a value to Number data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetNumber(TNumber value);
133 
134  /// Assign a value to Number data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TNumber& SetNumber(void);
139 
140  /// Check if a value has been assigned to Author data member.
141  ///
142  /// Data member Author is mandatory;
143  /// its type is defined as 'typedef string TAuthor'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetAuthor(void) const;
148 
149  /// Check if it is safe to call GetAuthor method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetAuthor(void) const;
155 
156  /// Reset Author data member.
157  void ResetAuthor(void);
158 
159  /// Get the Author member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TAuthor& GetAuthor(void) const;
164 
165  /// Assign a value to Author data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetAuthor(const TAuthor& value);
170  void SetAuthor(TAuthor&& value);
171 
172  /// Assign a value to Author data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TAuthor& SetAuthor(void);
177 
178  /// Check if a value has been assigned to Others data member.
179  ///
180  /// Data member Others is mandatory;
181  /// its type is defined as 'typedef string TOthers'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetOthers(void) const;
186 
187  /// Check if it is safe to call GetOthers method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetOthers(void) const;
193 
194  /// Reset Others data member.
195  void ResetOthers(void);
196 
197  /// Get the Others member data.
198  ///
199  /// @return
200  /// Reference to the member data.
201  const TOthers& GetOthers(void) const;
202 
203  /// Assign a value to Others data member.
204  ///
205  /// @param value
206  /// Value to assign
207  void SetOthers(const TOthers& value);
208  void SetOthers(TOthers&& value);
209 
210  /// Assign a value to Others data member.
211  ///
212  /// @return
213  /// Reference to the data value.
214  TOthers& SetOthers(void);
215 
216  /// Check if a value has been assigned to Year data member.
217  ///
218  /// Data member Year is mandatory;
219  /// its type is defined as 'typedef int TYear'
220  /// @return
221  /// - true, if a value has been assigned.
222  /// - false, otherwise.
223  bool IsSetYear(void) const;
224 
225  /// Check if it is safe to call GetYear method.
226  ///
227  /// @return
228  /// - true, if the data member is getatable.
229  /// - false, otherwise.
230  bool CanGetYear(void) const;
231 
232  /// Reset Year data member.
233  void ResetYear(void);
234 
235  /// Get the Year member data.
236  ///
237  /// @return
238  /// Copy of the member data.
239  TYear GetYear(void) const;
240 
241  /// Assign a value to Year data member.
242  ///
243  /// @param value
244  /// Value to assign
245  void SetYear(TYear value);
246 
247  /// Assign a value to Year data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TYear& SetYear(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
263  Uint4 m_set_State[1];
264  int m_Number;
265  string m_Author;
266  string m_Others;
267  int m_Year;
268 };
269 
270 /* @} */
271 
272 
273 
274 
275 
276 ///////////////////////////////////////////////////////////
277 ///////////////////// inline methods //////////////////////
278 ///////////////////////////////////////////////////////////
279 inline
281 {
282  return ((m_set_State[0] & 0x3) != 0);
283 }
284 
285 inline
287 {
288  return IsSetNumber();
289 }
290 
291 inline
293 {
294  m_Number = 0;
295  m_set_State[0] &= ~0x3;
296 }
297 
298 inline
300 {
301  if (!CanGetNumber()) {
302  ThrowUnassigned(0);
303  }
304  return m_Number;
305 }
306 
307 inline
309 {
310  m_Number = value;
311  m_set_State[0] |= 0x3;
312 }
313 
314 inline
316 {
317 #ifdef _DEBUG
318  if (!IsSetNumber()) {
319  memset(&m_Number,UnassignedByte(),sizeof(m_Number));
320  }
321 #endif
322  m_set_State[0] |= 0x1;
323  return m_Number;
324 }
325 
326 inline
328 {
329  return ((m_set_State[0] & 0xc) != 0);
330 }
331 
332 inline
334 {
335  return IsSetAuthor();
336 }
337 
338 inline
340 {
341  if (!CanGetAuthor()) {
342  ThrowUnassigned(1);
343  }
344  return m_Author;
345 }
346 
347 inline
349 {
350  m_Author = value;
351  m_set_State[0] |= 0xc;
352 }
353 
354 inline
356 {
357  m_Author = std::forward<CMim_cit_Base::TAuthor>(value);
358  m_set_State[0] |= 0xc;
359 }
360 
361 inline
363 {
364 #ifdef _DEBUG
365  if (!IsSetAuthor()) {
367  }
368 #endif
369  m_set_State[0] |= 0x4;
370  return m_Author;
371 }
372 
373 inline
375 {
376  return ((m_set_State[0] & 0x30) != 0);
377 }
378 
379 inline
381 {
382  return IsSetOthers();
383 }
384 
385 inline
387 {
388  if (!CanGetOthers()) {
389  ThrowUnassigned(2);
390  }
391  return m_Others;
392 }
393 
394 inline
396 {
397  m_Others = value;
398  m_set_State[0] |= 0x30;
399 }
400 
401 inline
403 {
404  m_Others = std::forward<CMim_cit_Base::TOthers>(value);
405  m_set_State[0] |= 0x30;
406 }
407 
408 inline
410 {
411 #ifdef _DEBUG
412  if (!IsSetOthers()) {
414  }
415 #endif
416  m_set_State[0] |= 0x10;
417  return m_Others;
418 }
419 
420 inline
421 bool CMim_cit_Base::IsSetYear(void) const
422 {
423  return ((m_set_State[0] & 0xc0) != 0);
424 }
425 
426 inline
428 {
429  return IsSetYear();
430 }
431 
432 inline
434 {
435  m_Year = 0;
436  m_set_State[0] &= ~0xc0;
437 }
438 
439 inline
441 {
442  if (!CanGetYear()) {
443  ThrowUnassigned(3);
444  }
445  return m_Year;
446 }
447 
448 inline
450 {
451  m_Year = value;
452  m_set_State[0] |= 0xc0;
453 }
454 
455 inline
457 {
458 #ifdef _DEBUG
459  if (!IsSetYear()) {
460  memset(&m_Year,UnassignedByte(),sizeof(m_Year));
461  }
462 #endif
463  m_set_State[0] |= 0x40;
464  return m_Year;
465 }
466 
467 ///////////////////////////////////////////////////////////
468 ////////////////// end of inline methods //////////////////
469 ///////////////////////////////////////////////////////////
470 
471 
472 
473 
474 
475 END_objects_SCOPE // namespace ncbi::objects::
476 
478 
479 
480 #endif // OBJECTS_MIM_MIM_CIT_BASE_HPP
CMim_cit_Base –.
Definition: Mim_cit_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_MIM_EXPORT
Definition: ncbi_export.h:608
Uint4 m_set_State[1]
Definition: Mim_cit_.hpp:263
const TOthers & GetOthers(void) const
Get the Others member data.
Definition: Mim_cit_.hpp:386
TYear GetYear(void) const
Get the Year member data.
Definition: Mim_cit_.hpp:440
bool IsSetOthers(void) const
Check if a value has been assigned to Others data member.
Definition: Mim_cit_.hpp:374
bool IsSetNumber(void) const
Check if a value has been assigned to Number data member.
Definition: Mim_cit_.hpp:280
CMim_cit_Base & operator=(const CMim_cit_Base &)
string TOthers
Definition: Mim_cit_.hpp:87
TAuthor & SetAuthor(void)
Assign a value to Author data member.
Definition: Mim_cit_.hpp:362
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Mim_cit_.hpp:98
bool CanGetAuthor(void) const
Check if it is safe to call GetAuthor method.
Definition: Mim_cit_.hpp:333
bool IsSetYear(void) const
Check if a value has been assigned to Year data member.
Definition: Mim_cit_.hpp:421
string m_Others
Definition: Mim_cit_.hpp:266
TNumber GetNumber(void) const
Get the Number member data.
Definition: Mim_cit_.hpp:299
bool IsSetAuthor(void) const
Check if a value has been assigned to Author data member.
Definition: Mim_cit_.hpp:327
DECLARE_INTERNAL_TYPE_INFO()
bool CanGetYear(void) const
Check if it is safe to call GetYear method.
Definition: Mim_cit_.hpp:427
bool CanGetNumber(void) const
Check if it is safe to call GetNumber method.
Definition: Mim_cit_.hpp:286
string TAuthor
Definition: Mim_cit_.hpp:86
const TAuthor & GetAuthor(void) const
Get the Author member data.
Definition: Mim_cit_.hpp:339
bool CanGetOthers(void) const
Check if it is safe to call GetOthers method.
Definition: Mim_cit_.hpp:380
TOthers & SetOthers(void)
Assign a value to Others data member.
Definition: Mim_cit_.hpp:409
string m_Author
Definition: Mim_cit_.hpp:265
void ResetNumber(void)
Reset Number data member.
Definition: Mim_cit_.hpp:292
TYear & SetYear(void)
Assign a value to Year data member.
Definition: Mim_cit_.hpp:456
TNumber & SetNumber(void)
Assign a value to Number data member.
Definition: Mim_cit_.hpp:315
CSerialObject Tparent
Definition: Mim_cit_.hpp:74
void ResetYear(void)
Reset Year data member.
Definition: Mim_cit_.hpp:433
CMim_cit_Base(const CMim_cit_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:59 2024 by modify_doxy.py rev. 669887