NCBI C++ ToolKit
Url_.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 Url_.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/elink/elink.dtd">elink.dtd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/elink/elink.def">elink.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 elink__OBJTOOLS_EUTILS_ELINK_URL_BASE_HPP
42 #define elink__OBJTOOLS_EUTILS_ELINK_URL_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
50 #ifndef BEGIN_elink_SCOPE
51 # define BEGIN_elink_SCOPE BEGIN_SCOPE(elink)
52 # define END_elink_SCOPE END_SCOPE(elink)
53 #endif
54 BEGIN_elink_SCOPE // namespace elink::
55 
56 
57 // generated classes
58 
59 
60 /** @addtogroup dataspec_elink
61  *
62  * @{
63  */
64 
65 /////////////////////////////////////////////////////////////////////////////
66 /// cmd=llinks
67 /// \S+
68 ///
69 /// CUrl_Base --
70 ///
71 
72 class NCBI_EUTILS_EXPORT CUrl_Base : public NCBI_NS_NCBI::CSerialObject
73 {
74  typedef NCBI_NS_NCBI::CSerialObject Tparent;
75 public:
76  // constructor
77  CUrl_Base(void);
78  // destructor
79  virtual ~CUrl_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  ///
86  /// C_Attlist --
87  ///
88 
89  class NCBI_EUTILS_EXPORT C_Attlist : public NCBI_NS_NCBI::CSerialObject
90  {
91  typedef NCBI_NS_NCBI::CSerialObject Tparent;
92  public:
93  // constructor
94  C_Attlist(void);
95  // destructor
96  ~C_Attlist(void);
97 
98  // type info
100 
102  eAttlist_LNG_DA = 1,
103  eAttlist_LNG_DE = 2,
104  eAttlist_LNG_EN = 3,
105  eAttlist_LNG_EL = 4,
106  eAttlist_LNG_ES = 5,
107  eAttlist_LNG_FR = 6,
108  eAttlist_LNG_IT = 7,
109  eAttlist_LNG_IW = 8,
110  eAttlist_LNG_JA = 9,
111  eAttlist_LNG_NL = 10,
112  eAttlist_LNG_NO = 11,
113  eAttlist_LNG_RU = 12,
114  eAttlist_LNG_SV = 13,
115  eAttlist_LNG_ZH = 14
116  };
117 
118  /// Access to EAttlist_LNG's attributes (values, names) as defined in spec
119  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_LNG)(void);
120 
121  // types
123 
124  // member index
125  enum class E_memberIndex {
126  e__allMandatory = 0,
127  e_LNG
128  };
129  typedef Tparent::CMemberIndex<E_memberIndex, 2> TmemberIndex;
130 
131  // getters
132  // setters
133 
134  /// Check if a value has been assigned to LNG data member.
135  ///
136  /// Data member LNG is optional with default eAttlist_LNG_EN;
137  /// its type is defined as 'typedef EAttlist_LNG TLNG'
138  /// @return
139  /// - true, if a value has been assigned.
140  /// - false, otherwise.
141  bool IsSetLNG(void) const;
142 
143  /// Check if it is safe to call GetLNG method.
144  ///
145  /// @return
146  /// - true, if the data member is getatable.
147  /// - false, otherwise.
148  bool CanGetLNG(void) const;
149 
150  /// Reset LNG data member.
151  void ResetLNG(void);
152 
153  /// Assign default value to LNG data member.
154  void SetDefaultLNG(void);
155 
156  /// Get the LNG member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TLNG GetLNG(void) const;
161 
162  /// Assign a value to LNG data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetLNG(TLNG value);
167 
168  /// Assign a value to LNG data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TLNG& SetLNG(void);
173 
174  /// Reset the whole object
175  void Reset(void);
176 
177 
178  private:
179  // Prohibit copy constructor and assignment operator
182 
183  // data
184  Uint4 m_set_State[1];
186  };
187  // types
190 
191  // member index
192  enum class E_memberIndex {
193  e__allMandatory = 0,
194  e_Attlist,
195  e_Url
196  };
197  typedef Tparent::CMemberIndex<E_memberIndex, 3> TmemberIndex;
198 
199  // getters
200  // setters
201 
202  /// Check if a value has been assigned to Attlist data member.
203  ///
204  /// Data member Attlist is mandatory;
205  /// its type is defined as 'typedef C_Attlist TAttlist'
206  /// @return
207  /// - true, if a value has been assigned.
208  /// - false, otherwise.
209  bool IsSetAttlist(void) const;
210 
211  /// Check if it is safe to call GetAttlist method.
212  ///
213  /// @return
214  /// - true, if the data member is getatable.
215  /// - false, otherwise.
216  bool CanGetAttlist(void) const;
217 
218  /// Reset Attlist data member.
219  void ResetAttlist(void);
220 
221  /// Get the Attlist member data.
222  ///
223  /// @return
224  /// Reference to the member data.
225  const TAttlist& GetAttlist(void) const;
226 
227  /// Assign a value to Attlist data member.
228  ///
229  /// @param value
230  /// Reference to value.
231  void SetAttlist(TAttlist& value);
232 
233  /// Assign a value to Attlist data member.
234  ///
235  /// @return
236  /// Reference to the data value.
237  TAttlist& SetAttlist(void);
238 
239  /// Check if a value has been assigned to Url data member.
240  ///
241  /// Data member Url is mandatory;
242  /// its type is defined as 'typedef NCBI_NS_STD::string TUrl'
243  /// @return
244  /// - true, if a value has been assigned.
245  /// - false, otherwise.
246  bool IsSetUrl(void) const;
247 
248  /// Check if it is safe to call GetUrl method.
249  ///
250  /// @return
251  /// - true, if the data member is getatable.
252  /// - false, otherwise.
253  bool CanGetUrl(void) const;
254 
255  /// Reset Url data member.
256  void ResetUrl(void);
257 
258  /// Get the Url member data.
259  ///
260  /// @return
261  /// Reference to the member data.
262  const TUrl& GetUrl(void) const;
263 
264  /// Assign a value to Url data member.
265  ///
266  /// @param value
267  /// Value to assign
268  void SetUrl(const TUrl& value);
269  void SetUrl(TUrl&& value);
270 
271  /// Assign a value to Url data member.
272  ///
273  /// @return
274  /// Reference to the data value.
275  TUrl& SetUrl(void);
276 
277  /// Reset the whole object
278  virtual void Reset(void);
279 
280 
281 private:
282  // Prohibit copy constructor and assignment operator
285 
286  // data
287  Uint4 m_set_State[1];
288  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
290 };
291 
292 /* @} */
293 
294 
295 
296 
297 
298 ///////////////////////////////////////////////////////////
299 ///////////////////// inline methods //////////////////////
300 ///////////////////////////////////////////////////////////
301 inline
303 {
304  return ((m_set_State[0] & 0x3) != 0);
305 }
306 
307 inline
309 {
310  return true;
311 }
312 
313 inline
315 {
316  m_LNG = eAttlist_LNG_EN;
317  m_set_State[0] &= ~0x3;
318 }
319 
320 inline
322 {
323  ResetLNG();
324  m_set_State[0] |= 0x1;
325 }
326 
327 inline
329 {
330  return m_LNG;
331 }
332 
333 inline
335 {
336  m_LNG = value;
337  m_set_State[0] |= 0x3;
338 }
339 
340 inline
342 {
343 #ifdef _DEBUG
344  if (!IsSetLNG()) {
345  memset(&m_LNG,UnassignedByte(),sizeof(m_LNG));
346  }
347 #endif
348  m_set_State[0] |= 0x1;
349  return m_LNG;
350 }
351 
352 inline
353 bool CUrl_Base::IsSetAttlist(void) const
354 {
355  return m_Attlist.NotEmpty();
356 }
357 
358 inline
359 bool CUrl_Base::CanGetAttlist(void) const
360 {
361  return true;
362 }
363 
364 inline
366 {
367  if ( !m_Attlist ) {
368  const_cast<CUrl_Base*>(this)->ResetAttlist();
369  }
370  return (*m_Attlist);
371 }
372 
373 inline
375 {
376  if ( !m_Attlist ) {
377  ResetAttlist();
378  }
379  return (*m_Attlist);
380 }
381 
382 inline
383 bool CUrl_Base::IsSetUrl(void) const
384 {
385  return ((m_set_State[0] & 0xc) != 0);
386 }
387 
388 inline
389 bool CUrl_Base::CanGetUrl(void) const
390 {
391  return IsSetUrl();
392 }
393 
394 inline
396 {
397  if (!CanGetUrl()) {
398  ThrowUnassigned(1);
399  }
400  return m_Url;
401 }
402 
403 inline
405 {
406  m_Url = value;
407  m_set_State[0] |= 0xc;
408 }
409 
410 inline
412 {
413  m_Url = std::forward<CUrl_Base::TUrl>(value);
414  m_set_State[0] |= 0xc;
415 }
416 
417 inline
419 {
420 #ifdef _DEBUG
421  if (!IsSetUrl()) {
422  m_Url = UnassignedString();
423  }
424 #endif
425  m_set_State[0] |= 0x4;
426  return m_Url;
427 }
428 
429 ///////////////////////////////////////////////////////////
430 ////////////////// end of inline methods //////////////////
431 ///////////////////////////////////////////////////////////
432 
433 
434 
435 
436 
437 END_elink_SCOPE // namespace elink::
438 
439 
440 #endif // elink__OBJTOOLS_EUTILS_ELINK_URL_BASE_HPP
C_Attlist –.
Definition: Url_.hpp:90
cmd=llinks \S+
Definition: Url_.hpp:73
string
Definition: cgiapp.hpp:690
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define NCBI_EUTILS_EXPORT
Definition: ncbi_export.h:1460
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:35 2024 by modify_doxy.py rev. 669887