/src/aspell/common/vector.hpp
Line | Count | Source |
1 | | // This file is part of The New Aspell |
2 | | // Copyright (C) 2001-2003 by Kevin Atkinson under the GNU LGPL license |
3 | | // version 2.0 or 2.1. You should have received a copy of the LGPL |
4 | | // license along with this library if you did not you can find |
5 | | // it at http://www.gnu.org/. |
6 | | |
7 | | #ifndef ASPELL_VECTOR__HPP |
8 | | #define ASPELL_VECTOR__HPP |
9 | | |
10 | | #include <vector> |
11 | | |
12 | | namespace acommon |
13 | | { |
14 | | template <typename T> |
15 | | class Vector : public std::vector<T> |
16 | | { |
17 | | public: |
18 | | |
19 | 195k | Vector() {} acommon::Vector<acommon::FilterChar>::Vector() Line | Count | Source | 19 | 80.2k | Vector() {} |
acommon::Vector<acommon::Notifier*>::Vector() Line | Count | Source | 19 | 3.55k | Vector() {} |
acommon::Vector<acommon::ConfigModule>::Vector() Line | Count | Source | 19 | 3.55k | Vector() {} |
acommon::Vector<acommon::Cacheable*>::Vector() Line | Count | Source | 19 | 3.55k | Vector() {} |
acommon::Vector<acommon::NormTables::ToUniTable>::Vector() Line | Count | Source | 19 | 1.02k | Vector() {} |
acommon::Vector<acommon::IndividualFilter*>::Vector() Line | Count | Source | 19 | 14.0k | Vector() {} |
acommon::Vector<acommon::KeyInfo>::Vector() Line | Count | Source | 19 | 5.38k | Vector() {} |
acommon::Vector<acommon::String>::Vector() Line | Count | Source | 19 | 4.71k | Vector() {} |
acommon::Vector<acommon::FilterMode>::Vector() Line | Count | Source | 19 | 2.65k | Vector() {} |
acommon::Vector<acommon::FilterMode::MagicString>::Vector() Line | Count | Source | 19 | 4.66k | Vector() {} |
acommon::Vector<acommon::FilterMode::KeyValue>::Vector() Line | Count | Source | 19 | 4.66k | Vector() {} |
acommon::Vector<unsigned int>::Vector() Line | Count | Source | 19 | 34 | Vector() {} |
tex.cpp:acommon::Vector<(anonymous namespace)::TexFilter::Command>::Vector() Line | Count | Source | 19 | 30 | Vector() {} |
texinfo.cpp:acommon::Vector<(anonymous namespace)::TexInfoFilter::Command>::Vector() Line | Count | Source | 19 | 125 | Vector() {} |
texinfo.cpp:acommon::Vector<(anonymous namespace)::TexInfoFilter::Table>::Vector() Line | Count | Source | 19 | 125 | Vector() {} |
acommon::Vector<acommon::DictExt>::Vector() Line | Count | Source | 19 | 28.9k | Vector() {} |
acommon::Vector<aspeller::Dictionary*>::Vector() Line | Count | Source | 19 | 3.28k | Vector() {} |
acommon::Vector<aspeller::Dictionary const*>::Vector() Line | Count | Source | 19 | 4.50k | Vector() {} |
acommon::Vector<aspeller::SpellerDict*>::Vector() Line | Count | Source | 19 | 1.07k | Vector() {} |
acommon::Vector<aspeller::SuggestRepl>::Vector() Line | Count | Source | 19 | 1.09k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::Suggestion>::Vector() Line | Count | Source | 19 | 2.15k | Vector() {} |
acommon::Vector<acommon::ObjStack::Node*>::Vector() Line | Count | Source | 19 | 2.15k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::Working*>::Vector() Line | Count | Source | 19 | 18.1k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::ReplTry>::Vector() Line | Count | Source | 19 | 2.48k | Vector() {} |
acommon::Vector<char const*>::Vector() Line | Count | Source | 19 | 2.48k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::NGramScore>::Vector() Line | Count | Source | 19 | 17 | Vector() {} |
acommon::Vector<aspeller::CharPair>::Vector() Line | Count | Source | 19 | 1.07k | Vector() {} |
Unexecuted instantiation: acommon::Vector<aspeller::WordAff>::Vector() Unexecuted instantiation: readonly_ws.cpp:acommon::Vector<(anonymous namespace)::Jump>::Vector() |
20 | | Vector(unsigned int s) : std::vector<T>(s) {} |
21 | | Vector(unsigned int s, const T & val) : std::vector<T>(s, val) {} |
22 | | |
23 | 103M | void append(T t) { |
24 | 103M | this->push_back(t); |
25 | 103M | } acommon::Vector<acommon::FilterChar>::append(acommon::FilterChar) Line | Count | Source | 23 | 103M | void append(T t) { | 24 | 103M | this->push_back(t); | 25 | 103M | } |
acommon::Vector<acommon::DictExt>::append(acommon::DictExt) Line | Count | Source | 23 | 699 | void append(T t) { | 24 | 699 | this->push_back(t); | 25 | 699 | } |
|
26 | 0 | void append(const T * begin, unsigned int size) { |
27 | 0 | this->insert(this->end(), begin, begin+size); |
28 | 0 | } |
29 | | void append(const T * begin, const T * end) { |
30 | | this->insert(this->end(), begin, end); |
31 | | } |
32 | | int alloc(int s) { |
33 | | int pos = this->size(); |
34 | | this->resize(pos + s); |
35 | | return pos; |
36 | | } |
37 | | |
38 | | #if __cplusplus < 201103L |
39 | | T * data() {return &*this->begin();} |
40 | | const T * data() const {return &*this->begin();} |
41 | | #else |
42 | | using std::vector<T>::data; |
43 | | #endif |
44 | | |
45 | | T * data(int pos) {return data() + pos;} |
46 | | T * data_end() {return data() + this->size();} |
47 | | |
48 | 1.06M | T * pbegin() {return data();} acommon::Vector<acommon::FilterChar>::pbegin() Line | Count | Source | 48 | 1.04M | T * pbegin() {return data();} |
acommon::Vector<acommon::ConfigModule>::pbegin() Line | Count | Source | 48 | 5.38k | T * pbegin() {return data();} |
Unexecuted instantiation: acommon::Vector<acommon::KeyInfo>::pbegin() acommon::Vector<unsigned int>::pbegin() Line | Count | Source | 48 | 7.73k | T * pbegin() {return data();} |
acommon::Vector<char const*>::pbegin() Line | Count | Source | 48 | 2.48k | T * pbegin() {return data();} |
|
49 | 1.11M | T * pend() {return data() + this->size();} acommon::Vector<acommon::FilterChar>::pend() Line | Count | Source | 49 | 1.04M | T * pend() {return data() + this->size();} |
acommon::Vector<acommon::ConfigModule>::pend() Line | Count | Source | 49 | 53.8k | T * pend() {return data() + this->size();} |
Unexecuted instantiation: acommon::Vector<acommon::KeyInfo>::pend() acommon::Vector<unsigned int>::pend() Line | Count | Source | 49 | 7.73k | T * pend() {return data() + this->size();} |
acommon::Vector<char const*>::pend() Line | Count | Source | 49 | 2.48k | T * pend() {return data() + this->size();} |
|
50 | | |
51 | 32.6k | const T * pbegin() const {return data();} acommon::Vector<acommon::ConfigModule>::pbegin() const Line | Count | Source | 51 | 30.1k | const T * pbegin() const {return data();} |
acommon::Vector<aspeller::SuggestRepl>::pbegin() const Line | Count | Source | 51 | 2.48k | const T * pbegin() const {return data();} |
Unexecuted instantiation: acommon::Vector<char const*>::pbegin() const |
52 | 82.3k | const T * pend() const {return data() + this->size();} acommon::Vector<acommon::ConfigModule>::pend() const Line | Count | Source | 52 | 79.8k | const T * pend() const {return data() + this->size();} |
acommon::Vector<aspeller::SuggestRepl>::pend() const Line | Count | Source | 52 | 2.48k | const T * pend() const {return data() + this->size();} |
Unexecuted instantiation: acommon::Vector<char const*>::pend() const |
53 | | |
54 | | template <typename U> |
55 | | U * datap() { |
56 | | return reinterpret_cast<U * >(data()); |
57 | | } |
58 | | template <typename U> |
59 | | U * datap(int pos) { |
60 | | return reinterpret_cast<U * >(data() + pos); |
61 | | } |
62 | | |
63 | | void pop_front() {this->erase(this->begin());} |
64 | | void push_front(const T & v) {this->insert(this->begin(), v);} |
65 | | }; |
66 | | } |
67 | | |
68 | | #endif |