NCBI C++ ToolKit
GBStrucCommentItem_.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 GBStrucCommentItem_.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/gbseq/gbseq.asn">gbseq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbseq/gbseq.def">gbseq.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_GBSEQ_GBSTRUCCOMMENTITEM_BASE_HPP
42 #define OBJECTS_GBSEQ_GBSTRUCCOMMENTITEM_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_NCBI_GBSeq
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CGBStrucCommentItem_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CGBStrucCommentItem_Base(void);
80 
81  // type info
83 
84  // types
85  typedef string TTag;
86  typedef string TValue;
87  typedef string TUrl;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_tag,
93  e_value,
94  e_url
95  };
97 
98  // getters
99  // setters
100 
101  /// Check if a value has been assigned to Tag data member.
102  ///
103  /// Data member Tag is optional;
104  /// its type is defined as 'typedef string TTag'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetTag(void) const;
109 
110  /// Check if it is safe to call GetTag method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetTag(void) const;
116 
117  /// Reset Tag data member.
118  void ResetTag(void);
119 
120  /// Get the Tag member data.
121  ///
122  /// @return
123  /// Reference to the member data.
124  const TTag& GetTag(void) const;
125 
126  /// Assign a value to Tag data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetTag(const TTag& value);
131  void SetTag(TTag&& value);
132 
133  /// Assign a value to Tag data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TTag& SetTag(void);
138 
139  /// Check if a value has been assigned to Value data member.
140  ///
141  /// Data member Value is optional;
142  /// its type is defined as 'typedef string TValue'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetValue(void) const;
147 
148  /// Check if it is safe to call GetValue method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetValue(void) const;
154 
155  /// Reset Value data member.
156  void ResetValue(void);
157 
158  /// Get the Value member data.
159  ///
160  /// @return
161  /// Reference to the member data.
162  const TValue& GetValue(void) const;
163 
164  /// Assign a value to Value data member.
165  ///
166  /// @param value
167  /// Value to assign
168  void SetValue(const TValue& value);
169  void SetValue(TValue&& value);
170 
171  /// Assign a value to Value data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TValue& SetValue(void);
176 
177  /// Check if a value has been assigned to Url data member.
178  ///
179  /// Data member Url is optional;
180  /// its type is defined as 'typedef string TUrl'
181  /// @return
182  /// - true, if a value has been assigned.
183  /// - false, otherwise.
184  bool IsSetUrl(void) const;
185 
186  /// Check if it is safe to call GetUrl method.
187  ///
188  /// @return
189  /// - true, if the data member is getatable.
190  /// - false, otherwise.
191  bool CanGetUrl(void) const;
192 
193  /// Reset Url data member.
194  void ResetUrl(void);
195 
196  /// Get the Url member data.
197  ///
198  /// @return
199  /// Reference to the member data.
200  const TUrl& GetUrl(void) const;
201 
202  /// Assign a value to Url data member.
203  ///
204  /// @param value
205  /// Value to assign
206  void SetUrl(const TUrl& value);
207  void SetUrl(TUrl&& value);
208 
209  /// Assign a value to Url data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TUrl& SetUrl(void);
214 
215  /// Reset the whole object
216  virtual void Reset(void);
217 
218 
219 private:
220  // Prohibit copy constructor and assignment operator
223 
224  // data
225  Uint4 m_set_State[1];
226  string m_Tag;
227  string m_Value;
228  string m_Url;
229 };
230 
231 /* @} */
232 
233 
234 
235 
236 
237 ///////////////////////////////////////////////////////////
238 ///////////////////// inline methods //////////////////////
239 ///////////////////////////////////////////////////////////
240 inline
242 {
243  return ((m_set_State[0] & 0x3) != 0);
244 }
245 
246 inline
248 {
249  return IsSetTag();
250 }
251 
252 inline
254 {
255  if (!CanGetTag()) {
256  ThrowUnassigned(0);
257  }
258  return m_Tag;
259 }
260 
261 inline
263 {
264  m_Tag = value;
265  m_set_State[0] |= 0x3;
266 }
267 
268 inline
270 {
271  m_Tag = std::forward<CGBStrucCommentItem_Base::TTag>(value);
272  m_set_State[0] |= 0x3;
273 }
274 
275 inline
277 {
278 #ifdef _DEBUG
279  if (!IsSetTag()) {
281  }
282 #endif
283  m_set_State[0] |= 0x1;
284  return m_Tag;
285 }
286 
287 inline
289 {
290  return ((m_set_State[0] & 0xc) != 0);
291 }
292 
293 inline
295 {
296  return IsSetValue();
297 }
298 
299 inline
301 {
302  if (!CanGetValue()) {
303  ThrowUnassigned(1);
304  }
305  return m_Value;
306 }
307 
308 inline
310 {
311  m_Value = value;
312  m_set_State[0] |= 0xc;
313 }
314 
315 inline
317 {
318  m_Value = std::forward<CGBStrucCommentItem_Base::TValue>(value);
319  m_set_State[0] |= 0xc;
320 }
321 
322 inline
324 {
325 #ifdef _DEBUG
326  if (!IsSetValue()) {
328  }
329 #endif
330  m_set_State[0] |= 0x4;
331  return m_Value;
332 }
333 
334 inline
336 {
337  return ((m_set_State[0] & 0x30) != 0);
338 }
339 
340 inline
342 {
343  return IsSetUrl();
344 }
345 
346 inline
348 {
349  if (!CanGetUrl()) {
350  ThrowUnassigned(2);
351  }
352  return m_Url;
353 }
354 
355 inline
357 {
358  m_Url = value;
359  m_set_State[0] |= 0x30;
360 }
361 
362 inline
364 {
365  m_Url = std::forward<CGBStrucCommentItem_Base::TUrl>(value);
366  m_set_State[0] |= 0x30;
367 }
368 
369 inline
371 {
372 #ifdef _DEBUG
373  if (!IsSetUrl()) {
375  }
376 #endif
377  m_set_State[0] |= 0x10;
378  return m_Url;
379 }
380 
381 ///////////////////////////////////////////////////////////
382 ////////////////// end of inline methods //////////////////
383 ///////////////////////////////////////////////////////////
384 
385 
386 
387 
388 
389 END_objects_SCOPE // namespace ncbi::objects::
390 
392 
393 
394 #endif // OBJECTS_GBSEQ_GBSTRUCCOMMENTITEM_BASE_HPP
CGBStrucCommentItem_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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_GBSEQ_EXPORT
Definition: ncbi_export.h:504
TValue & SetValue(void)
Assign a value to Value data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
CGBStrucCommentItem_Base & operator=(const CGBStrucCommentItem_Base &)
bool IsSetTag(void) const
Check if a value has been assigned to Tag data member.
TTag & SetTag(void)
Assign a value to Tag data member.
const TValue & GetValue(void) const
Get the Value member data.
bool CanGetValue(void) const
Check if it is safe to call GetValue method.
const TUrl & GetUrl(void) const
Get the Url member data.
bool IsSetUrl(void) const
Check if a value has been assigned to Url data member.
bool IsSetValue(void) const
Check if a value has been assigned to Value data member.
TUrl & SetUrl(void)
Assign a value to Url data member.
bool CanGetTag(void) const
Check if it is safe to call GetTag method.
CGBStrucCommentItem_Base(const CGBStrucCommentItem_Base &)
bool CanGetUrl(void) const
Check if it is safe to call GetUrl method.
const TTag & GetTag(void) const
Get the Tag member data.
Modified on Sun Mar 03 03:11:47 2024 by modify_doxy.py rev. 669887