summaryrefslogtreecommitdiffstats
path: root/base/memory
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 06:08:48 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 06:08:48 +0000
commitb8e1a10d44e6fc998e3c572868c09a097b351a59 (patch)
tree409560644c056019d528da35483a4f195df144b1 /base/memory
parent10e01dd51c3fce59f054866729f1e43162b7067d (diff)
downloadchromium_src-b8e1a10d44e6fc998e3c572868c09a097b351a59.zip
chromium_src-b8e1a10d44e6fc998e3c572868c09a097b351a59.tar.gz
chromium_src-b8e1a10d44e6fc998e3c572868c09a097b351a59.tar.bz2
base: Class member variables should be ended with trailing underscores.
Fix ScopedVector API to follow this style. http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Variable_Names#Variable_Names BUG=136196 R=willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/10796028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/memory')
-rw-r--r--base/memory/scoped_vector.h70
1 files changed, 35 insertions, 35 deletions
diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h
index 5470097..f41d781 100644
--- a/base/memory/scoped_vector.h
+++ b/base/memory/scoped_vector.h
@@ -41,84 +41,84 @@ class ScopedVector {
return *this;
}
- T*& operator[](size_t i) { return v[i]; }
- const T* operator[](size_t i) const { return v[i]; }
+ T*& operator[](size_t index) { return v_[index]; }
+ const T* operator[](size_t index) const { return v_[index]; }
- bool empty() const { return v.empty(); }
- size_t size() const { return v.size(); }
+ bool empty() const { return v_.empty(); }
+ size_t size() const { return v_.size(); }
- reverse_iterator rbegin() { return v.rbegin(); }
- const_reverse_iterator rbegin() const { return v.rbegin(); }
- reverse_iterator rend() { return v.rend(); }
- const_reverse_iterator rend() const { return v.rend(); }
+ reverse_iterator rbegin() { return v_.rbegin(); }
+ const_reverse_iterator rbegin() const { return v_.rbegin(); }
+ reverse_iterator rend() { return v_.rend(); }
+ const_reverse_iterator rend() const { return v_.rend(); }
- iterator begin() { return v.begin(); }
- const_iterator begin() const { return v.begin(); }
- iterator end() { return v.end(); }
- const_iterator end() const { return v.end(); }
+ iterator begin() { return v_.begin(); }
+ const_iterator begin() const { return v_.begin(); }
+ iterator end() { return v_.end(); }
+ const_iterator end() const { return v_.end(); }
- const_reference front() const { return v.front(); }
- reference front() { return v.front(); }
- const_reference back() const { return v.back(); }
- reference back() { return v.back(); }
+ const_reference front() const { return v_.front(); }
+ reference front() { return v_.front(); }
+ const_reference back() const { return v_.back(); }
+ reference back() { return v_.back(); }
- void push_back(T* elem) { v.push_back(elem); }
+ void push_back(T* elem) { v_.push_back(elem); }
- std::vector<T*>& get() { return v; }
- const std::vector<T*>& get() const { return v; }
- void swap(std::vector<T*>& other) { v.swap(other); }
- void swap(ScopedVector<T>& other) { v.swap(other.v); }
+ std::vector<T*>& get() { return v_; }
+ const std::vector<T*>& get() const { return v_; }
+ void swap(std::vector<T*>& other) { v_.swap(other); }
+ void swap(ScopedVector<T>& other) { v_.swap(other.v_); }
void release(std::vector<T*>* out) {
- out->swap(v);
- v.clear();
+ out->swap(v_);
+ v_.clear();
}
- void reserve(size_t capacity) { v.reserve(capacity); }
- void resize(size_t new_size) { v.resize(new_size); }
+ void reserve(size_t capacity) { v_.reserve(capacity); }
+ void resize(size_t new_size) { v_.resize(new_size); }
template<typename InputIterator>
void assign(InputIterator begin, InputIterator end) {
- v.assign(begin, end);
+ v_.assign(begin, end);
}
- void clear() { STLDeleteElements(&v); }
+ void clear() { STLDeleteElements(&v_); }
// Like |clear()|, but doesn't delete any elements.
- void weak_clear() { v.clear(); }
+ void weak_clear() { v_.clear(); }
// Lets the ScopedVector take ownership of |x|.
iterator insert(iterator position, T* x) {
- return v.insert(position, x);
+ return v_.insert(position, x);
}
// Lets the ScopedVector take ownership of elements in [first,last).
template<typename InputIterator>
void insert(iterator position, InputIterator first, InputIterator last) {
- v.insert(position, first, last);
+ v_.insert(position, first, last);
}
iterator erase(iterator position) {
delete *position;
- return v.erase(position);
+ return v_.erase(position);
}
iterator erase(iterator first, iterator last) {
STLDeleteContainerPointers(first, last);
- return v.erase(first, last);
+ return v_.erase(first, last);
}
// Like |erase()|, but doesn't delete the element at |position|.
iterator weak_erase(iterator position) {
- return v.erase(position);
+ return v_.erase(position);
}
// Like |erase()|, but doesn't delete the elements in [first, last).
iterator weak_erase(iterator first, iterator last) {
- return v.erase(first, last);
+ return v_.erase(first, last);
}
private:
- std::vector<T*> v;
+ std::vector<T*> v_;
};
#endif // BASE_MEMORY_SCOPED_VECTOR_H_