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

Go to the SVN repository for this file.

1 #ifndef DESC_CI__HPP
2 #define DESC_CI__HPP
3 
4 /* $Id: seq_descr_ci.hpp 36009 2007-11-08 15:42:46Z vasilche $
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, Michael Kimelman
30 *
31 * File Description:
32 * Object manager iterators
33 *
34 */
35 
37 #include <objmgr/bioseq_handle.hpp>
41 #include <corelib/ncbistd.hpp>
42 
45 
46 
47 /** @addtogroup ObjectManagerIterators
48  *
49  * @{
50  */
51 
52 
53 class CBioseq_Handle;
54 class CSeqdesc_CI;
55 class CBioseq_Base_Info;
56 
57 /////////////////////////////////////////////////////////////////////////////
58 ///
59 /// CSeq_descr_CI --
60 ///
61 /// Enumerate CSeq_descr objects from a Bioseq or Seq-entry handle
62 ///
63 
65 {
66 public:
67  /// Create an empty iterator
68  CSeq_descr_CI(void);
69 
70  /// Create an iterator that enumerates CSeq_descr objects
71  /// from a bioseq with limit number of seq-entries
72  /// to "search_depth" (0 = unlimited).
73  explicit CSeq_descr_CI(const CBioseq_Handle& handle,
74  size_t search_depth = 0);
75 
76  /// Create an iterator that enumerates CSeq_descr objects
77  /// from a bioseq with limit number of seq-entries
78  /// to "search_depth" (0 = unlimited).
79  explicit CSeq_descr_CI(const CBioseq_set_Handle& handle,
80  size_t search_depth = 0);
81 
82  /// Create an iterator that enumerates CSeq_descr objects
83  /// from a seq-entry, limit number of seq-entries
84  /// to "search_depth" (0 = unlimited).
85  explicit CSeq_descr_CI(const CSeq_entry_Handle& entry,
86  size_t search_depth = 0);
87 
88  CSeq_descr_CI(const CSeq_descr_CI& iter);
89  ~CSeq_descr_CI(void);
90 
91  CSeq_descr_CI& operator= (const CSeq_descr_CI& iter);
92 
93  /// Move to the next object in iterated sequence
94  CSeq_descr_CI& operator++ (void);
95 
96  /// Check if iterator points to an object
97  DECLARE_OPERATOR_BOOL_REF(m_CurrentBase);
98 
99  const CSeq_descr& operator* (void) const;
100  const CSeq_descr* operator-> (void) const;
101 
103 
104 private:
105  friend class CSeqdesc_CI;
106 
107  // Move to the next entry containing a descriptor
108  void x_Next(void);
109  void x_Step(void);
110  void x_Settle(void);
111 
112  const CBioseq_Base_Info& x_GetBaseInfo(void) const;
113 
118 };
119 
120 
121 inline
123 {
124  x_Next();
125  return *this;
126 }
127 
128 
129 inline
131 {
132  return *m_CurrentBase;
133 }
134 
135 
136 inline
138 {
139  return x_GetBaseInfo().GetDescr();
140 }
141 
142 
143 inline
145 {
146  return &x_GetBaseInfo().GetDescr();
147 }
148 
149 
150 /* @} */
151 
152 
155 
156 #endif // DESC_CI__HPP
static CSeq_entry_Handle GetSeq_entry_Handle(TTypeInfo type, TConstObjectPtr ptr, CScope &scope)
const TDescr & GetDescr(void) const
CBioseq_Handle –.
CBioseq_set_Handle –.
CSeq_descr_CI –.
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
CSeq_entry_Handle –.
CSeqdesc_CI –.
Definition: seqdesc_ci.hpp:65
Include a standard set of the NCBI C++ Toolkit most basic headers.
CVect2< NCBI_PROMOTE(int,U) > operator*(int v1, const CVect2< U > &v2)
Definition: globals.hpp:371
const CBioseq_Base_Info & x_GetBaseInfo(void) const
size_t m_ParentLimit
void x_Next(void)
Definition: seqdesc_ci.cpp:297
CConstRef< CBioseq_Base_Info > m_CurrentBase
CBioseq_set_Handle m_CurrentSet
void x_Next(void)
CSeq_descr_CI & operator++(void)
Move to the next object in iterated sequence.
const CSeq_descr * operator->(void) const
CBioseq_Handle m_CurrentSeq
const CSeq_descr & operator*(void) const
DECLARE_OPERATOR_BOOL_REF(m_CurrentBase)
Check if iterator points to an object.
void x_Settle(void)
Definition: seqdesc_ci.cpp:260
const CBioseq_Base_Info & x_GetBaseInfo(void) const
Definition: seqdesc_ci.cpp:55
#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
Modified on Mon May 20 05:03:57 2024 by modify_doxy.py rev. 669887