NCBI C++ ToolKit
Entrez2_term_list_.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 Entrez2_term_list_.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/entrez2/entrez2.asn">entrez2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/entrez2/entrez2.def">entrez2.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_ENTREZ2_ENTREZ2_TERM_LIST_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_TERM_LIST_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 // forward declarations
60 class CEntrez2_term;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Entrez2
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CEntrez2_term_list_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CEntrez2_term_list_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TPos;
90  typedef int TNum;
91  typedef list< CRef< CEntrez2_term > > TList;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_pos,
97  e_num,
98  e_list
99  };
101 
102  // getters
103  // setters
104 
105  /// position of first term in list
106  /// Check if a value has been assigned to Pos data member.
107  ///
108  /// Data member Pos is mandatory;
109  /// its type is defined as 'typedef int TPos'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetPos(void) const;
114 
115  /// Check if it is safe to call GetPos method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetPos(void) const;
121 
122  /// Reset Pos data member.
123  void ResetPos(void);
124 
125  /// Get the Pos member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  TPos GetPos(void) const;
130 
131  /// Assign a value to Pos data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetPos(TPos value);
136 
137  /// Assign a value to Pos data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TPos& SetPos(void);
142 
143  /// number of terms in list
144  /// Check if a value has been assigned to Num data member.
145  ///
146  /// Data member Num is mandatory;
147  /// its type is defined as 'typedef int TNum'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetNum(void) const;
152 
153  /// Check if it is safe to call GetNum method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetNum(void) const;
159 
160  /// Reset Num data member.
161  void ResetNum(void);
162 
163  /// Get the Num member data.
164  ///
165  /// @return
166  /// Copy of the member data.
167  TNum GetNum(void) const;
168 
169  /// Assign a value to Num data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetNum(TNum value);
174 
175  /// Assign a value to Num data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TNum& SetNum(void);
180 
181  /// Check if a value has been assigned to List data member.
182  ///
183  /// Data member List is mandatory;
184  /// its type is defined as 'typedef list< CRef< CEntrez2_term > > TList'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetList(void) const;
189 
190  /// Check if it is safe to call GetList method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetList(void) const;
196 
197  /// Reset List data member.
198  void ResetList(void);
199 
200  /// Get the List member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TList& GetList(void) const;
205 
206  /// Assign a value to List data member.
207  ///
208  /// @return
209  /// Reference to the data value.
210  TList& SetList(void);
211 
212  /// Reset the whole object
213  virtual void Reset(void);
214 
215 
216 private:
217  // Prohibit copy constructor and assignment operator
220 
221  // data
222  Uint4 m_set_State[1];
223  int m_Pos;
224  int m_Num;
225  list< CRef< CEntrez2_term > > m_List;
226 };
227 
228 /* @} */
229 
230 
231 
232 
233 
234 ///////////////////////////////////////////////////////////
235 ///////////////////// inline methods //////////////////////
236 ///////////////////////////////////////////////////////////
237 inline
239 {
240  return ((m_set_State[0] & 0x3) != 0);
241 }
242 
243 inline
245 {
246  return IsSetPos();
247 }
248 
249 inline
251 {
252  m_Pos = 0;
253  m_set_State[0] &= ~0x3;
254 }
255 
256 inline
258 {
259  if (!CanGetPos()) {
260  ThrowUnassigned(0);
261  }
262  return m_Pos;
263 }
264 
265 inline
267 {
268  m_Pos = value;
269  m_set_State[0] |= 0x3;
270 }
271 
272 inline
274 {
275 #ifdef _DEBUG
276  if (!IsSetPos()) {
277  memset(&m_Pos,UnassignedByte(),sizeof(m_Pos));
278  }
279 #endif
280  m_set_State[0] |= 0x1;
281  return m_Pos;
282 }
283 
284 inline
286 {
287  return ((m_set_State[0] & 0xc) != 0);
288 }
289 
290 inline
292 {
293  return IsSetNum();
294 }
295 
296 inline
298 {
299  m_Num = 0;
300  m_set_State[0] &= ~0xc;
301 }
302 
303 inline
305 {
306  if (!CanGetNum()) {
307  ThrowUnassigned(1);
308  }
309  return m_Num;
310 }
311 
312 inline
314 {
315  m_Num = value;
316  m_set_State[0] |= 0xc;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetNum()) {
324  memset(&m_Num,UnassignedByte(),sizeof(m_Num));
325  }
326 #endif
327  m_set_State[0] |= 0x4;
328  return m_Num;
329 }
330 
331 inline
333 {
334  return ((m_set_State[0] & 0x30) != 0);
335 }
336 
337 inline
339 {
340  return true;
341 }
342 
343 inline
345 {
346  return m_List;
347 }
348 
349 inline
351 {
352  m_set_State[0] |= 0x10;
353  return m_List;
354 }
355 
356 ///////////////////////////////////////////////////////////
357 ////////////////// end of inline methods //////////////////
358 ///////////////////////////////////////////////////////////
359 
360 
361 
362 
363 
364 END_objects_SCOPE // namespace ncbi::objects::
365 
367 
368 
369 #endif // OBJECTS_ENTREZ2_ENTREZ2_TERM_LIST_BASE_HPP
CEntrez2_term_list_Base –.
CEntrez2_term –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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_ENTREZ2_EXPORT
Definition: ncbi_export.h:464
list< CRef< CEntrez2_term > > m_List
TList & SetList(void)
Assign a value to List data member.
bool IsSetNum(void) const
number of terms in list Check if a value has been assigned to Num data member.
TNum GetNum(void) const
Get the Num member data.
bool IsSetPos(void) const
position of first term in list Check if a value has been assigned to Pos data member.
CEntrez2_term_list_Base(const CEntrez2_term_list_Base &)
void ResetNum(void)
Reset Num data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
const TList & GetList(void) const
Get the List member data.
bool CanGetPos(void) const
Check if it is safe to call GetPos method.
TPos & SetPos(void)
Assign a value to Pos data member.
void ResetPos(void)
Reset Pos data member.
bool IsSetList(void) const
Check if a value has been assigned to List data member.
CEntrez2_term_list_Base & operator=(const CEntrez2_term_list_Base &)
bool CanGetList(void) const
Check if it is safe to call GetList method.
TPos GetPos(void) const
Get the Pos member data.
list< CRef< CEntrez2_term > > TList
TNum & SetNum(void)
Assign a value to Num data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu May 23 12:26:56 2024 by modify_doxy.py rev. 669887