NCBI C++ ToolKit
ID2S_Gi_Interval_.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_Gi_Interval_.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_GI_INTERVAL_BASE_HPP
42 #define OBJECTS_SEQSPLIT_ID2S_GI_INTERVAL_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 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_Seq_split
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CID2S_Gi_Interval_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CID2S_Gi_Interval_Base(void);
76 
77  // type info
79 
80  // types
82  typedef TSeqPos TStart;
83  typedef TSeqPos TLength;
84 
85  // member index
86  enum class E_memberIndex {
87  e__allMandatory = 0,
88  e_gi,
89  e_start,
90  e_length
91  };
93 
94  // getters
95  // setters
96 
97  /// Check if a value has been assigned to Gi data member.
98  ///
99  /// Data member Gi is mandatory;
100  /// its type is defined as 'typedef NCBI_NS_NCBI::TGi TGi'
101  /// @return
102  /// - true, if a value has been assigned.
103  /// - false, otherwise.
104  bool IsSetGi(void) const;
105 
106  /// Check if it is safe to call GetGi method.
107  ///
108  /// @return
109  /// - true, if the data member is getatable.
110  /// - false, otherwise.
111  bool CanGetGi(void) const;
112 
113  /// Reset Gi data member.
114  void ResetGi(void);
115 
116  /// Get the Gi member data.
117  ///
118  /// @return
119  /// Copy of the member data.
120  TGi GetGi(void) const;
121 
122  /// Assign a value to Gi data member.
123  ///
124  /// @param value
125  /// Value to assign
126  void SetGi(TGi value);
127 
128  /// Assign a value to Gi data member.
129  ///
130  /// @return
131  /// Reference to the data value.
132  TGi& SetGi(void);
133 
134  /// Check if a value has been assigned to Start data member.
135  ///
136  /// Data member Start is mandatory;
137  /// its type is defined as 'typedef TSeqPos TStart'
138  /// @return
139  /// - true, if a value has been assigned.
140  /// - false, otherwise.
141  bool IsSetStart(void) const;
142 
143  /// Check if it is safe to call GetStart method.
144  ///
145  /// @return
146  /// - true, if the data member is getatable.
147  /// - false, otherwise.
148  bool CanGetStart(void) const;
149 
150  /// Reset Start data member.
151  void ResetStart(void);
152 
153  /// Get the Start member data.
154  ///
155  /// @return
156  /// Copy of the member data.
157  TStart GetStart(void) const;
158 
159  /// Assign a value to Start data member.
160  ///
161  /// @param value
162  /// Value to assign
163  void SetStart(TStart value);
164 
165  /// Assign a value to Start data member.
166  ///
167  /// @return
168  /// Reference to the data value.
169  TStart& SetStart(void);
170 
171  /// Check if a value has been assigned to Length data member.
172  ///
173  /// Data member Length is optional with default 1;
174  /// its type is defined as 'typedef TSeqPos TLength'
175  /// @return
176  /// - true, if a value has been assigned.
177  /// - false, otherwise.
178  bool IsSetLength(void) const;
179 
180  /// Check if it is safe to call GetLength method.
181  ///
182  /// @return
183  /// - true, if the data member is getatable.
184  /// - false, otherwise.
185  bool CanGetLength(void) const;
186 
187  /// Reset Length data member.
188  void ResetLength(void);
189 
190  /// Assign default value to Length data member.
191  void SetDefaultLength(void);
192 
193  /// Get the Length member data.
194  ///
195  /// @return
196  /// Copy of the member data.
197  TLength GetLength(void) const;
198 
199  /// Assign a value to Length data member.
200  ///
201  /// @param value
202  /// Value to assign
203  void SetLength(TLength value);
204 
205  /// Assign a value to Length data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TLength& SetLength(void);
210 
211  /// Reset the whole object
212  virtual void Reset(void);
213 
214 
215 private:
216  // Prohibit copy constructor and assignment operator
219 
220  // data
221  Uint4 m_set_State[1];
225 };
226 
227 /* @} */
228 
229 
230 
231 
232 
233 ///////////////////////////////////////////////////////////
234 ///////////////////// inline methods //////////////////////
235 ///////////////////////////////////////////////////////////
236 inline
238 {
239  return ((m_set_State[0] & 0x3) != 0);
240 }
241 
242 inline
244 {
245  return IsSetGi();
246 }
247 
248 inline
250 {
251  m_Gi = 0;
252  m_set_State[0] &= ~0x3;
253 }
254 
255 inline
257 {
258  if (!CanGetGi()) {
259  ThrowUnassigned(0);
260  }
261  return reinterpret_cast<const TGi&>(m_Gi);
262 }
263 
264 inline
266 {
267  reinterpret_cast<TGi&>(m_Gi) = value;
268  m_set_State[0] |= 0x3;
269 }
270 
271 inline
273 {
274 #ifdef _DEBUG
275  if (!IsSetGi()) {
276  memset(&m_Gi,UnassignedByte(),sizeof(m_Gi));
277  }
278 #endif
279  m_set_State[0] |= 0x1;
280  return reinterpret_cast<TGi&>(m_Gi);
281 }
282 
283 inline
285 {
286  return ((m_set_State[0] & 0xc) != 0);
287 }
288 
289 inline
291 {
292  return IsSetStart();
293 }
294 
295 inline
297 {
298  m_Start = 0;
299  m_set_State[0] &= ~0xc;
300 }
301 
302 inline
304 {
305  if (!CanGetStart()) {
306  ThrowUnassigned(1);
307  }
308  return m_Start;
309 }
310 
311 inline
313 {
314  m_Start = value;
315  m_set_State[0] |= 0xc;
316 }
317 
318 inline
320 {
321 #ifdef _DEBUG
322  if (!IsSetStart()) {
323  memset(&m_Start,UnassignedByte(),sizeof(m_Start));
324  }
325 #endif
326  m_set_State[0] |= 0x4;
327  return m_Start;
328 }
329 
330 inline
332 {
333  return ((m_set_State[0] & 0x30) != 0);
334 }
335 
336 inline
338 {
339  return true;
340 }
341 
342 inline
344 {
345  m_Length = 1;
346  m_set_State[0] &= ~0x30;
347 }
348 
349 inline
351 {
352  ResetLength();
353 }
354 
355 inline
357 {
358  return m_Length;
359 }
360 
361 inline
363 {
364  m_Length = value;
365  m_set_State[0] |= 0x30;
366 }
367 
368 inline
370 {
371 #ifdef _DEBUG
372  if (!IsSetLength()) {
373  memset(&m_Length,UnassignedByte(),sizeof(m_Length));
374  }
375 #endif
376  m_set_State[0] |= 0x10;
377  return m_Length;
378 }
379 
380 ///////////////////////////////////////////////////////////
381 ////////////////// end of inline methods //////////////////
382 ///////////////////////////////////////////////////////////
383 
384 
385 
386 
387 
388 END_objects_SCOPE // namespace ncbi::objects::
389 
391 
392 
393 #endif // OBJECTS_SEQSPLIT_ID2S_GI_INTERVAL_BASE_HPP
CID2S_Gi_Interval_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
Int8 TIntId
Definition: ncbimisc.hpp:999
CStrictId< SStrictId_Gi, SStrictId_Gi::TId > TGi
Definition: ncbimisc.hpp:1025
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
TSeqPos GetStart(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the start of the location.
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
CID2S_Gi_Interval_Base(const CID2S_Gi_Interval_Base &)
void ResetLength(void)
Reset Length data member.
bool CanGetGi(void) const
Check if it is safe to call GetGi method.
bool IsSetLength(void) const
Check if a value has been assigned to Length data member.
void ResetGi(void)
Reset Gi data member.
void ResetStart(void)
Reset Start data member.
bool IsSetStart(void) const
Check if a value has been assigned to Start data member.
bool CanGetStart(void) const
Check if it is safe to call GetStart method.
TGi GetGi(void) const
Get the Gi member data.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TLength & SetLength(void)
Assign a value to Length data member.
bool IsSetGi(void) const
Check if a value has been assigned to Gi data member.
TStart & SetStart(void)
Assign a value to Start data member.
CID2S_Gi_Interval_Base & operator=(const CID2S_Gi_Interval_Base &)
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
TLength GetLength(void) const
Get the Length member data.
TStart GetStart(void) const
Get the Start member data.
TGi & SetGi(void)
Assign a value to Gi data member.
void SetDefaultLength(void)
Assign default value to Length data member.
Modified on Sat Dec 02 09:19:55 2023 by modify_doxy.py rev. 669887