NCBI C++ ToolKit
Identifier_.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 Identifier_.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/objtools/eutils/efetch/efetch.xsd">efetch.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/efetch/efetch.def">efetch.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 eutils__OBJTOOLS_EUTILS_EFETCH_IDENTIFIER_BASE_HPP
42 #define eutils__OBJTOOLS_EUTILS_EFETCH_IDENTIFIER_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
50 #ifndef BEGIN_eutils_SCOPE
51 # define BEGIN_eutils_SCOPE BEGIN_SCOPE(eutils)
52 # define END_eutils_SCOPE END_SCOPE(eutils)
53 #endif
54 BEGIN_eutils_SCOPE // namespace eutils::
55 
56 
57 // generated classes
58 
59 
60 /** @addtogroup dataspec_efetch
61  *
62  * @{
63  */
64 
65 /////////////////////////////////////////////////////////////////////////////
66 ///
67 /// CIdentifier_Base --
68 ///
69 
70 class CIdentifier_Base : public NCBI_NS_NCBI::CSerialObject
71 {
72  typedef NCBI_NS_NCBI::CSerialObject Tparent;
73 public:
74  // constructor
75  CIdentifier_Base(void);
76  // destructor
77  virtual ~CIdentifier_Base(void);
78 
79  // type info
81 
82  /////////////////////////////////////////////////////////////////////////////
83  ///
84  /// C_Attlist --
85  ///
86 
87  class C_Attlist : public NCBI_NS_NCBI::CSerialObject
88  {
89  typedef NCBI_NS_NCBI::CSerialObject Tparent;
90  public:
91  // constructor
92  C_Attlist(void);
93  // destructor
94  ~C_Attlist(void);
95 
96  // type info
98 
99  // types
101 
102  // member index
103  enum class E_memberIndex {
104  e__allMandatory = 0,
105  e_Source
106  };
107  typedef Tparent::CMemberIndex<E_memberIndex, 2> TmemberIndex;
108 
109  // getters
110  // setters
111 
112  /// Check if a value has been assigned to Source data member.
113  ///
114  /// Data member Source is mandatory;
115  /// its type is defined as 'typedef NCBI_NS_STD::string TSource'
116  /// @return
117  /// - true, if a value has been assigned.
118  /// - false, otherwise.
119  bool IsSetSource(void) const;
120 
121  /// Check if it is safe to call GetSource method.
122  ///
123  /// @return
124  /// - true, if the data member is getatable.
125  /// - false, otherwise.
126  bool CanGetSource(void) const;
127 
128  /// Reset Source data member.
129  void ResetSource(void);
130 
131  /// Get the Source member data.
132  ///
133  /// @return
134  /// Reference to the member data.
135  const TSource& GetSource(void) const;
136 
137  /// Assign a value to Source data member.
138  ///
139  /// @param value
140  /// Value to assign
141  void SetSource(const TSource& value);
142  void SetSource(TSource&& value);
143 
144  /// Assign a value to Source data member.
145  ///
146  /// @return
147  /// Reference to the data value.
148  TSource& SetSource(void);
149 
150  /// Reset the whole object
151  void Reset(void);
152 
153 
154  private:
155  // Prohibit copy constructor and assignment operator
158 
159  // data
162  };
163  // types
166 
167  // member index
168  enum class E_memberIndex {
169  e__allMandatory = 0,
170  e_Attlist,
172  };
173  typedef Tparent::CMemberIndex<E_memberIndex, 3> TmemberIndex;
174 
175  // getters
176  // setters
177 
178  /// Check if a value has been assigned to Attlist data member.
179  ///
180  /// Data member Attlist is mandatory;
181  /// its type is defined as 'typedef C_Attlist TAttlist'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetAttlist(void) const;
186 
187  /// Check if it is safe to call GetAttlist method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetAttlist(void) const;
193 
194  /// Reset Attlist data member.
195  void ResetAttlist(void);
196 
197  /// Get the Attlist member data.
198  ///
199  /// @return
200  /// Reference to the member data.
201  const TAttlist& GetAttlist(void) const;
202 
203  /// Assign a value to Attlist data member.
204  ///
205  /// @param value
206  /// Reference to value.
207  void SetAttlist(TAttlist& value);
208 
209  /// Assign a value to Attlist data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TAttlist& SetAttlist(void);
214 
215  /// Check if a value has been assigned to Identifier data member.
216  ///
217  /// Data member Identifier is mandatory;
218  /// its type is defined as 'typedef NCBI_NS_STD::string TIdentifier'
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetIdentifier(void) const;
223 
224  /// Check if it is safe to call GetIdentifier method.
225  ///
226  /// @return
227  /// - true, if the data member is getatable.
228  /// - false, otherwise.
229  bool CanGetIdentifier(void) const;
230 
231  /// Reset Identifier data member.
232  void ResetIdentifier(void);
233 
234  /// Get the Identifier member data.
235  ///
236  /// @return
237  /// Reference to the member data.
238  const TIdentifier& GetIdentifier(void) const;
239 
240  /// Assign a value to Identifier data member.
241  ///
242  /// @param value
243  /// Value to assign
244  void SetIdentifier(const TIdentifier& value);
246 
247  /// Assign a value to Identifier data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TIdentifier& SetIdentifier(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
264  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
266 };
267 
268 /* @} */
269 
270 
271 
272 
273 
274 ///////////////////////////////////////////////////////////
275 ///////////////////// inline methods //////////////////////
276 ///////////////////////////////////////////////////////////
277 inline
279 {
280  return ((m_set_State[0] & 0x3) != 0);
281 }
282 
283 inline
285 {
286  return IsSetSource();
287 }
288 
289 inline
291 {
292  if (!CanGetSource()) {
293  ThrowUnassigned(0);
294  }
295  return m_Source;
296 }
297 
298 inline
300 {
301  m_Source = value;
302  m_set_State[0] |= 0x3;
303 }
304 
305 inline
307 {
308  m_Source = std::forward<CIdentifier_Base::C_Attlist::TSource>(value);
309  m_set_State[0] |= 0x3;
310 }
311 
312 inline
314 {
315 #ifdef _DEBUG
316  if (!IsSetSource()) {
317  m_Source = UnassignedString();
318  }
319 #endif
320  m_set_State[0] |= 0x1;
321  return m_Source;
322 }
323 
324 inline
326 {
327  return m_Attlist.NotEmpty();
328 }
329 
330 inline
332 {
333  return true;
334 }
335 
336 inline
338 {
339  if ( !m_Attlist ) {
340  const_cast<CIdentifier_Base*>(this)->ResetAttlist();
341  }
342  return (*m_Attlist);
343 }
344 
345 inline
347 {
348  if ( !m_Attlist ) {
349  ResetAttlist();
350  }
351  return (*m_Attlist);
352 }
353 
354 inline
356 {
357  return ((m_set_State[0] & 0xc) != 0);
358 }
359 
360 inline
362 {
363  return IsSetIdentifier();
364 }
365 
366 inline
368 {
369  if (!CanGetIdentifier()) {
370  ThrowUnassigned(1);
371  }
372  return m_Identifier;
373 }
374 
375 inline
377 {
379  m_set_State[0] |= 0xc;
380 }
381 
382 inline
384 {
385  m_Identifier = std::forward<CIdentifier_Base::TIdentifier>(value);
386  m_set_State[0] |= 0xc;
387 }
388 
389 inline
391 {
392 #ifdef _DEBUG
393  if (!IsSetIdentifier()) {
394  m_Identifier = UnassignedString();
395  }
396 #endif
397  m_set_State[0] |= 0x4;
398  return m_Identifier;
399 }
400 
401 ///////////////////////////////////////////////////////////
402 ////////////////// end of inline methods //////////////////
403 ///////////////////////////////////////////////////////////
404 
405 
406 
407 
408 
409 END_eutils_SCOPE // namespace eutils::
410 
411 
412 #endif // eutils__OBJTOOLS_EUTILS_EFETCH_IDENTIFIER_BASE_HPP
#define BEGIN_eutils_SCOPE
Definition: Identifier_.hpp:51
#define END_eutils_SCOPE
Definition: Identifier_.hpp:52
CIdentifier_Base –.
Definition: Identifier_.hpp:71
string
Definition: cgiapp.hpp:687
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
C_Attlist & operator=(const C_Attlist &)
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
void ResetSource(void)
Reset Source data member.
Definition: Identifier_.cpp:48
CIdentifier_Base(const CIdentifier_Base &)
Uint4 m_set_State[1]
bool CanGetSource(void) const
Check if it is safe to call GetSource method.
void Reset(void)
Reset the whole object.
Definition: Identifier_.cpp:54
void ResetAttlist(void)
Reset Attlist data member.
Definition: Identifier_.cpp:82
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
NCBI_NS_STD::string TSource
bool IsSetSource(void) const
Check if a value has been assigned to Source data member.
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
TIdentifier & SetIdentifier(void)
Assign a value to Identifier data member.
NCBI_NS_STD::string TIdentifier
bool IsSetIdentifier(void) const
Check if a value has been assigned to Identifier data member.
const TSource & GetSource(void) const
Get the Source member data.
CIdentifier_Base & operator=(const CIdentifier_Base &)
NCBI_NS_STD::string m_Identifier
virtual ~CIdentifier_Base(void)
C_Attlist(const C_Attlist &)
bool CanGetIdentifier(void) const
Check if it is safe to call GetIdentifier method.
virtual void Reset(void)
Reset the whole object.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
NCBI_NS_STD::string m_Source
TSource & SetSource(void)
Assign a value to Source data member.
void ResetIdentifier(void)
Reset Identifier data member.
Definition: Identifier_.cpp:96
const TIdentifier & GetIdentifier(void) const
Get the Identifier member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
C_Attlist TAttlist
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Identifier_.hpp:89
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Identifier_.hpp:72
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Apr 17 13:10:26 2024 by modify_doxy.py rev. 669887