-
Notifications
You must be signed in to change notification settings - Fork 2
/
RNA.h
145 lines (124 loc) · 5.26 KB
/
RNA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// std::vector<Cartridge2>.h: interface for the RNA class.
//
//////////////////////////////////////////////////////////////////////
#ifndef RNA_H
#define RNA_H
#include <vector>
#include <iterator>
#include "Cartridge2.h"
#include "CartridgeFinder.h"
#include "TxtFile.h"
#include "debugFile.h"
class RNA
{
std::vector<Cartridge2> m_CarChain2;
CString m_desktopPath;
//建解構子
public:
RNA();
virtual ~RNA();
//完全不像vector的操作
public:
// std::vector<Cartridge2>::size_type StdInit();
// std::vector<Cartridge2>::size_type GammaInit();
// void DelCell(std::vector<Cartridge2>::size_type index){ m_CarChain2.erase(&m_CarChain2.at(index)); };
void CutEqualCell(const RNA& );
// void CutEqualCell(std::vector<Cartridge2> );
// void Grow(ColorType ct, PointNum pn);
void DeleteEmptyCell();
// void SetBolt(Bolt *_P){ p_Pusher = _P; };
// Bolt* GetBolt(){ return p_Pusher; };
//像vector的函數,卻不是直接回傳
public:
// Cartridge2& At (ColorType, PointNum, UINT );
// const Cartridge2& At (ColorType, PointNum, UINT )const ;
std::vector<int>::size_type HaveSeveral(const CString& color = "", const CString& ptTotal = "",
const CString& mrIndex = "", const CString& fePara = "");
float fFind(const CString&, const CString&, const CString&, const CString&, const ValueKind&);
CString sFind(const CString&, const CString&, const CString&, const CString&, const ValueKind&);
#ifdef _DEBUG
public:
float fFind(const CString&, const int& , const CString&, const CString&, const ValueKind&);
CString sFind(const CString&, const int& , const CString&, const CString&, const ValueKind&);
float fFind(const CString&, const CString&, const int& , const CString&, const ValueKind&);
CString sFind(const CString&, const CString&, const int& , const CString&, const ValueKind&);
float fFind(const CString&, const int& , const int& , const CString&, const ValueKind&);
CString sFind(const CString&, const int& , const int& , const CString&, const ValueKind&);
private:
void paraError();
#endif
public:
Cartridge2& Find(const CString&, const CString&, const CString&, const CString&);
Cartridge2& Find(const CString&);
public:
void Empty();
const BOOL IsEmpty() const;
//不管名字像不像直接由vector 回傳
public:
// Cartridge2& At(Cartridge2);
// const Cartridge2& At(const Cartridge2&) const;
// Cartridge2& At(std::vector<Cartridge2>::size_type _P) { return m_CarChain2.at(_P); };
const Cartridge2& At(const std::vector<Cartridge2>::size_type& _P) const;
std::vector<Cartridge2>::iterator Begin();
std::vector<Cartridge2>::const_iterator Begin() const; //using by CutEqualCell(const RNA)
std::vector<Cartridge2>::iterator End();
std::vector<Cartridge2>::const_iterator End() const; //using by CutEqualCell(const RNA)
const std::vector<Cartridge2>::size_type Size() const;
//
// std::vector<Cartridge2>& operator=(const std::vector<Cartridge2>&);
// void AddCell( std::vector<Cartridge2>::const_iterator& _F,
// std::vector<Cartridge2>::const_iterator& _L );
void AddCell(const RNA&);
void AddCell(const Cartridge2& _X);
//sorting
public:
void SortQuackMsr();
void SortOrigMsr();
private:
static bool areaPriority(const Cartridge2 &sp1, const Cartridge2 &sp2);
static bool origPriority(const Cartridge2 &sp1, const Cartridge2 &sp2);
// void SortQuackMsr(std::vector<Cartridge2>& vCar) const;
// void SortOrigMsr (std::vector<Cartridge2>& vCar) const;
//operator
public:
void operator+=(const RNA& _R);
void operator+=(const Cartridge2& _X);
// void operator+=( RNA& _X) { AddCell(m_CarChain2.end(), _X.Begin(), _X.End()); };
////
//debug
// public:
// std::vector<CString> InsideData();
private:
CartridgeFinder finder;
private:
// const int reconstrColor(CString&);
// const int reconstrPointNum(CString&);
// const int reconstrMsrNo(CString&);
private:
debugFile debugLogMaker;
};
inline const BOOL RNA::IsEmpty() const
{ return (m_CarChain2.size() <= 1) ? TRUE : FALSE; };
//inline void RNA::AddCell(std::vector<Cartridge2>::const_iterator& _F,
// std::vector<Cartridge2>::const_iterator& _L)
//{ m_CarChain2.insert(End(), _F, _L); };
inline void RNA::AddCell(const RNA& _R)
{ m_CarChain2.insert(End(), _R.Begin(), _R.End()); }
inline void RNA::AddCell(const Cartridge2& _X)
{ m_CarChain2.push_back(_X); };
inline std::vector<Cartridge2>::iterator RNA::Begin()
{ return (m_CarChain2.size() <= 1) ? m_CarChain2.end() : m_CarChain2.begin() +1; }
inline std::vector<Cartridge2>::iterator RNA::End()
{ return m_CarChain2.end();};
//Just for coonst RNA
inline std::vector<Cartridge2>::const_iterator RNA::Begin() const
{ return (m_CarChain2.size() <= 1) ? m_CarChain2.end() : m_CarChain2.begin() +1; }
inline std::vector<Cartridge2>::const_iterator RNA::End() const
{ return m_CarChain2.end();};
inline const std::vector<Cartridge2>::size_type RNA::Size () const
{ return m_CarChain2.size()-1; };
inline void RNA::operator+=(const RNA& _R)
{ AddCell(_R); };
inline void RNA::operator+=(const Cartridge2& _X)
{ AddCell(_X); };
#endif // !defined(AFX_std::vector<Cartridge2>_H__0108A325_5755_4826_B203_49A50707E9EF__INCLUDED_)