NCBI C++ ToolKit
ID2S_Gi_Range_.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_Range_.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_RANGE_BASE_HPP
42 #define OBJECTS_SEQSPLIT_ID2S_GI_RANGE_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_Range_Base --
66 ///
67 
69 {
71 public:
72  // constructor
73  CID2S_Gi_Range_Base(void);
74  // destructor
75  virtual ~CID2S_Gi_Range_Base(void);
76 
77  // type info
79 
80  // types
82  typedef int TCount;
83 
84  // member index
85  enum class E_memberIndex {
86  e__allMandatory = 0,
87  e_start,
88  e_count
89  };
91 
92  // getters
93  // setters
94 
95  /// start gi in this gi range
96  /// Check if a value has been assigned to Start data member.
97  ///
98  /// Data member Start is mandatory;
99  /// its type is defined as 'typedef NCBI_NS_NCBI::TGi TStart'
100  /// @return
101  /// - true, if a value has been assigned.
102  /// - false, otherwise.
103  bool IsSetStart(void) const;
104 
105  /// Check if it is safe to call GetStart method.
106  ///
107  /// @return
108  /// - true, if the data member is getatable.
109  /// - false, otherwise.
110  bool CanGetStart(void) const;
111 
112  /// Reset Start data member.
113  void ResetStart(void);
114 
115  /// Get the Start member data.
116  ///
117  /// @return
118  /// Copy of the member data.
119  TStart GetStart(void) const;
120 
121  /// Assign a value to Start data member.
122  ///
123  /// @param value
124  /// Value to assign
125  void SetStart(TStart value);
126 
127  /// Assign a value to Start data member.
128  ///
129  /// @return
130  /// Reference to the data value.
131  TStart& SetStart(void);
132 
133  /// number of sequential gis
134  /// Check if a value has been assigned to Count data member.
135  ///
136  /// Data member Count is optional with default 1;
137  /// its type is defined as 'typedef int TCount'
138  /// @return
139  /// - true, if a value has been assigned.
140  /// - false, otherwise.
141  bool IsSetCount(void) const;
142 
143  /// Check if it is safe to call GetCount method.
144  ///
145  /// @return
146  /// - true, if the data member is getatable.
147  /// - false, otherwise.
148  bool CanGetCount(void) const;
149 
150  /// Reset Count data member.
151  void ResetCount(void);
152 
153  /// Assign default value to Count data member.
154  void SetDefaultCount(void);
155 
156  /// Get the Count member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TCount GetCount(void) const;
161 
162  /// Assign a value to Count data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetCount(TCount value);
167 
168  /// Assign a value to Count data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TCount& SetCount(void);
173 
174  /// Reset the whole object
175  virtual void Reset(void);
176 
177 
178 private:
179  // Prohibit copy constructor and assignment operator
182 
183  // data
184  Uint4 m_set_State[1];
186  int m_Count;
187 };
188 
189 /* @} */
190 
191 
192 
193 
194 
195 ///////////////////////////////////////////////////////////
196 ///////////////////// inline methods //////////////////////
197 ///////////////////////////////////////////////////////////
198 inline
200 {
201  return ((m_set_State[0] & 0x3) != 0);
202 }
203 
204 inline
206 {
207  return IsSetStart();
208 }
209 
210 inline
212 {
213  m_Start = 0;
214  m_set_State[0] &= ~0x3;
215 }
216 
217 inline
219 {
220  if (!CanGetStart()) {
221  ThrowUnassigned(0);
222  }
223  return reinterpret_cast<const TStart&>(m_Start);
224 }
225 
226 inline
228 {
229  reinterpret_cast<TStart&>(m_Start) = value;
230  m_set_State[0] |= 0x3;
231 }
232 
233 inline
235 {
236 #ifdef _DEBUG
237  if (!IsSetStart()) {
238  memset(&m_Start,UnassignedByte(),sizeof(m_Start));
239  }
240 #endif
241  m_set_State[0] |= 0x1;
242  return reinterpret_cast<TStart&>(m_Start);
243 }
244 
245 inline
247 {
248  return ((m_set_State[0] & 0xc) != 0);
249 }
250 
251 inline
253 {
254  return true;
255 }
256 
257 inline
259 {
260  m_Count = 1;
261  m_set_State[0] &= ~0xc;
262 }
263 
264 inline
266 {
267  ResetCount();
268 }
269 
270 inline
272 {
273  return m_Count;
274 }
275 
276 inline
278 {
279  m_Count = value;
280  m_set_State[0] |= 0xc;
281 }
282 
283 inline
285 {
286 #ifdef _DEBUG
287  if (!IsSetCount()) {
288  memset(&m_Count,UnassignedByte(),sizeof(m_Count));
289  }
290 #endif
291  m_set_State[0] |= 0x4;
292  return m_Count;
293 }
294 
295 ///////////////////////////////////////////////////////////
296 ////////////////// end of inline methods //////////////////
297 ///////////////////////////////////////////////////////////
298 
299 
300 
301 
302 
303 END_objects_SCOPE // namespace ncbi::objects::
304 
306 
307 
308 #endif // OBJECTS_SEQSPLIT_ID2S_GI_RANGE_BASE_HPP
CID2S_Gi_Range_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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 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
TCount GetCount(void) const
Get the Count member data.
bool IsSetStart(void) const
start gi in this gi range Check if a value has been assigned to Start data member.
bool CanGetStart(void) const
Check if it is safe to call GetStart method.
TStart GetStart(void) const
Get the Start member data.
bool IsSetCount(void) const
number of sequential gis Check if a value has been assigned to Count data member.
CSerialObject Tparent
void SetDefaultCount(void)
Assign default value to Count data member.
bool CanGetCount(void) const
Check if it is safe to call GetCount method.
void ResetStart(void)
Reset Start data member.
NCBI_NS_NCBI::TGi TStart
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TCount & SetCount(void)
Assign a value to Count data member.
CID2S_Gi_Range_Base(const CID2S_Gi_Range_Base &)
TStart & SetStart(void)
Assign a value to Start data member.
CID2S_Gi_Range_Base & operator=(const CID2S_Gi_Range_Base &)
void ResetCount(void)
Reset Count data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887