NCBI C++ ToolKit
ID2S_Seq_descr_Info_.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 ID2S_Seq_descr_Info_.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/seqsplit/seqsplit.asn">seqsplit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqsplit/seqsplit.def">seqsplit.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_SEQSPLIT_ID2S_SEQ_DESCR_INFO_BASE_HPP
42 #define OBJECTS_SEQSPLIT_ID2S_SEQ_DESCR_INFO_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
56 class CID2S_Bioseq_Ids;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Seq_split
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CID2S_Seq_descr_Info_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CID2S_Seq_descr_Info_Base(void);
81 
82  // type info
84 
85  // types
86  typedef unsigned TType_mask;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_type_mask,
94  e_bioseqs,
95  e_bioseq_sets
96  };
98 
99  // getters
100  // setters
101 
102  /// mask of Seq-descr types,
103  /// Check if a value has been assigned to Type_mask data member.
104  ///
105  /// Data member Type_mask is mandatory;
106  /// its type is defined as 'typedef unsigned TType_mask'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetType_mask(void) const;
111 
112  /// Check if it is safe to call GetType_mask method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetType_mask(void) const;
118 
119  /// Reset Type_mask data member.
120  void ResetType_mask(void);
121 
122  /// Get the Type_mask member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TType_mask GetType_mask(void) const;
127 
128  /// Assign a value to Type_mask data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetType_mask(TType_mask value);
133 
134  /// Assign a value to Type_mask data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TType_mask& SetType_mask(void);
139 
140  /// Check if a value has been assigned to Bioseqs data member.
141  ///
142  /// Data member Bioseqs is optional;
143  /// its type is defined as 'typedef CID2S_Bioseq_Ids TBioseqs'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetBioseqs(void) const;
148 
149  /// Check if it is safe to call GetBioseqs method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetBioseqs(void) const;
155 
156  /// Reset Bioseqs data member.
157  void ResetBioseqs(void);
158 
159  /// Get the Bioseqs member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TBioseqs& GetBioseqs(void) const;
164 
165  /// Assign a value to Bioseqs data member.
166  ///
167  /// @param value
168  /// Reference to value.
169  void SetBioseqs(TBioseqs& value);
170 
171  /// Assign a value to Bioseqs data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TBioseqs& SetBioseqs(void);
176 
177  /// Check if a value has been assigned to Bioseq_sets data member.
178  ///
179  /// Data member Bioseq_sets is optional;
180  /// its type is defined as 'typedef CID2S_Bioseq_set_Ids TBioseq_sets'
181  /// @return
182  /// - true, if a value has been assigned.
183  /// - false, otherwise.
184  bool IsSetBioseq_sets(void) const;
185 
186  /// Check if it is safe to call GetBioseq_sets method.
187  ///
188  /// @return
189  /// - true, if the data member is getatable.
190  /// - false, otherwise.
191  bool CanGetBioseq_sets(void) const;
192 
193  /// Reset Bioseq_sets data member.
194  void ResetBioseq_sets(void);
195 
196  /// Get the Bioseq_sets member data.
197  ///
198  /// @return
199  /// Reference to the member data.
200  const TBioseq_sets& GetBioseq_sets(void) const;
201 
202  /// Assign a value to Bioseq_sets data member.
203  ///
204  /// @param value
205  /// Reference to value.
206  void SetBioseq_sets(TBioseq_sets& value);
207 
208  /// Assign a value to Bioseq_sets data member.
209  ///
210  /// @return
211  /// Reference to the data value.
212  TBioseq_sets& SetBioseq_sets(void);
213 
214  /// Reset the whole object
215  virtual void Reset(void);
216 
217 
218 private:
219  // Prohibit copy constructor and assignment operator
222 
223  // data
224  Uint4 m_set_State[1];
225  unsigned m_Type_mask;
228 };
229 
230 /* @} */
231 
232 
233 
234 
235 
236 ///////////////////////////////////////////////////////////
237 ///////////////////// inline methods //////////////////////
238 ///////////////////////////////////////////////////////////
239 inline
241 {
242  return ((m_set_State[0] & 0x3) != 0);
243 }
244 
245 inline
247 {
248  return IsSetType_mask();
249 }
250 
251 inline
253 {
254  m_Type_mask = 0;
255  m_set_State[0] &= ~0x3;
256 }
257 
258 inline
260 {
261  if (!CanGetType_mask()) {
262  ThrowUnassigned(0);
263  }
264  return m_Type_mask;
265 }
266 
267 inline
269 {
270  m_Type_mask = value;
271  m_set_State[0] |= 0x3;
272 }
273 
274 inline
276 {
277 #ifdef _DEBUG
278  if (!IsSetType_mask()) {
279  memset(&m_Type_mask,UnassignedByte(),sizeof(m_Type_mask));
280  }
281 #endif
282  m_set_State[0] |= 0x1;
283  return m_Type_mask;
284 }
285 
286 inline
288 {
289  return m_Bioseqs.NotEmpty();
290 }
291 
292 inline
294 {
295  return IsSetBioseqs();
296 }
297 
298 inline
300 {
301  if (!CanGetBioseqs()) {
302  ThrowUnassigned(1);
303  }
304  return (*m_Bioseqs);
305 }
306 
307 inline
309 {
310  return m_Bioseq_sets.NotEmpty();
311 }
312 
313 inline
315 {
316  return IsSetBioseq_sets();
317 }
318 
319 inline
321 {
322  if (!CanGetBioseq_sets()) {
323  ThrowUnassigned(2);
324  }
325  return (*m_Bioseq_sets);
326 }
327 
328 ///////////////////////////////////////////////////////////
329 ////////////////// end of inline methods //////////////////
330 ///////////////////////////////////////////////////////////
331 
332 
333 
334 
335 
336 END_objects_SCOPE // namespace ncbi::objects::
337 
339 
340 
341 #endif // OBJECTS_SEQSPLIT_ID2S_SEQ_DESCR_INFO_BASE_HPP
CID2S_Bioseq_Ids –.
CID2S_Bioseq_set_Ids –.
CID2S_Seq_descr_Info_Base –.
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
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_ID2_EXPORT
Definition: ncbi_export.h:552
bool CanGetBioseqs(void) const
Check if it is safe to call GetBioseqs method.
CID2S_Bioseq_set_Ids TBioseq_sets
TType_mask & SetType_mask(void)
Assign a value to Type_mask data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool IsSetBioseq_sets(void) const
Check if a value has been assigned to Bioseq_sets data member.
CID2S_Seq_descr_Info_Base & operator=(const CID2S_Seq_descr_Info_Base &)
TType_mask GetType_mask(void) const
Get the Type_mask member data.
bool CanGetType_mask(void) const
Check if it is safe to call GetType_mask method.
bool IsSetBioseqs(void) const
Check if a value has been assigned to Bioseqs data member.
bool IsSetType_mask(void) const
mask of Seq-descr types, Check if a value has been assigned to Type_mask data member.
const TBioseqs & GetBioseqs(void) const
Get the Bioseqs member data.
CRef< TBioseq_sets > m_Bioseq_sets
const TBioseq_sets & GetBioseq_sets(void) const
Get the Bioseq_sets member data.
void ResetType_mask(void)
Reset Type_mask data member.
bool CanGetBioseq_sets(void) const
Check if it is safe to call GetBioseq_sets method.
CID2S_Seq_descr_Info_Base(const CID2S_Seq_descr_Info_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 14:59:13 2024 by modify_doxy.py rev. 669887