NCBI C++ ToolKit
HG_CommentarySet_.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_CommentarySet_.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_COMMENTARYSET_BASE_HPP
42 #define OBJECTS_HOMOLOGENE_HG_COMMENTARYSET_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CHG_Commentary;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_HomoloGene
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CHG_CommentarySet_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CHG_CommentarySet_Base(void);
85 
86  // type info
88 
89  // types
90  typedef int THg_id;
91  typedef string TTitle;
92  typedef list< CRef< CHG_Commentary > > TCommentaries;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_hg_id,
98  e_title,
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Hg_id data member.
107  ///
108  /// Data member Hg_id is optional;
109  /// its type is defined as 'typedef int THg_id'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetHg_id(void) const;
114 
115  /// Check if it is safe to call GetHg_id method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetHg_id(void) const;
121 
122  /// Reset Hg_id data member.
123  void ResetHg_id(void);
124 
125  /// Get the Hg_id member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  THg_id GetHg_id(void) const;
130 
131  /// Assign a value to Hg_id data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetHg_id(THg_id value);
136 
137  /// Assign a value to Hg_id data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  THg_id& SetHg_id(void);
142 
143  /// Check if a value has been assigned to Title data member.
144  ///
145  /// Data member Title is mandatory;
146  /// its type is defined as 'typedef string TTitle'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetTitle(void) const;
151 
152  /// Check if it is safe to call GetTitle method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetTitle(void) const;
158 
159  /// Reset Title data member.
160  void ResetTitle(void);
161 
162  /// Get the Title member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TTitle& GetTitle(void) const;
167 
168  /// Assign a value to Title data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetTitle(const TTitle& value);
173  void SetTitle(TTitle&& value);
174 
175  /// Assign a value to Title data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TTitle& SetTitle(void);
180 
181  /// Check if a value has been assigned to Commentaries data member.
182  ///
183  /// Data member Commentaries is mandatory;
184  /// its type is defined as 'typedef list< CRef< CHG_Commentary > > TCommentaries'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetCommentaries(void) const;
189 
190  /// Check if it is safe to call GetCommentaries method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetCommentaries(void) const;
196 
197  /// Reset Commentaries data member.
198  void ResetCommentaries(void);
199 
200  /// Get the Commentaries member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TCommentaries& GetCommentaries(void) const;
205 
206  /// Assign a value to Commentaries data member.
207  ///
208  /// @return
209  /// Reference to the data value.
211 
212  /// Reset the whole object
213  virtual void Reset(void);
214 
215 
216 private:
217  // Prohibit copy constructor and assignment operator
220 
221  // data
223  int m_Hg_id;
224  string m_Title;
225  list< CRef< CHG_Commentary > > m_Commentaries;
226 };
227 
228 /* @} */
229 
230 
231 
232 
233 
234 ///////////////////////////////////////////////////////////
235 ///////////////////// inline methods //////////////////////
236 ///////////////////////////////////////////////////////////
237 inline
239 {
240  return ((m_set_State[0] & 0x3) != 0);
241 }
242 
243 inline
245 {
246  return IsSetHg_id();
247 }
248 
249 inline
251 {
252  m_Hg_id = 0;
253  m_set_State[0] &= ~0x3;
254 }
255 
256 inline
258 {
259  if (!CanGetHg_id()) {
260  ThrowUnassigned(0);
261  }
262  return m_Hg_id;
263 }
264 
265 inline
267 {
268  m_Hg_id = value;
269  m_set_State[0] |= 0x3;
270 }
271 
272 inline
274 {
275 #ifdef _DEBUG
276  if (!IsSetHg_id()) {
277  memset(&m_Hg_id,UnassignedByte(),sizeof(m_Hg_id));
278  }
279 #endif
280  m_set_State[0] |= 0x1;
281  return m_Hg_id;
282 }
283 
284 inline
286 {
287  return ((m_set_State[0] & 0xc) != 0);
288 }
289 
290 inline
292 {
293  return IsSetTitle();
294 }
295 
296 inline
298 {
299  if (!CanGetTitle()) {
300  ThrowUnassigned(1);
301  }
302  return m_Title;
303 }
304 
305 inline
307 {
308  m_Title = value;
309  m_set_State[0] |= 0xc;
310 }
311 
312 inline
314 {
315  m_Title = std::forward<CHG_CommentarySet_Base::TTitle>(value);
316  m_set_State[0] |= 0xc;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetTitle()) {
325  }
326 #endif
327  m_set_State[0] |= 0x4;
328  return m_Title;
329 }
330 
331 inline
333 {
334  return ((m_set_State[0] & 0x30) != 0);
335 }
336 
337 inline
339 {
340  return true;
341 }
342 
343 inline
345 {
346  return m_Commentaries;
347 }
348 
349 inline
351 {
352  m_set_State[0] |= 0x10;
353  return m_Commentaries;
354 }
355 
356 ///////////////////////////////////////////////////////////
357 ////////////////// end of inline methods //////////////////
358 ///////////////////////////////////////////////////////////
359 
360 
361 
362 
363 
364 END_objects_SCOPE // namespace ncbi::objects::
365 
367 
368 
369 #endif // OBJECTS_HOMOLOGENE_HG_COMMENTARYSET_BASE_HPP
CHG_CommentarySet_Base –.
CHG_Commentary –.
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
bool IsSetCommentaries(void) const
Check if a value has been assigned to Commentaries data member.
CHG_CommentarySet_Base & operator=(const CHG_CommentarySet_Base &)
THg_id GetHg_id(void) const
Get the Hg_id member data.
void ResetHg_id(void)
Reset Hg_id data member.
list< CRef< CHG_Commentary > > m_Commentaries
const TCommentaries & GetCommentaries(void) const
Get the Commentaries member data.
TTitle & SetTitle(void)
Assign a value to Title data member.
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
void ResetTitle(void)
Reset Title data member.
const TTitle & GetTitle(void) const
Get the Title member data.
CHG_CommentarySet_Base(const CHG_CommentarySet_Base &)
void ResetCommentaries(void)
Reset Commentaries data member.
virtual void Reset(void)
Reset the whole object.
THg_id & SetHg_id(void)
Assign a value to Hg_id data member.
list< CRef< CHG_Commentary > > TCommentaries
bool CanGetCommentaries(void) const
Check if it is safe to call GetCommentaries method.
TCommentaries & SetCommentaries(void)
Assign a value to Commentaries data member.
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
virtual ~CHG_CommentarySet_Base(void)
bool IsSetHg_id(void) const
Check if a value has been assigned to Hg_id data member.
bool CanGetHg_id(void) const
Check if it is safe to call GetHg_id method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:18 2024 by modify_doxy.py rev. 669887