NCBI C++ ToolKit
Medlars_record_.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 Medlars_record_.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/medlars/medlars.asn">medlars.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/medlars/medlars.def">medlars.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_MEDLARS_MEDLARS_RECORD_BASE_HPP
42 #define OBJECTS_MEDLARS_MEDLARS_RECORD_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_Medlars
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CMedlars_record_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CMedlars_record_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TCode;
86  typedef string TAbbr;
87  typedef string TData;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_code,
93  e_abbr,
94  e_data
95  };
97 
98  // getters
99  // setters
100 
101  /// Unit record field type integer form
102  /// Check if a value has been assigned to Code data member.
103  ///
104  /// Data member Code is mandatory;
105  /// its type is defined as 'typedef int TCode'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetCode(void) const;
110 
111  /// Check if it is safe to call GetCode method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetCode(void) const;
117 
118  /// Reset Code data member.
119  void ResetCode(void);
120 
121  /// Get the Code member data.
122  ///
123  /// @return
124  /// Copy of the member data.
125  TCode GetCode(void) const;
126 
127  /// Assign a value to Code data member.
128  ///
129  /// @param value
130  /// Value to assign
131  void SetCode(TCode value);
132 
133  /// Assign a value to Code data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TCode& SetCode(void);
138 
139  /// Unit record field type abbreviation form
140  /// Check if a value has been assigned to Abbr data member.
141  ///
142  /// Data member Abbr is optional;
143  /// its type is defined as 'typedef string TAbbr'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetAbbr(void) const;
148 
149  /// Check if it is safe to call GetAbbr method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetAbbr(void) const;
155 
156  /// Reset Abbr data member.
157  void ResetAbbr(void);
158 
159  /// Get the Abbr member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TAbbr& GetAbbr(void) const;
164 
165  /// Assign a value to Abbr data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetAbbr(const TAbbr& value);
170  void SetAbbr(TAbbr&& value);
171 
172  /// Assign a value to Abbr data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TAbbr& SetAbbr(void);
177 
178  /// Unit record data
179  /// Check if a value has been assigned to Data data member.
180  ///
181  /// Data member Data is mandatory;
182  /// its type is defined as 'typedef string TData'
183  /// @return
184  /// - true, if a value has been assigned.
185  /// - false, otherwise.
186  bool IsSetData(void) const;
187 
188  /// Check if it is safe to call GetData method.
189  ///
190  /// @return
191  /// - true, if the data member is getatable.
192  /// - false, otherwise.
193  bool CanGetData(void) const;
194 
195  /// Reset Data data member.
196  void ResetData(void);
197 
198  /// Get the Data member data.
199  ///
200  /// @return
201  /// Reference to the member data.
202  const TData& GetData(void) const;
203 
204  /// Assign a value to Data data member.
205  ///
206  /// @param value
207  /// Value to assign
208  void SetData(const TData& value);
209  void SetData(TData&& value);
210 
211  /// Assign a value to Data data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TData& SetData(void);
216 
217  /// Reset the whole object
218  virtual void Reset(void);
219 
220 
221 private:
222  // Prohibit copy constructor and assignment operator
225 
226  // data
227  Uint4 m_set_State[1];
228  int m_Code;
229  string m_Abbr;
230  string m_Data;
231 };
232 
233 /* @} */
234 
235 
236 
237 
238 
239 ///////////////////////////////////////////////////////////
240 ///////////////////// inline methods //////////////////////
241 ///////////////////////////////////////////////////////////
242 inline
244 {
245  return ((m_set_State[0] & 0x3) != 0);
246 }
247 
248 inline
250 {
251  return IsSetCode();
252 }
253 
254 inline
256 {
257  m_Code = 0;
258  m_set_State[0] &= ~0x3;
259 }
260 
261 inline
263 {
264  if (!CanGetCode()) {
265  ThrowUnassigned(0);
266  }
267  return m_Code;
268 }
269 
270 inline
272 {
273  m_Code = value;
274  m_set_State[0] |= 0x3;
275 }
276 
277 inline
279 {
280 #ifdef _DEBUG
281  if (!IsSetCode()) {
282  memset(&m_Code,UnassignedByte(),sizeof(m_Code));
283  }
284 #endif
285  m_set_State[0] |= 0x1;
286  return m_Code;
287 }
288 
289 inline
291 {
292  return ((m_set_State[0] & 0xc) != 0);
293 }
294 
295 inline
297 {
298  return IsSetAbbr();
299 }
300 
301 inline
303 {
304  if (!CanGetAbbr()) {
305  ThrowUnassigned(1);
306  }
307  return m_Abbr;
308 }
309 
310 inline
312 {
313  m_Abbr = value;
314  m_set_State[0] |= 0xc;
315 }
316 
317 inline
319 {
320  m_Abbr = std::forward<CMedlars_record_Base::TAbbr>(value);
321  m_set_State[0] |= 0xc;
322 }
323 
324 inline
326 {
327 #ifdef _DEBUG
328  if (!IsSetAbbr()) {
330  }
331 #endif
332  m_set_State[0] |= 0x4;
333  return m_Abbr;
334 }
335 
336 inline
338 {
339  return ((m_set_State[0] & 0x30) != 0);
340 }
341 
342 inline
344 {
345  return IsSetData();
346 }
347 
348 inline
350 {
351  if (!CanGetData()) {
352  ThrowUnassigned(2);
353  }
354  return m_Data;
355 }
356 
357 inline
359 {
360  m_Data = value;
361  m_set_State[0] |= 0x30;
362 }
363 
364 inline
366 {
367  m_Data = std::forward<CMedlars_record_Base::TData>(value);
368  m_set_State[0] |= 0x30;
369 }
370 
371 inline
373 {
374 #ifdef _DEBUG
375  if (!IsSetData()) {
377  }
378 #endif
379  m_set_State[0] |= 0x10;
380  return m_Data;
381 }
382 
383 ///////////////////////////////////////////////////////////
384 ////////////////// end of inline methods //////////////////
385 ///////////////////////////////////////////////////////////
386 
387 
388 
389 
390 
391 END_objects_SCOPE // namespace ncbi::objects::
392 
394 
395 
396 #endif // OBJECTS_MEDLARS_MEDLARS_RECORD_BASE_HPP
CMedlars_record_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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_MEDLARS_EXPORT
Definition: ncbi_export.h:592
bool CanGetData(void) const
Check if it is safe to call GetData method.
const TAbbr & GetAbbr(void) const
Get the Abbr member data.
bool CanGetAbbr(void) const
Check if it is safe to call GetAbbr method.
TCode & SetCode(void)
Assign a value to Code data member.
TAbbr & SetAbbr(void)
Assign a value to Abbr data member.
bool CanGetCode(void) const
Check if it is safe to call GetCode method.
void SetData(const TData &value)
Assign a value to Data data member.
TCode GetCode(void) const
Get the Code member data.
const TData & GetData(void) const
Get the Data member data.
TData & SetData(void)
Assign a value to Data data member.
bool IsSetAbbr(void) const
Unit record field type abbreviation form Check if a value has been assigned to Abbr data member.
bool IsSetData(void) const
Unit record data Check if a value has been assigned to Data data member.
void SetData(TData &&value)
CMedlars_record_Base(const CMedlars_record_Base &)
CMedlars_record_Base & operator=(const CMedlars_record_Base &)
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
void ResetCode(void)
Reset Code data member.
bool IsSetCode(void) const
Unit record field type integer form Check if a value has been assigned to Code data member.
Modified on Sat Dec 02 09:20:35 2023 by modify_doxy.py rev. 669887