NCBI C++ ToolKit
Mim_link_.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_link_.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_LINK_BASE_HPP
42 #define OBJECTS_MIM_MIM_LINK_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_link_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CMim_link_Base(void);
78  // destructor
79  virtual ~CMim_link_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TNum;
86  typedef string TUids;
87  typedef int TNumRelevant;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_num,
93  e_uids,
94  e_numRelevant
95  };
97 
98  // getters
99  // setters
100 
101  /// Check if a value has been assigned to Num data member.
102  ///
103  /// Data member Num is mandatory;
104  /// its type is defined as 'typedef int TNum'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetNum(void) const;
109 
110  /// Check if it is safe to call GetNum method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetNum(void) const;
116 
117  /// Reset Num data member.
118  void ResetNum(void);
119 
120  /// Get the Num member data.
121  ///
122  /// @return
123  /// Copy of the member data.
124  TNum GetNum(void) const;
125 
126  /// Assign a value to Num data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetNum(TNum value);
131 
132  /// Assign a value to Num data member.
133  ///
134  /// @return
135  /// Reference to the data value.
136  TNum& SetNum(void);
137 
138  /// Check if a value has been assigned to Uids data member.
139  ///
140  /// Data member Uids is mandatory;
141  /// its type is defined as 'typedef string TUids'
142  /// @return
143  /// - true, if a value has been assigned.
144  /// - false, otherwise.
145  bool IsSetUids(void) const;
146 
147  /// Check if it is safe to call GetUids method.
148  ///
149  /// @return
150  /// - true, if the data member is getatable.
151  /// - false, otherwise.
152  bool CanGetUids(void) const;
153 
154  /// Reset Uids data member.
155  void ResetUids(void);
156 
157  /// Get the Uids member data.
158  ///
159  /// @return
160  /// Reference to the member data.
161  const TUids& GetUids(void) const;
162 
163  /// Assign a value to Uids data member.
164  ///
165  /// @param value
166  /// Value to assign
167  void SetUids(const TUids& value);
168  void SetUids(TUids&& value);
169 
170  /// Assign a value to Uids data member.
171  ///
172  /// @return
173  /// Reference to the data value.
174  TUids& SetUids(void);
175 
176  /// Check if a value has been assigned to NumRelevant data member.
177  ///
178  /// Data member NumRelevant is optional;
179  /// its type is defined as 'typedef int TNumRelevant'
180  /// @return
181  /// - true, if a value has been assigned.
182  /// - false, otherwise.
183  bool IsSetNumRelevant(void) const;
184 
185  /// Check if it is safe to call GetNumRelevant method.
186  ///
187  /// @return
188  /// - true, if the data member is getatable.
189  /// - false, otherwise.
190  bool CanGetNumRelevant(void) const;
191 
192  /// Reset NumRelevant data member.
193  void ResetNumRelevant(void);
194 
195  /// Get the NumRelevant member data.
196  ///
197  /// @return
198  /// Copy of the member data.
199  TNumRelevant GetNumRelevant(void) const;
200 
201  /// Assign a value to NumRelevant data member.
202  ///
203  /// @param value
204  /// Value to assign
205  void SetNumRelevant(TNumRelevant value);
206 
207  /// Assign a value to NumRelevant data member.
208  ///
209  /// @return
210  /// Reference to the data value.
211  TNumRelevant& SetNumRelevant(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];
224  int m_Num;
225  string m_Uids;
227 };
228 
229 /* @} */
230 
231 
232 
233 
234 
235 ///////////////////////////////////////////////////////////
236 ///////////////////// inline methods //////////////////////
237 ///////////////////////////////////////////////////////////
238 inline
239 bool CMim_link_Base::IsSetNum(void) const
240 {
241  return ((m_set_State[0] & 0x3) != 0);
242 }
243 
244 inline
246 {
247  return IsSetNum();
248 }
249 
250 inline
252 {
253  m_Num = 0;
254  m_set_State[0] &= ~0x3;
255 }
256 
257 inline
259 {
260  if (!CanGetNum()) {
261  ThrowUnassigned(0);
262  }
263  return m_Num;
264 }
265 
266 inline
268 {
269  m_Num = value;
270  m_set_State[0] |= 0x3;
271 }
272 
273 inline
275 {
276 #ifdef _DEBUG
277  if (!IsSetNum()) {
278  memset(&m_Num,UnassignedByte(),sizeof(m_Num));
279  }
280 #endif
281  m_set_State[0] |= 0x1;
282  return m_Num;
283 }
284 
285 inline
287 {
288  return ((m_set_State[0] & 0xc) != 0);
289 }
290 
291 inline
293 {
294  return IsSetUids();
295 }
296 
297 inline
299 {
300  if (!CanGetUids()) {
301  ThrowUnassigned(1);
302  }
303  return m_Uids;
304 }
305 
306 inline
308 {
309  m_Uids = value;
310  m_set_State[0] |= 0xc;
311 }
312 
313 inline
315 {
316  m_Uids = std::forward<CMim_link_Base::TUids>(value);
317  m_set_State[0] |= 0xc;
318 }
319 
320 inline
322 {
323 #ifdef _DEBUG
324  if (!IsSetUids()) {
326  }
327 #endif
328  m_set_State[0] |= 0x4;
329  return m_Uids;
330 }
331 
332 inline
334 {
335  return ((m_set_State[0] & 0x30) != 0);
336 }
337 
338 inline
340 {
341  return IsSetNumRelevant();
342 }
343 
344 inline
346 {
347  m_NumRelevant = 0;
348  m_set_State[0] &= ~0x30;
349 }
350 
351 inline
353 {
354  if (!CanGetNumRelevant()) {
355  ThrowUnassigned(2);
356  }
357  return m_NumRelevant;
358 }
359 
360 inline
362 {
364  m_set_State[0] |= 0x30;
365 }
366 
367 inline
369 {
370 #ifdef _DEBUG
371  if (!IsSetNumRelevant()) {
372  memset(&m_NumRelevant,UnassignedByte(),sizeof(m_NumRelevant));
373  }
374 #endif
375  m_set_State[0] |= 0x10;
376  return m_NumRelevant;
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_MIM_MIM_LINK_BASE_HPP
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
TUids & SetUids(void)
Assign a value to Uids data member.
Definition: Mim_link_.hpp:321
DECLARE_INTERNAL_TYPE_INFO()
TNum GetNum(void) const
Get the Num member data.
Definition: Mim_link_.hpp:258
bool CanGetUids(void) const
Check if it is safe to call GetUids method.
Definition: Mim_link_.hpp:292
void ResetNum(void)
Reset Num data member.
Definition: Mim_link_.hpp:251
bool CanGetNumRelevant(void) const
Check if it is safe to call GetNumRelevant method.
Definition: Mim_link_.hpp:339
TNum & SetNum(void)
Assign a value to Num data member.
Definition: Mim_link_.hpp:274
CMim_link_Base(const CMim_link_Base &)
const TUids & GetUids(void) const
Get the Uids member data.
Definition: Mim_link_.hpp:298
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: Mim_link_.hpp:96
CSerialObject Tparent
Definition: Mim_link_.hpp:74
void ResetNumRelevant(void)
Reset NumRelevant data member.
Definition: Mim_link_.hpp:345
bool IsSetNum(void) const
Check if a value has been assigned to Num data member.
Definition: Mim_link_.hpp:239
TNumRelevant GetNumRelevant(void) const
Get the NumRelevant member data.
Definition: Mim_link_.hpp:352
bool IsSetNumRelevant(void) const
Check if a value has been assigned to NumRelevant data member.
Definition: Mim_link_.hpp:333
Uint4 m_set_State[1]
Definition: Mim_link_.hpp:223
bool IsSetUids(void) const
Check if a value has been assigned to Uids data member.
Definition: Mim_link_.hpp:286
CMim_link_Base & operator=(const CMim_link_Base &)
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
Definition: Mim_link_.hpp:245
TNumRelevant & SetNumRelevant(void)
Assign a value to NumRelevant data member.
Definition: Mim_link_.hpp:368
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 01 14:18:23 2024 by modify_doxy.py rev. 669887