NCBI C++ ToolKit
annot_ci.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: annot_ci.cpp 42022 2009-05-29 17:09:42Z vasilche $
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 * Author: Aleksey Grichenko, Eugene Vasilchenko
27 *
28 * File Description:
29 * Object manager iterators
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
34 #include <objmgr/annot_ci.hpp>
38 
41 
42 
43 
45 {
46 }
47 
48 
50  : m_SeqAnnotSet(iter.m_SeqAnnotSet),
51  m_Iterator(iter? m_SeqAnnotSet.find(*iter): m_SeqAnnotSet.end())
52 {
53 }
54 
55 
57 {
60  scope, loc,
62  .SetNoMapping(true)
63  .SetCollectSeq_annots(true)
64  .SetSortOrder(SAnnotSelector::eSortOrder_None)));
65 }
66 
67 
69  const SAnnotSelector& sel)
70 {
73  scope, loc,
74  &SAnnotSelector(sel)
75  .SetNoMapping(true)
76  .SetCollectSeq_annots(true)
77  .SetSortOrder(SAnnotSelector::eSortOrder_None)));
78 }
79 
80 
82 {
85  bioseq,
89  .SetNoMapping(true)
90  .SetCollectSeq_annots(true)
91  .SetSortOrder(SAnnotSelector::eSortOrder_None)));
92 }
93 
94 
96  const SAnnotSelector& sel)
97 {
100  bioseq,
103  &SAnnotSelector(sel)
104  .SetNoMapping(true)
105  .SetCollectSeq_annots(true)
106  .SetSortOrder(SAnnotSelector::eSortOrder_None)));
107 }
108 
109 
111  const SAnnotSelector& sel)
112 {
113  x_Initialize(
115  entry,
116  &SAnnotSelector(sel)
117  .SetNoMapping(true)
118  .SetCollectSeq_annots(true)
119  .SetSortOrder(SAnnotSelector::eSortOrder_None)));
120 }
121 
122 
124 {
125  x_Initialize(iter);
126 }
127 
128 
130 {
131 }
132 
133 
135 {
136  if ( this != &iter ) {
138  m_Iterator = iter? m_SeqAnnotSet.find(*iter): m_SeqAnnotSet.end();
139  }
140  return *this;
141 }
142 
143 
145 {
148  m_SeqAnnotSet.insert(it->GetSeq_annot_Handle());
149  }
150  /*
151  if ( iter.m_DataCollector->m_FirstAnnotLock ) {
152  m_SeqAnnotSet.insert(iter.m_DataCollector->m_FirstAnnotLock);
153  ITERATE ( CAnnot_Collector::TAnnotLocks, it,
154  iter.m_DataCollector->m_AnnotLocks ) {
155  m_SeqAnnotSet.insert(*it);
156  }
157  }
158  */
159  Rewind();
160 }
161 
162 
CRef< CAnnot_Collector > m_DataCollector
CAnnot_CI –.
Definition: annot_ci.hpp:59
vector< CAnnotObject_Ref > TAnnotSet
CBioseq_Handle –.
CRange –.
Definition: Range.hpp:68
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
bool empty() const
Definition: set.hpp:133
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
virtual ~CAnnot_CI(void)
Definition: annot_ci.cpp:129
TSeqAnnotSet m_SeqAnnotSet
Definition: annot_ci.hpp:140
CAnnot_CI & operator=(const CAnnot_CI &iter)
Definition: annot_ci.cpp:134
void x_Initialize(const CAnnotTypes_CI &iter)
Definition: annot_ci.cpp:144
CAnnot_CI(void)
Create an empty iterator.
Definition: annot_ci.cpp:44
TIterator m_Iterator
Definition: annot_ci.hpp:141
void Rewind(void)
Definition: annot_ci.hpp:201
@ eSortOrder_None
do not sort annotations for faster retrieval
#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
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
@ e_not_set
No variant selected.
Definition: Seq_annot_.hpp:132
SAnnotSelector –.
#define _ASSERT
Modified on Fri Jul 19 17:09:30 2024 by modify_doxy.py rev. 669887