NCBI C++ ToolKit
Std_seg_.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 Std_seg_.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/seqalign/seqalign.asn">seqalign.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqalign/seqalign.def">seqalign.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_SEQALIGN_STD_SEG_BASE_HPP
42 #define OBJECTS_SEQALIGN_STD_SEG_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
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 CScore;
61 class CSeq_id;
62 class CSeq_loc;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Seqalign
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CStd_seg_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CStd_seg_Base(void);
84  // destructor
85  virtual ~CStd_seg_Base(void);
86 
87  // type info
89 
90  // types
91  typedef int TDim;
92  typedef vector< CRef< CSeq_id > > TIds;
93  typedef vector< CRef< CSeq_loc > > TLoc;
94  typedef vector< CRef< CScore > > TScores;
95 
96  // member index
97  enum class E_memberIndex {
98  e__allMandatory = 0,
99  e_dim,
100  e_ids,
101  e_loc,
102  e_scores
103  };
105 
106  // getters
107  // setters
108 
109  /// dimensionality
110  /// Check if a value has been assigned to Dim data member.
111  ///
112  /// Data member Dim is optional with default 2;
113  /// its type is defined as 'typedef int TDim'
114  /// @return
115  /// - true, if a value has been assigned.
116  /// - false, otherwise.
117  bool IsSetDim(void) const;
118 
119  /// Check if it is safe to call GetDim method.
120  ///
121  /// @return
122  /// - true, if the data member is getatable.
123  /// - false, otherwise.
124  bool CanGetDim(void) const;
125 
126  /// Reset Dim data member.
127  void ResetDim(void);
128 
129  /// Assign default value to Dim data member.
130  void SetDefaultDim(void);
131 
132  /// Get the Dim member data.
133  ///
134  /// @return
135  /// Copy of the member data.
136  TDim GetDim(void) const;
137 
138  /// Assign a value to Dim data member.
139  ///
140  /// @param value
141  /// Value to assign
142  void SetDim(TDim value);
143 
144  /// Assign a value to Dim data member.
145  ///
146  /// @return
147  /// Reference to the data value.
148  TDim& SetDim(void);
149 
150  /// Check if a value has been assigned to Ids data member.
151  ///
152  /// Data member Ids is optional;
153  /// its type is defined as 'typedef vector< CRef< CSeq_id > > TIds'
154  /// @return
155  /// - true, if a value has been assigned.
156  /// - false, otherwise.
157  bool IsSetIds(void) const;
158 
159  /// Check if it is safe to call GetIds method.
160  ///
161  /// @return
162  /// - true, if the data member is getatable.
163  /// - false, otherwise.
164  bool CanGetIds(void) const;
165 
166  /// Reset Ids data member.
167  void ResetIds(void);
168 
169  /// Get the Ids member data.
170  ///
171  /// @return
172  /// Reference to the member data.
173  const TIds& GetIds(void) const;
174 
175  /// Assign a value to Ids data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TIds& SetIds(void);
180 
181  /// Check if a value has been assigned to Loc data member.
182  ///
183  /// Data member Loc is mandatory;
184  /// its type is defined as 'typedef vector< CRef< CSeq_loc > > TLoc'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetLoc(void) const;
189 
190  /// Check if it is safe to call GetLoc method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetLoc(void) const;
196 
197  /// Reset Loc data member.
198  void ResetLoc(void);
199 
200  /// Get the Loc member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TLoc& GetLoc(void) const;
205 
206  /// Assign a value to Loc data member.
207  ///
208  /// @return
209  /// Reference to the data value.
210  TLoc& SetLoc(void);
211 
212  /// Check if a value has been assigned to Scores data member.
213  ///
214  /// Data member Scores is optional;
215  /// its type is defined as 'typedef vector< CRef< CScore > > TScores'
216  /// @return
217  /// - true, if a value has been assigned.
218  /// - false, otherwise.
219  bool IsSetScores(void) const;
220 
221  /// Check if it is safe to call GetScores method.
222  ///
223  /// @return
224  /// - true, if the data member is getatable.
225  /// - false, otherwise.
226  bool CanGetScores(void) const;
227 
228  /// Reset Scores data member.
229  void ResetScores(void);
230 
231  /// Get the Scores member data.
232  ///
233  /// @return
234  /// Reference to the member data.
235  const TScores& GetScores(void) const;
236 
237  /// Assign a value to Scores data member.
238  ///
239  /// @return
240  /// Reference to the data value.
241  TScores& SetScores(void);
242 
243  /// Reset the whole object
244  virtual void Reset(void);
245 
246 
247 private:
248  // Prohibit copy constructor and assignment operator
251 
252  // data
253  Uint4 m_set_State[1];
254  int m_Dim;
255  vector< CRef< CSeq_id > > m_Ids;
256  vector< CRef< CSeq_loc > > m_Loc;
257  vector< CRef< CScore > > m_Scores;
258 };
259 
260 /* @} */
261 
262 
263 
264 
265 
266 ///////////////////////////////////////////////////////////
267 ///////////////////// inline methods //////////////////////
268 ///////////////////////////////////////////////////////////
269 inline
270 bool CStd_seg_Base::IsSetDim(void) const
271 {
272  return ((m_set_State[0] & 0x3) != 0);
273 }
274 
275 inline
276 bool CStd_seg_Base::CanGetDim(void) const
277 {
278  return true;
279 }
280 
281 inline
283 {
284  m_Dim = 2;
285  m_set_State[0] &= ~0x3;
286 }
287 
288 inline
290 {
291  ResetDim();
292 }
293 
294 inline
296 {
297  return m_Dim;
298 }
299 
300 inline
302 {
303  m_Dim = value;
304  m_set_State[0] |= 0x3;
305 }
306 
307 inline
309 {
310 #ifdef _DEBUG
311  if (!IsSetDim()) {
312  memset(&m_Dim,UnassignedByte(),sizeof(m_Dim));
313  }
314 #endif
315  m_set_State[0] |= 0x1;
316  return m_Dim;
317 }
318 
319 inline
320 bool CStd_seg_Base::IsSetIds(void) const
321 {
322  return ((m_set_State[0] & 0xc) != 0);
323 }
324 
325 inline
326 bool CStd_seg_Base::CanGetIds(void) const
327 {
328  return true;
329 }
330 
331 inline
333 {
334  return m_Ids;
335 }
336 
337 inline
339 {
340  m_set_State[0] |= 0x4;
341  return m_Ids;
342 }
343 
344 inline
345 bool CStd_seg_Base::IsSetLoc(void) const
346 {
347  return ((m_set_State[0] & 0x30) != 0);
348 }
349 
350 inline
351 bool CStd_seg_Base::CanGetLoc(void) const
352 {
353  return true;
354 }
355 
356 inline
358 {
359  return m_Loc;
360 }
361 
362 inline
364 {
365  m_set_State[0] |= 0x10;
366  return m_Loc;
367 }
368 
369 inline
371 {
372  return ((m_set_State[0] & 0xc0) != 0);
373 }
374 
375 inline
377 {
378  return true;
379 }
380 
381 inline
383 {
384  return m_Scores;
385 }
386 
387 inline
389 {
390  m_set_State[0] |= 0x40;
391  return m_Scores;
392 }
393 
394 ///////////////////////////////////////////////////////////
395 ////////////////// end of inline methods //////////////////
396 ///////////////////////////////////////////////////////////
397 
398 
399 
400 
401 
402 END_objects_SCOPE // namespace ncbi::objects::
403 
405 
406 
407 #endif // OBJECTS_SEQALIGN_STD_SEG_BASE_HPP
void SetScores(objects::CSeq_align &seq_align, objects::CScope &scope, const string &matrix_name="BLOSUM62")
Definition: Score.hpp:57
Base class for all serializable objects.
Definition: serialbase.hpp:150
CStd_seg_Base –.
Definition: Std_seg_.hpp:79
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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_SEQALIGN_EXPORT
Definition: ncbi_export.h:744
const TScores & GetScores(void) const
Get the Scores member data.
Definition: Std_seg_.hpp:382
vector< CRef< CScore > > TScores
Definition: Std_seg_.hpp:94
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: Std_seg_.hpp:338
vector< CRef< CSeq_loc > > TLoc
Definition: Std_seg_.hpp:93
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Std_seg_.hpp:104
const TLoc & GetLoc(void) const
Get the Loc member data.
Definition: Std_seg_.hpp:357
CStd_seg_Base(const CStd_seg_Base &)
const TIds & GetIds(void) const
Get the Ids member data.
Definition: Std_seg_.hpp:332
bool CanGetScores(void) const
Check if it is safe to call GetScores method.
Definition: Std_seg_.hpp:376
TDim & SetDim(void)
Assign a value to Dim data member.
Definition: Std_seg_.hpp:308
bool CanGetDim(void) const
Check if it is safe to call GetDim method.
Definition: Std_seg_.hpp:276
vector< CRef< CScore > > m_Scores
Definition: Std_seg_.hpp:257
TLoc & SetLoc(void)
Assign a value to Loc data member.
Definition: Std_seg_.hpp:363
void ResetDim(void)
Reset Dim data member.
Definition: Std_seg_.hpp:282
vector< CRef< CSeq_loc > > m_Loc
Definition: Std_seg_.hpp:256
TScores & SetScores(void)
Assign a value to Scores data member.
Definition: Std_seg_.hpp:388
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
Definition: Std_seg_.hpp:270
bool IsSetIds(void) const
Check if a value has been assigned to Ids data member.
Definition: Std_seg_.hpp:320
vector< CRef< CSeq_id > > TIds
Definition: Std_seg_.hpp:92
CSerialObject Tparent
Definition: Std_seg_.hpp:80
bool IsSetScores(void) const
Check if a value has been assigned to Scores data member.
Definition: Std_seg_.hpp:370
TDim GetDim(void) const
Get the Dim member data.
Definition: Std_seg_.hpp:295
DECLARE_INTERNAL_TYPE_INFO()
bool CanGetIds(void) const
Check if it is safe to call GetIds method.
Definition: Std_seg_.hpp:326
vector< CRef< CSeq_id > > m_Ids
Definition: Std_seg_.hpp:255
bool CanGetLoc(void) const
Check if it is safe to call GetLoc method.
Definition: Std_seg_.hpp:351
void SetDefaultDim(void)
Assign default value to Dim data member.
Definition: Std_seg_.hpp:289
CStd_seg_Base & operator=(const CStd_seg_Base &)
bool IsSetLoc(void) const
Check if a value has been assigned to Loc data member.
Definition: Std_seg_.hpp:345
Uint4 m_set_State[1]
Definition: Std_seg_.hpp:253
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int GetLoc(const string &acc, const string &pat, CSeq_loc &loc, CScope &scope)
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Modified on Mon Apr 22 04:05:58 2024 by modify_doxy.py rev. 669887