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

Go to the SVN repository for this file.

1 #ifndef NCBI_OBJMGR_SPLIT_ID_RANGE__HPP
2 #define NCBI_OBJMGR_SPLIT_ID_RANGE__HPP
3 
4 /* $Id: id_range.hpp 87845 2019-10-10 16:05:19Z 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: Eugene Vasilchenko
30 *
31 * File Description:
32 * Utility class for collecting ranges of sequences
33 *
34 * ===========================================================================
35 */
36 
37 
38 #include <corelib/ncbistd.hpp>
39 
41 #include <util/range.hpp>
42 
43 #include <map>
44 
46 
47 class CObjectOStream;
48 
50 
51 class CSeq_feat;
52 class CSeq_align;
53 class CSeq_graph;
54 class CSeq_loc;
55 class CSeq_id;
56 class CSeq_point;
57 class CSeq_interval;
58 class CPacked_seqpnt;
59 class CDense_seg;
60 class CDense_diag;
61 class CPacked_seg;
62 class CSpliced_seg;
63 class CSparse_seg;
64 class CSeq_table;
65 class CSeqTableInfo;
67 class CHandleRange;
68 class CHandleRangeMap;
69 class CBlobSplitterImpl;
70 
72 {
73 public:
75 
77  : m_TotalRange(TRange::GetEmpty())
78  {
79  }
80 
81  TRange GetTotalRange(void) const
82  {
83  return m_TotalRange;
84  }
85 
86  void Add(const COneSeqRange& range);
87  void Add(const TRange& range);
88  void Add(TSeqPos start, TSeqPos stop_exclusive);
89  void Add(const CHandleRange& hr);
90 
91 private:
93 };
94 
95 
97 {
98 public:
99  CSeqsRange(void);
100  ~CSeqsRange(void);
101 
103 
107 
108  const_iterator begin(void) const
109  {
110  return m_Ranges.begin();
111  }
112  const_iterator end(void) const
113  {
114  return m_Ranges.end();
115  }
116 
117  size_t size(void) const
118  {
119  return m_Ranges.size();
120  }
121  bool empty(void) const
122  {
123  return m_Ranges.empty();
124  }
125  void clear(void)
126  {
127  m_Ranges.clear();
128  }
129 
130  CSeq_id_Handle GetSingleId(void) const;
131 
132  void Add(const CSeq_id_Handle& id, const COneSeqRange& loc);
133  void Add(const CSeq_id_Handle& id, const TRange& range);
134  void Add(const CSeqsRange& seqs_range);
135  void Add(const CHandleRangeMap& hrmap);
136 
137  void Add(const CSeq_loc& loc, const CBlobSplitterImpl& impl);
138  void Add(const CSeq_feat& obj, const CBlobSplitterImpl& impl);
139  void Add(const CSeq_align& obj, const CBlobSplitterImpl& impl);
140  void Add(const CSeq_graph& obj, const CBlobSplitterImpl& impl);
141  void Add(const CDense_seg& denseg, const CBlobSplitterImpl& impl);
142  void Add(const CDense_diag& diag, const CBlobSplitterImpl& impl);
143  void Add(const CPacked_seg& packed, const CBlobSplitterImpl& impl);
144  void Add(const CSpliced_seg& spliced, const CBlobSplitterImpl& impl);
145  void Add(const CSparse_seg& sparse, const CBlobSplitterImpl& impl);
146  void Add(const CSeq_table& table, const CBlobSplitterImpl& impl);
147  void Add(const CSeqTableLocColumns& loc, const CSeq_table& table,
148  const CBlobSplitterImpl& impl);
149 
150  int Compare(const CSeqsRange& other) const;
151 
152 private:
154 };
155 
156 
157 inline
159 {
160  return info.Print(out);
161 }
162 
163 
166 
167 #endif//NCBI_OBJMGR_SPLIT_ID_RANGE__HPP
CObjectOStream –.
Definition: objostr.hpp:83
CRange< TSeqPos > TRange
Definition: id_range.hpp:74
COneSeqRange(void)
Definition: id_range.hpp:76
TRange m_TotalRange
Definition: id_range.hpp:92
void Add(const COneSeqRange &range)
Definition: id_range.cpp:71
TRange GetTotalRange(void) const
Definition: id_range.hpp:81
CPacked_seg –.
Definition: Packed_seg.hpp:66
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
~CSeqsRange(void)
Definition: id_range.cpp:100
const_iterator end(void) const
Definition: id_range.hpp:112
CSeq_id_Handle GetSingleId(void) const
Definition: id_range.cpp:121
void clear(void)
Definition: id_range.hpp:125
COneSeqRange::TRange TRange
Definition: id_range.hpp:104
CSeqsRange(void)
Definition: id_range.cpp:95
TRanges::const_iterator const_iterator
Definition: id_range.hpp:106
TRanges m_Ranges
Definition: id_range.hpp:153
bool empty(void) const
Definition: id_range.hpp:121
size_t size(void) const
Definition: id_range.hpp:117
CNcbiOstream & Print(CNcbiOstream &out) const
Definition: id_range.cpp:105
int Compare(const CSeqsRange &other) const
Definition: id_range.cpp:418
map< CSeq_id_Handle, COneSeqRange > TRanges
Definition: id_range.hpp:105
void Add(const CSeq_id_Handle &id, const COneSeqRange &loc)
Definition: id_range.cpp:131
const_iterator begin(void) const
Definition: id_range.hpp:108
size_type size() const
Definition: map.hpp:148
const_iterator begin() const
Definition: map.hpp:151
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
void clear()
Definition: map.hpp:169
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#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
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
CNcbiOstream & operator<<(CNcbiOstream &out, const CSeqsRange &info)
Definition: id_range.hpp:158
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
Modified on Tue Apr 23 07:40:30 2024 by modify_doxy.py rev. 669887