NCBI C++ ToolKit
seq_align_handle.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef SEQ_ALIGN_HANDLE__HPP
2 #define SEQ_ALIGN_HANDLE__HPP
3 
4 /* $Id: seq_align_handle.hpp 33815 2007-05-04 17:18:18Z kazimird $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Aleksey Grichenko, Eugene Vasilchenko
30 *
31 * File Description:
32 * Seq-align handle
33 *
34 */
35 
36 #include <corelib/ncbiobj.hpp>
37 #include <corelib/ncbi_limits.h>
40 
43 
44 
45 /** @addtogroup ObjectManagerHandles
46  *
47  * @{
48  */
49 
50 
51 class CScope;
52 class CSeq_annot_Handle;
53 class CAlign_CI;
54 class CAnnotObject_Info;
55 
56 
57 /////////////////////////////////////////////////////////////////////////////
58 ///
59 /// CSeq_align_Handle --
60 ///
61 /// Proxy to access seq-align objects data
62 ///
63 
64 template<typename Handle>
66 template<typename Handle>
68 template<typename Handle>
70 
72 {
73 public:
74  CSeq_align_Handle(void);
75 
76  void Reset(void);
77 
78  DECLARE_OPERATOR_BOOL(m_Annot && m_AnnotIndex != eNull && !IsRemoved());
79 
80  /// Get scope this handle belongs to
81  CScope& GetScope(void) const;
82 
83  /// Get handle to the seq-annot
84  const CSeq_annot_Handle& GetAnnot(void) const;
85 
86  /// Get const reference to current seq-align
87  CConstRef<CSeq_align> GetSeq_align(void) const;
88 
89  // Mappings for CSeq_align methods
90  CSeq_align::EType GetType(void) const;
91  bool IsSetDim(void) const;
92  CSeq_align::TDim GetDim(void) const;
93  bool IsSetScore(void) const;
94  const CSeq_align::TScore& GetScore(void) const;
95  const CSeq_align::TSegs& GetSegs(void) const;
96  bool IsSetBounds(void) const;
97  const CSeq_align::TBounds& GetBounds(void) const;
98 
99  /// Return true if this Seq-align was removed already
100  bool IsRemoved(void) const;
101  /// Remove the Seq-align from Seq-annot
102  void Remove(void) const;
103  /// Replace the Seq-align with new Seq-align object.
104  /// All indexes are updated correspondingly.
105  void Replace(const CSeq_align& new_obj) const;
106  /// Update index after manual modification of the object
107  void Update(void) const;
108 
109 private:
110  friend class CAlign_CI;
111  friend class CSeq_annot_EditHandle;
112  typedef Int4 TIndex;
113 
114  enum {
115  eNull = kMax_I4
116  };
117 
118  const CSeq_align& x_GetSeq_align(void) const;
119 
120  CSeq_align_Handle(const CSeq_annot_Handle& annot, TIndex index);
121 
123  TIndex m_AnnotIndex;
124 
125 private:
126 
130 
131  /// Remove the Seq-align from Seq-annot
132  void x_RealRemove(void) const;
133  /// Replace the Seq-align with new Seq-align object.
134  /// All indexes are updated correspondingly.
135  void x_RealReplace(const CSeq_align& new_obj) const;
136 
137 };
138 
139 
140 inline
142  : m_AnnotIndex(eNull)
143 {
144 }
145 
146 
147 inline
149 {
150  return m_Annot;
151 }
152 
153 
154 inline
156 {
157  return GetAnnot().GetScope();
158 }
159 
160 
161 inline
163 {
164  return x_GetSeq_align().GetType();
165 }
166 
167 
168 inline
170 {
171  return x_GetSeq_align().IsSetDim();
172 }
173 
174 
175 inline
177 {
178  return x_GetSeq_align().GetDim();
179 }
180 
181 
182 inline
184 {
185  return x_GetSeq_align().IsSetScore();
186 }
187 
188 
189 inline
191 {
192  return x_GetSeq_align().GetScore();
193 }
194 
195 
196 inline
198 {
199  return x_GetSeq_align().GetSegs();
200 }
201 
202 
203 inline
205 {
206  return x_GetSeq_align().IsSetBounds();
207 }
208 
209 
210 inline
212 {
213  return x_GetSeq_align().GetBounds();
214 }
215 
216 
217 /* @} */
218 
219 
222 
223 #endif // SEQ_ALIGN_HANDLE__HPP
CAlign_CI –.
Definition: align_ci.hpp:63
CScope –.
Definition: scope.hpp:92
CSeq_annot_Handle –.
CSeq_annot_Handle m_Annot
CScope & GetScope(void) const
Get scope this handle belongs to.
bool IsSetBounds(void) const
DECLARE_OPERATOR_BOOL(m_Annot &&m_AnnotIndex !=eNull &&!IsRemoved())
const CSeq_align::TSegs & GetSegs(void) const
CSeq_align::TDim GetDim(void) const
bool IsSetScore(void) const
const CSeq_align & x_GetSeq_align(void) const
const CSeq_align::TBounds & GetBounds(void) const
CSeq_align::EType GetType(void) const
bool IsSetDim(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to the seq-annot.
const CSeq_align::TScore & GetScore(void) const
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
#define kMax_I4
Definition: ncbi_limits.h:218
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_XOBJMGR_EXPORT
Definition: ncbi_export.h:1307
bool IsSetBounds(void) const
regions of sequence over which align was computed Check if a value has been assigned to Bounds data m...
Definition: Seq_align_.hpp:939
vector< CRef< CScore > > TScore
Definition: Seq_align_.hpp:398
TDim GetDim(void) const
Get the Dim member data.
Definition: Seq_align_.hpp:856
list< CRef< CSeq_loc > > TBounds
Definition: Seq_align_.hpp:400
TType GetType(void) const
Get the Type member data.
Definition: Seq_align_.hpp:809
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
Definition: Seq_align_.hpp:837
bool IsSetScore(void) const
for whole alignment Check if a value has been assigned to Score data member.
Definition: Seq_align_.hpp:884
const TScore & GetScore(void) const
Get the Score member data.
Definition: Seq_align_.hpp:896
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
const TBounds & GetBounds(void) const
Get the Bounds member data.
Definition: Seq_align_.hpp:951
CMapControl::TIndex TIndex
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
CScope & GetScope()
Modified on Sun Apr 21 03:42:52 2024 by modify_doxy.py rev. 669887