NCBI C++ ToolKit
Inversion_.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 Inversion_.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/varrep/varrep.asn">varrep.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/varrep/varrep.def">varrep.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_VARREP_INVERSION_BASE_HPP
42 #define OBJECTS_VARREP_INVERSION_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 // forward declarations
60 class CNtInterval;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_VariationIRep
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CInversion_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CInversion_Base(void);
82  // destructor
83  virtual ~CInversion_Base(void);
84 
85  // type info
87 
88  // types
90  typedef string TRaw_seq;
91  typedef int TSize;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_ntint,
97  e_raw_seq,
98  e_size
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Ntint data member.
106  ///
107  /// Data member Ntint is mandatory;
108  /// its type is defined as 'typedef CNtInterval TNtint'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetNtint(void) const;
113 
114  /// Check if it is safe to call GetNtint method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetNtint(void) const;
120 
121  /// Reset Ntint data member.
122  void ResetNtint(void);
123 
124  /// Get the Ntint member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TNtint& GetNtint(void) const;
129 
130  /// Assign a value to Ntint data member.
131  ///
132  /// @param value
133  /// Reference to value.
134  void SetNtint(TNtint& value);
135 
136  /// Assign a value to Ntint data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TNtint& SetNtint(void);
141 
142  /// Check if a value has been assigned to Raw_seq data member.
143  ///
144  /// Data member Raw_seq is optional;
145  /// its type is defined as 'typedef string TRaw_seq'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetRaw_seq(void) const;
150 
151  /// Check if it is safe to call GetRaw_seq method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetRaw_seq(void) const;
157 
158  /// Reset Raw_seq data member.
159  void ResetRaw_seq(void);
160 
161  /// Get the Raw_seq member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TRaw_seq& GetRaw_seq(void) const;
166 
167  /// Assign a value to Raw_seq data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetRaw_seq(const TRaw_seq& value);
172  void SetRaw_seq(TRaw_seq&& value);
173 
174  /// Assign a value to Raw_seq data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TRaw_seq& SetRaw_seq(void);
179 
180  /// optionall specify the size of the inverted sequence
181  /// Check if a value has been assigned to Size data member.
182  ///
183  /// Data member Size is optional;
184  /// its type is defined as 'typedef int TSize'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetSize(void) const;
189 
190  /// Check if it is safe to call GetSize method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetSize(void) const;
196 
197  /// Reset Size data member.
198  void ResetSize(void);
199 
200  /// Get the Size member data.
201  ///
202  /// @return
203  /// Copy of the member data.
204  TSize GetSize(void) const;
205 
206  /// Assign a value to Size data member.
207  ///
208  /// @param value
209  /// Value to assign
210  void SetSize(TSize value);
211 
212  /// Assign a value to Size data member.
213  ///
214  /// @return
215  /// Reference to the data value.
216  TSize& SetSize(void);
217 
218  /// Reset the whole object
219  virtual void Reset(void);
220 
221 
222 private:
223  // Prohibit copy constructor and assignment operator
226 
227  // data
230  string m_Raw_seq;
231  int m_Size;
232 };
233 
234 /* @} */
235 
236 
237 
238 
239 
240 ///////////////////////////////////////////////////////////
241 ///////////////////// inline methods //////////////////////
242 ///////////////////////////////////////////////////////////
243 inline
245 {
246  return m_Ntint.NotEmpty();
247 }
248 
249 inline
251 {
252  return true;
253 }
254 
255 inline
257 {
258  if ( !m_Ntint ) {
259  const_cast<CInversion_Base*>(this)->ResetNtint();
260  }
261  return (*m_Ntint);
262 }
263 
264 inline
266 {
267  if ( !m_Ntint ) {
268  ResetNtint();
269  }
270  return (*m_Ntint);
271 }
272 
273 inline
275 {
276  return ((m_set_State[0] & 0xc) != 0);
277 }
278 
279 inline
281 {
282  return IsSetRaw_seq();
283 }
284 
285 inline
287 {
288  if (!CanGetRaw_seq()) {
289  ThrowUnassigned(1);
290  }
291  return m_Raw_seq;
292 }
293 
294 inline
296 {
297  m_Raw_seq = value;
298  m_set_State[0] |= 0xc;
299 }
300 
301 inline
303 {
304  m_Raw_seq = std::forward<CInversion_Base::TRaw_seq>(value);
305  m_set_State[0] |= 0xc;
306 }
307 
308 inline
310 {
311 #ifdef _DEBUG
312  if (!IsSetRaw_seq()) {
314  }
315 #endif
316  m_set_State[0] |= 0x4;
317  return m_Raw_seq;
318 }
319 
320 inline
322 {
323  return ((m_set_State[0] & 0x30) != 0);
324 }
325 
326 inline
328 {
329  return IsSetSize();
330 }
331 
332 inline
334 {
335  m_Size = 0;
336  m_set_State[0] &= ~0x30;
337 }
338 
339 inline
341 {
342  if (!CanGetSize()) {
343  ThrowUnassigned(2);
344  }
345  return m_Size;
346 }
347 
348 inline
350 {
351  m_Size = value;
352  m_set_State[0] |= 0x30;
353 }
354 
355 inline
357 {
358 #ifdef _DEBUG
359  if (!IsSetSize()) {
360  memset(&m_Size,UnassignedByte(),sizeof(m_Size));
361  }
362 #endif
363  m_set_State[0] |= 0x10;
364  return m_Size;
365 }
366 
367 ///////////////////////////////////////////////////////////
368 ////////////////// end of inline methods //////////////////
369 ///////////////////////////////////////////////////////////
370 
371 
372 
373 
374 
375 END_objects_SCOPE // namespace ncbi::objects::
376 
378 
379 
380 #endif // OBJECTS_VARREP_INVERSION_BASE_HPP
CInversion_Base –.
Definition: Inversion_.hpp:77
CNtInterval –.
Definition: NtInterval.hpp:66
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
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 CanGetRaw_seq(void) const
Check if it is safe to call GetRaw_seq method.
Definition: Inversion_.hpp:280
void ResetRaw_seq(void)
Reset Raw_seq data member.
Definition: Inversion_.cpp:65
bool IsSetRaw_seq(void) const
Check if a value has been assigned to Raw_seq data member.
Definition: Inversion_.hpp:274
void ResetSize(void)
Reset Size data member.
Definition: Inversion_.hpp:333
Uint4 m_set_State[1]
Definition: Inversion_.hpp:228
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: Inversion_.hpp:100
TSize GetSize(void) const
Get the Size member data.
Definition: Inversion_.hpp:340
CNtInterval TNtint
Definition: Inversion_.hpp:89
bool IsSetSize(void) const
optionall specify the size of the inverted sequence Check if a value has been assigned to Size data m...
Definition: Inversion_.hpp:321
void ResetNtint(void)
Reset Ntint data member.
Definition: Inversion_.cpp:51
const TRaw_seq & GetRaw_seq(void) const
Get the Raw_seq member data.
Definition: Inversion_.hpp:286
TSize & SetSize(void)
Assign a value to Size data member.
Definition: Inversion_.hpp:356
CInversion_Base & operator=(const CInversion_Base &)
CSerialObject Tparent
Definition: Inversion_.hpp:78
CInversion_Base(const CInversion_Base &)
TRaw_seq & SetRaw_seq(void)
Assign a value to Raw_seq data member.
Definition: Inversion_.hpp:309
TNtint & SetNtint(void)
Assign a value to Ntint data member.
Definition: Inversion_.hpp:265
CInversion_Base(void)
Definition: Inversion_.cpp:91
virtual void Reset(void)
Reset the whole object.
Definition: Inversion_.cpp:71
bool CanGetSize(void) const
Check if it is safe to call GetSize method.
Definition: Inversion_.hpp:327
CRef< TNtint > m_Ntint
Definition: Inversion_.hpp:229
bool IsSetNtint(void) const
Check if a value has been assigned to Ntint data member.
Definition: Inversion_.hpp:244
virtual ~CInversion_Base(void)
Definition: Inversion_.cpp:101
const TNtint & GetNtint(void) const
Get the Ntint member data.
Definition: Inversion_.hpp:256
bool CanGetNtint(void) const
Check if it is safe to call GetNtint method.
Definition: Inversion_.hpp:250
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon May 20 04:59:58 2024 by modify_doxy.py rev. 669887