1 /* $Id: Packed_seqpnt.hpp 103491 2007-05-04 17:18:18Z kazimird $
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: .......
27 *
28 * File Description:
29 * .......
30 *
31 * Remark:
32 * This code was originally generated by application DATATOOL
33 * using specifications from the ASN data definition file
34 * 'seqloc.asn'.
35 */
36
37 #ifndef OBJECTS_SEQLOC_PACKED_SEQPNT_HPP
38 #define OBJECTS_SEQLOC_PACKED_SEQPNT_HPP
39
40
41 // generated includes
42 #include <objects/seqloc/Packed_seqpnt_.hpp>
43
44 // generated classes
45
46 BEGIN_NCBI_SCOPE
47
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49
50 class NCBI_SEQLOC_EXPORT CPacked_seqpnt : public CPacked_seqpnt_Base
51 {
52 typedef CPacked_seqpnt_Base Tparent;
53 public:
54 //
55 // See CPacked_seqpnt related function in util/sequence.hpp:
56 //
57 // bool IsValid(const CPacked_seqpnt&, CScope*);
58 //
59
60 // constructor
61 CPacked_seqpnt(void);
62 CPacked_seqpnt(TId& id, const TPoints& points, TStrand strand = eNa_strand_unknown);
63
64 // destructor
65 ~CPacked_seqpnt(void);
66
67 // check start or stop end of location for e_Lim fuzz
68 bool IsPartialStart(ESeqLocExtremes ext) const;
69 bool IsPartialStop (ESeqLocExtremes ext) const;
70
71 // set / remove e_Lim fuzz on start or stop end
72 void SetPartialStart(bool val, ESeqLocExtremes ext);
73 void SetPartialStop (bool val, ESeqLocExtremes ext);
74
75 /// check if parts of the seq-loc are missing
76 bool IsTruncatedStart(ESeqLocExtremes ext) const;
77 bool IsTruncatedStop (ESeqLocExtremes ext) const;
78
79 /// set / remove e_Lim fuzz on start or stop
80 /// (tl/tr - indicating removed parts of the seq-loc)
81 void SetTruncatedStart(bool val, ESeqLocExtremes ext);
82 void SetTruncatedStop (bool val, ESeqLocExtremes ext);
83
84 // Add a point to the collection.
85 void AddPoint(TSeqPos point);
86 void AddPoints(const TPoints& points);
87
88 TSeqPos GetStart(ESeqLocExtremes ext) const;
89 TSeqPos GetStop (ESeqLocExtremes ext) const;
90
91 // Flip the strand (e.g. plus to minus)
92 void FlipStrand(void);
93
94 private:
95 // Prohibit copy constructor and assignment operator
96 CPacked_seqpnt(const CPacked_seqpnt& value);
97 CPacked_seqpnt& operator=(const CPacked_seqpnt& value);
98
99 bool x_IsMinusStrand(void) const;
100 };
101
102
103
104 /////////////////// CPacked_seqpnt inline methods
105
106 // constructor
107 inline
CPacked_seqpnt(void)108 CPacked_seqpnt::CPacked_seqpnt(void)
109 {
110 }
111
112
113 inline
CPacked_seqpnt(TId & id,const TPoints & points,TStrand strand)114 CPacked_seqpnt::CPacked_seqpnt(TId& id, const TPoints& points, TStrand strand)
115 {
116 SetId(id);
117 copy(points.begin(), points.end(), back_inserter(SetPoints()));
118 if ( strand != eNa_strand_unknown ) {
119 SetStrand(strand);
120 }
121 }
122
123
124 inline
AddPoint(TSeqPos point)125 void CPacked_seqpnt::AddPoint(TSeqPos point)
126 {
127 SetPoints().push_back(point);
128 }
129
130
131 inline
AddPoints(const TPoints & points)132 void CPacked_seqpnt::AddPoints(const TPoints& points)
133 {
134 copy(points.begin(), points.end(), back_inserter(SetPoints()));
135 }
136
137
138 /////////////////// end of CPacked_seqpnt inline methods
139
140
141 END_objects_SCOPE // namespace ncbi::objects::
142
143 END_NCBI_SCOPE
144
145
146 #endif // OBJECTS_SEQLOC_PACKED_SEQPNT_HPP
147 /* Original file checksum: lines: 90, chars: 2468, CRC32: e995f3e6 */
148