NCBI C++ ToolKit
HG_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 HG_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/homologene/homologene.asn">homologene.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/homologene/homologene.def">homologene.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_HOMOLOGENE_HG_LINK_BASE_HPP
42 #define OBJECTS_HOMOLOGENE_HG_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_HomoloGene
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CHG_Link_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CHG_Link_Base(void);
78  // destructor
79  virtual ~CHG_Link_Base(void);
80 
81  // type info
83 
84  // types
85  typedef string THypertext;
86  typedef string TUrl;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
92  e_url
93  };
95 
96  // getters
97  // setters
98 
99  /// Check if a value has been assigned to Hypertext data member.
100  ///
101  /// Data member Hypertext is mandatory;
102  /// its type is defined as 'typedef string THypertext'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetHypertext(void) const;
107 
108  /// Check if it is safe to call GetHypertext method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetHypertext(void) const;
114 
115  /// Reset Hypertext data member.
116  void ResetHypertext(void);
117 
118  /// Get the Hypertext member data.
119  ///
120  /// @return
121  /// Reference to the member data.
122  const THypertext& GetHypertext(void) const;
123 
124  /// Assign a value to Hypertext data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetHypertext(const THypertext& value);
129  void SetHypertext(THypertext&& value);
130 
131  /// Assign a value to Hypertext data member.
132  ///
133  /// @return
134  /// Reference to the data value.
135  THypertext& SetHypertext(void);
136 
137  /// Check if a value has been assigned to Url data member.
138  ///
139  /// Data member Url is optional;
140  /// its type is defined as 'typedef string TUrl'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetUrl(void) const;
145 
146  /// Check if it is safe to call GetUrl method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetUrl(void) const;
152 
153  /// Reset Url data member.
154  void ResetUrl(void);
155 
156  /// Get the Url member data.
157  ///
158  /// @return
159  /// Reference to the member data.
160  const TUrl& GetUrl(void) const;
161 
162  /// Assign a value to Url data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetUrl(const TUrl& value);
167  void SetUrl(TUrl&& value);
168 
169  /// Assign a value to Url data member.
170  ///
171  /// @return
172  /// Reference to the data value.
173  TUrl& SetUrl(void);
174 
175  /// Reset the whole object
176  virtual void Reset(void);
177 
178 
179 private:
180  // Prohibit copy constructor and assignment operator
183 
184  // data
186  string m_Hypertext;
187  string m_Url;
188 };
189 
190 /* @} */
191 
192 
193 
194 
195 
196 ///////////////////////////////////////////////////////////
197 ///////////////////// inline methods //////////////////////
198 ///////////////////////////////////////////////////////////
199 inline
201 {
202  return ((m_set_State[0] & 0x3) != 0);
203 }
204 
205 inline
207 {
208  return IsSetHypertext();
209 }
210 
211 inline
213 {
214  if (!CanGetHypertext()) {
215  ThrowUnassigned(0);
216  }
217  return m_Hypertext;
218 }
219 
220 inline
222 {
223  m_Hypertext = value;
224  m_set_State[0] |= 0x3;
225 }
226 
227 inline
229 {
230  m_Hypertext = std::forward<CHG_Link_Base::THypertext>(value);
231  m_set_State[0] |= 0x3;
232 }
233 
234 inline
236 {
237 #ifdef _DEBUG
238  if (!IsSetHypertext()) {
240  }
241 #endif
242  m_set_State[0] |= 0x1;
243  return m_Hypertext;
244 }
245 
246 inline
247 bool CHG_Link_Base::IsSetUrl(void) const
248 {
249  return ((m_set_State[0] & 0xc) != 0);
250 }
251 
252 inline
253 bool CHG_Link_Base::CanGetUrl(void) const
254 {
255  return IsSetUrl();
256 }
257 
258 inline
260 {
261  if (!CanGetUrl()) {
262  ThrowUnassigned(1);
263  }
264  return m_Url;
265 }
266 
267 inline
269 {
270  m_Url = value;
271  m_set_State[0] |= 0xc;
272 }
273 
274 inline
276 {
277  m_Url = std::forward<CHG_Link_Base::TUrl>(value);
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetUrl()) {
287  }
288 #endif
289  m_set_State[0] |= 0x4;
290  return m_Url;
291 }
292 
293 ///////////////////////////////////////////////////////////
294 ////////////////// end of inline methods //////////////////
295 ///////////////////////////////////////////////////////////
296 
297 
298 
299 
300 
301 END_objects_SCOPE // namespace ncbi::objects::
302 
304 
305 
306 #endif // OBJECTS_HOMOLOGENE_HG_LINK_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
void ResetHypertext(void)
Reset Hypertext data member.
Definition: HG_Link_.cpp:50
CSerialObject Tparent
Definition: HG_Link_.hpp:74
Uint4 m_set_State[1]
Definition: HG_Link_.hpp:185
virtual ~CHG_Link_Base(void)
Definition: HG_Link_.cpp:86
string m_Url
Definition: HG_Link_.hpp:187
CHG_Link_Base & operator=(const CHG_Link_Base &)
void ResetUrl(void)
Reset Url data member.
Definition: HG_Link_.cpp:56
bool IsSetHypertext(void) const
Check if a value has been assigned to Hypertext data member.
Definition: HG_Link_.hpp:200
bool IsSetUrl(void) const
Check if a value has been assigned to Url data member.
Definition: HG_Link_.hpp:247
bool CanGetUrl(void) const
Check if it is safe to call GetUrl method.
Definition: HG_Link_.hpp:253
string TUrl
Definition: HG_Link_.hpp:86
CHG_Link_Base(void)
Definition: HG_Link_.cpp:80
string m_Hypertext
Definition: HG_Link_.hpp:186
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: HG_Link_.hpp:94
const THypertext & GetHypertext(void) const
Get the Hypertext member data.
Definition: HG_Link_.hpp:212
virtual void Reset(void)
Reset the whole object.
Definition: HG_Link_.cpp:62
THypertext & SetHypertext(void)
Assign a value to Hypertext data member.
Definition: HG_Link_.hpp:235
bool CanGetHypertext(void) const
Check if it is safe to call GetHypertext method.
Definition: HG_Link_.hpp:206
DECLARE_INTERNAL_TYPE_INFO()
CHG_Link_Base(const CHG_Link_Base &)
string THypertext
Definition: HG_Link_.hpp:85
const TUrl & GetUrl(void) const
Get the Url member data.
Definition: HG_Link_.hpp:259
TUrl & SetUrl(void)
Assign a value to Url data member.
Definition: HG_Link_.hpp:282
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:06 2024 by modify_doxy.py rev. 669887