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

Go to the SVN repository for this file.

1 #ifndef OBJTOOLS_FORMAT_ITEMS___GAP_ITEM__HPP
2 #define OBJTOOLS_FORMAT_ITEMS___GAP_ITEM__HPP
3 
4 /* $Id: gap_item.hpp 100571 2023-08-11 13:06:42Z gotvyans $
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: Mati Shomrat
30 *
31 * File Description:
32 * Indicate a gap region on a bioseq
33 *
34 *
35 */
36 #include <corelib/ncbistd.hpp>
38 
39 
42 
43 
44 class CBioseqContext;
45 class IFormatter;
46 
47 
48 ///////////////////////////////////////////////////////////////////////////
49 //
50 // SEQUENCE
51 
53 {
54 public:
55 
56  typedef std::vector<std::string> TEvidence;
57 
58  // constructors
60  const string &sFeatureName, // e.g. "gap" or "assembly_gap"
61  const string &sType,
62  const TEvidence &sEvidence,
63  TSeqPos estimated_length = kInvalidSeqPos // unknown length by default
64  );
65 
66  void Format(IFormatter& formatter, IFlatTextOStream& text_os) const override;
67 
68  TSeqPos GetFrom(void) const;
69  TSeqPos GetTo(void) const;
70 
71  const std::string & GetFeatureName(void) const;
72 
73  bool HasType() const;
74  const std::string & GetType(void) const;
75 
76  bool HasEvidence() const;
77  const TEvidence & GetEvidence(void) const;
78 
79  bool HasEstimatedLength(void) const;
80  TSeqPos GetEstimatedLength(void) const;
81 
82  EItem GetItemType() const override;
83 private:
84  void x_GatherInfo(CBioseqContext& /*ctx*/) override {}
85 
86  // data
87  TSeqPos m_From, m_To;
92 };
93 
94 
95 //===========================================================================
96 // inline methods
97 //===========================================================================
98 
99 inline
101 {
102  return m_From;
103 }
104 
105 inline
107 {
108  return m_To;
109 }
110 
111 inline
113 {
114  return m_sFeatureName;
115 }
116 
117 inline
118 bool CGapItem::HasType() const
119 {
120  return ! m_sType.empty();
121 }
122 
123 inline
124 const std::string & CGapItem::GetType(void) const
125 {
126  return m_sType;
127 }
128 
129 inline
131 {
132  return ! m_sEvidence.empty();
133 }
134 
135 inline
137 {
138  return m_sEvidence;
139 }
140 
141 inline
143 {
145 }
146 
147 inline
149 {
150  return m_EstimatedLength;
151 }
152 
155 
156 #endif /* OBJTOOLS_FORMAT_ITEMS___GAP_ITEM__HPP */
virtual void Format(IFormatter &formatter, IFlatTextOStream &text_os) const =0
TSeqPos GetTo(void) const
Definition: gap_item.hpp:106
bool HasType() const
Definition: gap_item.hpp:118
TSeqPos m_EstimatedLength
Definition: gap_item.hpp:88
TSeqPos GetEstimatedLength(void) const
Definition: gap_item.hpp:148
TEvidence m_sEvidence
Definition: gap_item.hpp:91
bool HasEvidence() const
Definition: gap_item.hpp:130
TSeqPos GetFrom(void) const
Definition: gap_item.hpp:100
std::vector< std::string > TEvidence
Definition: gap_item.hpp:56
TSeqPos m_To
Definition: gap_item.hpp:87
const std::string & GetType(void) const
Definition: gap_item.hpp:124
std::string m_sType
Definition: gap_item.hpp:90
TSeqPos m_From
Definition: gap_item.hpp:87
void x_GatherInfo(CBioseqContext &) override
Definition: gap_item.hpp:84
bool HasEstimatedLength(void) const
Definition: gap_item.hpp:142
std::string m_sFeatureName
Definition: gap_item.hpp:89
const TEvidence & GetEvidence(void) const
Definition: gap_item.hpp:136
const std::string & GetFeatureName(void) const
Definition: gap_item.hpp:112
virtual EItem GetItemType(void) const =0
Include a standard set of the NCBI C++ Toolkit most basic headers.
CS_CONTEXT * ctx
Definition: t0006.c:12
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
string
Definition: cgiapp.hpp:687
#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_FORMAT_EXPORT
Definition: ncbi_export.h:496
Modified on Thu May 02 14:35:41 2024 by modify_doxy.py rev. 669887