/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 | 200k | Vector() {}acommon::Vector<acommon::FilterChar>::Vector() Line | Count | Source | 19 | 112k | Vector() {} |
acommon::Vector<acommon::Notifier*>::Vector() Line | Count | Source | 19 | 3.06k | Vector() {} |
acommon::Vector<acommon::ConfigModule>::Vector() Line | Count | Source | 19 | 3.06k | Vector() {} |
acommon::Vector<acommon::Cacheable*>::Vector() Line | Count | Source | 19 | 3.06k | Vector() {} |
acommon::Vector<acommon::NormTables::ToUniTable>::Vector() Line | Count | Source | 19 | 878 | Vector() {} |
acommon::Vector<acommon::IndividualFilter*>::Vector() Line | Count | Source | 19 | 12.1k | Vector() {} |
acommon::Vector<acommon::KeyInfo>::Vector() Line | Count | Source | 19 | 4.75k | Vector() {} |
acommon::Vector<acommon::String>::Vector() Line | Count | Source | 19 | 1.69k | Vector() {} |
acommon::Vector<acommon::FilterMode>::Vector() Line | Count | Source | 19 | 2.23k | Vector() {} |
acommon::Vector<acommon::FilterMode::MagicString>::Vector() Line | Count | Source | 19 | 1.63k | Vector() {} |
acommon::Vector<acommon::FilterMode::KeyValue>::Vector() Line | Count | Source | 19 | 1.63k | Vector() {} |
acommon::Vector<unsigned int>::Vector() Line | Count | Source | 19 | 54 | Vector() {} |
tex.cpp:acommon::Vector<(anonymous namespace)::TexFilter::Command>::Vector() Line | Count | Source | 19 | 25 | Vector() {} |
texinfo.cpp:acommon::Vector<(anonymous namespace)::TexInfoFilter::Command>::Vector() Line | Count | Source | 19 | 132 | Vector() {} |
texinfo.cpp:acommon::Vector<(anonymous namespace)::TexInfoFilter::Table>::Vector() Line | Count | Source | 19 | 132 | Vector() {} |
acommon::Vector<acommon::DictExt>::Vector() Line | Count | Source | 19 | 18.9k | Vector() {} |
acommon::Vector<aspeller::Dictionary*>::Vector() Line | Count | Source | 19 | 2.78k | Vector() {} |
acommon::Vector<aspeller::Dictionary const*>::Vector() Line | Count | Source | 19 | 3.82k | Vector() {} |
acommon::Vector<aspeller::SpellerDict*>::Vector() Line | Count | Source | 19 | 937 | Vector() {} |
acommon::Vector<aspeller::SuggestRepl>::Vector() Line | Count | Source | 19 | 947 | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::Suggestion>::Vector() Line | Count | Source | 19 | 1.86k | Vector() {} |
acommon::Vector<acommon::ObjStack::Node*>::Vector() Line | Count | Source | 19 | 1.86k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::Working*>::Vector() Line | Count | Source | 19 | 16.6k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::ReplTry>::Vector() Line | Count | Source | 19 | 1.96k | Vector() {} |
acommon::Vector<char const*>::Vector() Line | Count | Source | 19 | 2.22k | Vector() {} |
suggest.cpp:acommon::Vector<(anonymous namespace)::NGramScore>::Vector() Line | Count | Source | 19 | 1 | Vector() {} |
acommon::Vector<aspeller::CharPair>::Vector() Line | Count | Source | 19 | 925 | 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 | 64.6M | void append(T t) { |
24 | 64.6M | this->push_back(t); |
25 | 64.6M | } acommon::Vector<acommon::FilterChar>::append(acommon::FilterChar) Line | Count | Source | 23 | 64.6M | void append(T t) { | 24 | 64.6M | this->push_back(t); | 25 | 64.6M | } |
acommon::Vector<acommon::DictExt>::append(acommon::DictExt) Line | Count | Source | 23 | 555 | void append(T t) { | 24 | 555 | this->push_back(t); | 25 | 555 | } |
|
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 | 841k | T * pbegin() {return data();}acommon::Vector<acommon::FilterChar>::pbegin() Line | Count | Source | 48 | 818k | T * pbegin() {return data();} |
acommon::Vector<acommon::ConfigModule>::pbegin() Line | Count | Source | 48 | 4.75k | T * pbegin() {return data();} |
Unexecuted instantiation: acommon::Vector<acommon::KeyInfo>::pbegin() acommon::Vector<unsigned int>::pbegin() Line | Count | Source | 48 | 16.1k | T * pbegin() {return data();} |
acommon::Vector<char const*>::pbegin() Line | Count | Source | 48 | 2.22k | T * pbegin() {return data();} |
|
49 | 884k | T * pend() {return data() + this->size();}acommon::Vector<acommon::FilterChar>::pend() Line | Count | Source | 49 | 818k | T * pend() {return data() + this->size();} |
acommon::Vector<acommon::ConfigModule>::pend() Line | Count | Source | 49 | 47.5k | T * pend() {return data() + this->size();} |
Unexecuted instantiation: acommon::Vector<acommon::KeyInfo>::pend() acommon::Vector<unsigned int>::pend() Line | Count | Source | 49 | 16.1k | T * pend() {return data() + this->size();} |
acommon::Vector<char const*>::pend() Line | Count | Source | 49 | 2.22k | T * pend() {return data() + this->size();} |
|
50 | | |
51 | 28.4k | const T * pbegin() const {return data();}acommon::Vector<acommon::ConfigModule>::pbegin() const Line | Count | Source | 51 | 26.4k | const T * pbegin() const {return data();} |
acommon::Vector<aspeller::SuggestRepl>::pbegin() const Line | Count | Source | 51 | 1.96k | const T * pbegin() const {return data();} |
Unexecuted instantiation: acommon::Vector<char const*>::pbegin() const |
52 | 71.8k | const T * pend() const {return data() + this->size();}acommon::Vector<acommon::ConfigModule>::pend() const Line | Count | Source | 52 | 69.8k | const T * pend() const {return data() + this->size();} |
acommon::Vector<aspeller::SuggestRepl>::pend() const Line | Count | Source | 52 | 1.96k | 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 |