NCBI C++ ToolKit
BaseURL_.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 BaseURL_.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/docsum/docsum.asn">docsum.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/docsum/docsum.def">docsum.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_DOCSUM_BASEURL_BASE_HPP
42 #define OBJECTS_DOCSUM_BASEURL_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_Docsum_3_4
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///URL value from dbSNP_main.BaseURL links table. attributes provide
69 /// context information and URL id that is referenced within individual refSNP
70 /// objects.
71 ///
72 /// CBaseURL_Base --
73 ///
74 
76 {
78 public:
79  // constructor
80  CBaseURL_Base(void);
81  // destructor
82  virtual ~CBaseURL_Base(void);
83 
84  // type info
86 
87  /////////////////////////////////////////////////////////////////////////////
88  ///
89  /// C_Attlist --
90  ///
91 
93  {
95  public:
96  // constructor
97  C_Attlist(void);
98  // destructor
99  ~C_Attlist(void);
100 
101  // type info
103 
104  // types
105  typedef int TUrlId;
106  typedef string TResourceName;
107  typedef string TResourceId;
108 
109  // member index
110  enum class E_memberIndex {
111  e__allMandatory = 0,
112  e_urlId,
113  e_resourceName,
114  e_resourceId
115  };
117 
118  // getters
119  // setters
120 
121  ///Resource identifier from
122  /// dbSNP_main.baseURL.
123  /// Check if a value has been assigned to UrlId data member.
124  ///
125  /// Data member UrlId is optional;
126  /// its type is defined as 'typedef int TUrlId'
127  /// @return
128  /// - true, if a value has been assigned.
129  /// - false, otherwise.
130  bool IsSetUrlId(void) const;
131 
132  /// Check if it is safe to call GetUrlId method.
133  ///
134  /// @return
135  /// - true, if the data member is getatable.
136  /// - false, otherwise.
137  bool CanGetUrlId(void) const;
138 
139  /// Reset UrlId data member.
140  void ResetUrlId(void);
141 
142  /// Get the UrlId member data.
143  ///
144  /// @return
145  /// Copy of the member data.
146  TUrlId GetUrlId(void) const;
147 
148  /// Assign a value to UrlId data member.
149  ///
150  /// @param value
151  /// Value to assign
152  void SetUrlId(TUrlId value);
153 
154  /// Assign a value to UrlId data member.
155  ///
156  /// @return
157  /// Reference to the data value.
158  TUrlId& SetUrlId(void);
159 
160  ///Name of linked resource
161  /// Check if a value has been assigned to ResourceName data member.
162  ///
163  /// Data member ResourceName is optional;
164  /// its type is defined as 'typedef string TResourceName'
165  /// @return
166  /// - true, if a value has been assigned.
167  /// - false, otherwise.
168  bool IsSetResourceName(void) const;
169 
170  /// Check if it is safe to call GetResourceName method.
171  ///
172  /// @return
173  /// - true, if the data member is getatable.
174  /// - false, otherwise.
175  bool CanGetResourceName(void) const;
176 
177  /// Reset ResourceName data member.
178  void ResetResourceName(void);
179 
180  /// Get the ResourceName member data.
181  ///
182  /// @return
183  /// Reference to the member data.
184  const TResourceName& GetResourceName(void) const;
185 
186  /// Assign a value to ResourceName data member.
187  ///
188  /// @param value
189  /// Value to assign
190  void SetResourceName(const TResourceName& value);
191  void SetResourceName(TResourceName&& value);
192 
193  /// Assign a value to ResourceName data member.
194  ///
195  /// @return
196  /// Reference to the data value.
197  TResourceName& SetResourceName(void);
198 
199  ///identifier expected by resource for
200  /// URL
201  /// Check if a value has been assigned to ResourceId data member.
202  ///
203  /// Data member ResourceId is optional;
204  /// its type is defined as 'typedef string TResourceId'
205  /// @return
206  /// - true, if a value has been assigned.
207  /// - false, otherwise.
208  bool IsSetResourceId(void) const;
209 
210  /// Check if it is safe to call GetResourceId method.
211  ///
212  /// @return
213  /// - true, if the data member is getatable.
214  /// - false, otherwise.
215  bool CanGetResourceId(void) const;
216 
217  /// Reset ResourceId data member.
218  void ResetResourceId(void);
219 
220  /// Get the ResourceId member data.
221  ///
222  /// @return
223  /// Reference to the member data.
224  const TResourceId& GetResourceId(void) const;
225 
226  /// Assign a value to ResourceId data member.
227  ///
228  /// @param value
229  /// Value to assign
230  void SetResourceId(const TResourceId& value);
231  void SetResourceId(TResourceId&& value);
232 
233  /// Assign a value to ResourceId data member.
234  ///
235  /// @return
236  /// Reference to the data value.
237  TResourceId& SetResourceId(void);
238 
239  /// Reset the whole object
240  void Reset(void);
241 
242 
243  private:
244  // Prohibit copy constructor and assignment operator
247 
248  // data
249  Uint4 m_set_State[1];
250  int m_UrlId;
252  string m_ResourceId;
253  };
254  // types
256  typedef string TBaseURL;
257 
258  // member index
259  enum class E_memberIndex {
260  e__allMandatory = 0,
261  e_attlist,
262  e_baseURL
263  };
265 
266  // getters
267  // setters
268 
269  /// Check if a value has been assigned to Attlist data member.
270  ///
271  /// Data member Attlist is mandatory;
272  /// its type is defined as 'typedef C_Attlist TAttlist'
273  /// @return
274  /// - true, if a value has been assigned.
275  /// - false, otherwise.
276  bool IsSetAttlist(void) const;
277 
278  /// Check if it is safe to call GetAttlist method.
279  ///
280  /// @return
281  /// - true, if the data member is getatable.
282  /// - false, otherwise.
283  bool CanGetAttlist(void) const;
284 
285  /// Reset Attlist data member.
286  void ResetAttlist(void);
287 
288  /// Get the Attlist member data.
289  ///
290  /// @return
291  /// Reference to the member data.
292  const TAttlist& GetAttlist(void) const;
293 
294  /// Assign a value to Attlist data member.
295  ///
296  /// @param value
297  /// Reference to value.
298  void SetAttlist(TAttlist& value);
299 
300  /// Assign a value to Attlist data member.
301  ///
302  /// @return
303  /// Reference to the data value.
304  TAttlist& SetAttlist(void);
305 
306  ///URL value from dbSNP_main.BaseURL links table. attributes provide
307  /// context information and URL id that is referenced within individual refSNP
308  /// objects.
309  /// Check if a value has been assigned to BaseURL data member.
310  ///
311  /// Data member BaseURL is mandatory;
312  /// its type is defined as 'typedef string TBaseURL'
313  /// @return
314  /// - true, if a value has been assigned.
315  /// - false, otherwise.
316  bool IsSetBaseURL(void) const;
317 
318  /// Check if it is safe to call GetBaseURL method.
319  ///
320  /// @return
321  /// - true, if the data member is getatable.
322  /// - false, otherwise.
323  bool CanGetBaseURL(void) const;
324 
325  /// Reset BaseURL data member.
326  void ResetBaseURL(void);
327 
328  /// Get the BaseURL member data.
329  ///
330  /// @return
331  /// Reference to the member data.
332  const TBaseURL& GetBaseURL(void) const;
333 
334  /// Assign a value to BaseURL data member.
335  ///
336  /// @param value
337  /// Value to assign
338  void SetBaseURL(const TBaseURL& value);
339  void SetBaseURL(TBaseURL&& value);
340 
341  /// Assign a value to BaseURL data member.
342  ///
343  /// @return
344  /// Reference to the data value.
345  TBaseURL& SetBaseURL(void);
346 
347  /// Reset the whole object
348  virtual void Reset(void);
349 
350 
351 private:
352  // Prohibit copy constructor and assignment operator
355 
356  // data
357  Uint4 m_set_State[1];
359  string m_BaseURL;
360 };
361 
362 /* @} */
363 
364 
365 
366 
367 
368 ///////////////////////////////////////////////////////////
369 ///////////////////// inline methods //////////////////////
370 ///////////////////////////////////////////////////////////
371 inline
373 {
374  return ((m_set_State[0] & 0x3) != 0);
375 }
376 
377 inline
379 {
380  return IsSetUrlId();
381 }
382 
383 inline
385 {
386  m_UrlId = 0;
387  m_set_State[0] &= ~0x3;
388 }
389 
390 inline
392 {
393  if (!CanGetUrlId()) {
394  ThrowUnassigned(0);
395  }
396  return m_UrlId;
397 }
398 
399 inline
401 {
402  m_UrlId = value;
403  m_set_State[0] |= 0x3;
404 }
405 
406 inline
408 {
409 #ifdef _DEBUG
410  if (!IsSetUrlId()) {
411  memset(&m_UrlId,UnassignedByte(),sizeof(m_UrlId));
412  }
413 #endif
414  m_set_State[0] |= 0x1;
415  return m_UrlId;
416 }
417 
418 inline
420 {
421  return ((m_set_State[0] & 0xc) != 0);
422 }
423 
424 inline
426 {
427  return IsSetResourceName();
428 }
429 
430 inline
432 {
433  if (!CanGetResourceName()) {
434  ThrowUnassigned(1);
435  }
436  return m_ResourceName;
437 }
438 
439 inline
441 {
442  m_ResourceName = value;
443  m_set_State[0] |= 0xc;
444 }
445 
446 inline
448 {
449  m_ResourceName = std::forward<CBaseURL_Base::C_Attlist::TResourceName>(value);
450  m_set_State[0] |= 0xc;
451 }
452 
453 inline
455 {
456 #ifdef _DEBUG
457  if (!IsSetResourceName()) {
458  m_ResourceName = UnassignedString();
459  }
460 #endif
461  m_set_State[0] |= 0x4;
462  return m_ResourceName;
463 }
464 
465 inline
467 {
468  return ((m_set_State[0] & 0x30) != 0);
469 }
470 
471 inline
473 {
474  return IsSetResourceId();
475 }
476 
477 inline
479 {
480  if (!CanGetResourceId()) {
481  ThrowUnassigned(2);
482  }
483  return m_ResourceId;
484 }
485 
486 inline
488 {
489  m_ResourceId = value;
490  m_set_State[0] |= 0x30;
491 }
492 
493 inline
495 {
496  m_ResourceId = std::forward<CBaseURL_Base::C_Attlist::TResourceId>(value);
497  m_set_State[0] |= 0x30;
498 }
499 
500 inline
502 {
503 #ifdef _DEBUG
504  if (!IsSetResourceId()) {
505  m_ResourceId = UnassignedString();
506  }
507 #endif
508  m_set_State[0] |= 0x10;
509  return m_ResourceId;
510 }
511 
512 inline
514 {
515  return m_Attlist.NotEmpty();
516 }
517 
518 inline
520 {
521  return true;
522 }
523 
524 inline
526 {
527  if ( !m_Attlist ) {
528  const_cast<CBaseURL_Base*>(this)->ResetAttlist();
529  }
530  return (*m_Attlist);
531 }
532 
533 inline
535 {
536  if ( !m_Attlist ) {
537  ResetAttlist();
538  }
539  return (*m_Attlist);
540 }
541 
542 inline
544 {
545  return ((m_set_State[0] & 0xc) != 0);
546 }
547 
548 inline
550 {
551  return IsSetBaseURL();
552 }
553 
554 inline
556 {
557  if (!CanGetBaseURL()) {
558  ThrowUnassigned(1);
559  }
560  return m_BaseURL;
561 }
562 
563 inline
565 {
566  m_BaseURL = value;
567  m_set_State[0] |= 0xc;
568 }
569 
570 inline
572 {
573  m_BaseURL = std::forward<CBaseURL_Base::TBaseURL>(value);
574  m_set_State[0] |= 0xc;
575 }
576 
577 inline
579 {
580 #ifdef _DEBUG
581  if (!IsSetBaseURL()) {
583  }
584 #endif
585  m_set_State[0] |= 0x4;
586  return m_BaseURL;
587 }
588 
589 ///////////////////////////////////////////////////////////
590 ////////////////// end of inline methods //////////////////
591 ///////////////////////////////////////////////////////////
592 
593 
594 
595 
596 
597 END_objects_SCOPE // namespace ncbi::objects::
598 
600 
601 
602 #endif // OBJECTS_DOCSUM_BASEURL_BASE_HPP
C_Attlist –.
Definition: BaseURL_.hpp:93
URL value from dbSNP_main.BaseURL links table.
Definition: BaseURL_.hpp:76
CRef –.
Definition: ncbiobj.hpp:618
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_DOCSUM_EXPORT
Definition: ncbi_export.h:456
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: BaseURL_.hpp:116
Uint4 m_set_State[1]
Definition: BaseURL_.hpp:357
bool CanGetResourceName(void) const
Check if it is safe to call GetResourceName method.
Definition: BaseURL_.hpp:425
string TBaseURL
Definition: BaseURL_.hpp:256
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Definition: BaseURL_.hpp:519
bool CanGetBaseURL(void) const
Check if it is safe to call GetBaseURL method.
Definition: BaseURL_.hpp:549
TResourceName & SetResourceName(void)
Assign a value to ResourceName data member.
Definition: BaseURL_.hpp:454
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
Definition: BaseURL_.hpp:525
CSerialObject Tparent
Definition: BaseURL_.hpp:77
bool CanGetResourceId(void) const
Check if it is safe to call GetResourceId method.
Definition: BaseURL_.hpp:472
bool IsSetResourceId(void) const
identifier expected by resource for URL Check if a value has been assigned to ResourceId data member.
Definition: BaseURL_.hpp:466
CBaseURL_Base & operator=(const CBaseURL_Base &)
C_Attlist TAttlist
Definition: BaseURL_.hpp:255
CBaseURL_Base(const CBaseURL_Base &)
bool CanGetUrlId(void) const
Check if it is safe to call GetUrlId method.
Definition: BaseURL_.hpp:378
CSerialObject Tparent
Definition: BaseURL_.hpp:94
TResourceId & SetResourceId(void)
Assign a value to ResourceId data member.
Definition: BaseURL_.hpp:501
bool IsSetBaseURL(void) const
URL value from dbSNP_main.BaseURL links table.
Definition: BaseURL_.hpp:543
const TResourceId & GetResourceId(void) const
Get the ResourceId member data.
Definition: BaseURL_.hpp:478
const TBaseURL & GetBaseURL(void) const
Get the BaseURL member data.
Definition: BaseURL_.hpp:555
C_Attlist & operator=(const C_Attlist &)
string m_BaseURL
Definition: BaseURL_.hpp:359
TUrlId & SetUrlId(void)
Assign a value to UrlId data member.
Definition: BaseURL_.hpp:407
bool IsSetUrlId(void) const
Resource identifier from dbSNP_main.baseURL.
Definition: BaseURL_.hpp:372
const TResourceName & GetResourceName(void) const
Get the ResourceName member data.
Definition: BaseURL_.hpp:431
void ResetUrlId(void)
Reset UrlId data member.
Definition: BaseURL_.hpp:384
TUrlId GetUrlId(void) const
Get the UrlId member data.
Definition: BaseURL_.hpp:391
DECLARE_INTERNAL_TYPE_INFO()
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
Definition: BaseURL_.hpp:534
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: BaseURL_.hpp:264
bool IsSetResourceName(void) const
Name of linked resource Check if a value has been assigned to ResourceName data member.
Definition: BaseURL_.hpp:419
C_Attlist(const C_Attlist &)
CRef< TAttlist > m_Attlist
Definition: BaseURL_.hpp:358
TBaseURL & SetBaseURL(void)
Assign a value to BaseURL data member.
Definition: BaseURL_.hpp:578
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Definition: BaseURL_.hpp:513
void ResetAttlist(void)
Reset Attlist data member.
Definition: BaseURL_.cpp:95
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:01:38 2024 by modify_doxy.py rev. 669887