PIMap some doc
This commit is contained in:
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
//! \~english Copy constructor.
|
||||
//! \~russian Копирующий конструктор.
|
||||
inline PIMap(const PIMap<Key, T> & other) {*this = other;}
|
||||
inline PIMap(const PIMap<Key, T> & other) : pim_content(other.pim_content), pim_index(other.pim_index) {}
|
||||
|
||||
//! \~english Move constructor.
|
||||
//! \~russian Перемещающий конструктор.
|
||||
@@ -212,30 +212,30 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//! \~english Iterator to the first element.
|
||||
//! \~russian Итератор на первый элемент.
|
||||
inline iterator begin() {return iterator(this, 0);}
|
||||
|
||||
//! \~english Iterator to the element following the last element.
|
||||
//! \~russian Итератор на элемент, следующий за последним элементом.
|
||||
inline iterator end() {return iterator(this, size());}
|
||||
|
||||
inline const_iterator begin() const {return const_iterator(this, 0);}
|
||||
|
||||
inline const_iterator end() const {return const_iterator(this, size());}
|
||||
|
||||
inline const_iterator constBegin() const {return const_iterator(this, 0);}
|
||||
|
||||
inline const_iterator constEnd() const {return const_iterator(this, size());}
|
||||
|
||||
//! \~english Returns a reverse iterator to the first element of the reversed array.
|
||||
//! \~russian Обратный итератор на первый элемент.
|
||||
inline reverse_iterator rbegin() {return reverse_iterator(this, size() - 1);}
|
||||
|
||||
inline reverse_iterator rend() {return reverse_iterator(this, -1);}
|
||||
//! \~english Returns a reverse iterator to the element.
|
||||
//! following the last element of the reversed array.
|
||||
//! \~russian Обратный итератор на элемент,
|
||||
//! следующий за последним элементом.
|
||||
inline reverse_iterator rend() {return reverse_iterator(this, -1);}
|
||||
|
||||
inline const_reverse_iterator rbegin() const {return const_reverse_iterator(this, size() - 1);}
|
||||
|
||||
inline const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);}
|
||||
|
||||
inline const_reverse_iterator constRbegin() const {return const_reverse_iterator(this, size() - 1);}
|
||||
|
||||
inline const_reverse_iterator constRend() const {return const_reverse_iterator(this, -1);}
|
||||
|
||||
//! \relatesalso PIMapIteratorConst
|
||||
inline PIMapIteratorConst<Key, T> makeIterator() const {return PIMapIteratorConst<Key, T>(*this);}
|
||||
|
||||
@@ -248,16 +248,48 @@ public:
|
||||
//! \relatesalso PIMapIteratorReverse
|
||||
inline PIMapIteratorReverse<Key, T> makeReverseIterator() {return PIMapIteratorReverse<Key, T>(*this);}
|
||||
|
||||
//! \~english Number of elements in the container.
|
||||
//! \~russian Количество элементов массива.
|
||||
//! \~\sa \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve()
|
||||
inline size_t size() const {return pim_content.size();}
|
||||
|
||||
//! \~english Number of elements in the container as signed value.
|
||||
//! \~russian Количество элементов массива в виде знакового числа.
|
||||
//! \~\sa \a size(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve()
|
||||
inline int size_s() const {return pim_content.size_s();}
|
||||
|
||||
//! \~english Same as \a size().
|
||||
//! \~russian Синоним \a size().
|
||||
//! \~\sa \a size(), \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve()
|
||||
inline size_t length() const {return pim_content.size();}
|
||||
|
||||
//! \~english Checks if the container has no elements.
|
||||
//! \~russian Проверяет пуст ли массив.
|
||||
//! \~\return
|
||||
//! \~english **true** if the container is empty, **false** otherwise
|
||||
//! \~russian **true** если массив пуст, **false** иначе.
|
||||
//! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve()
|
||||
inline bool isEmpty() const {return (pim_content.size() == 0);}
|
||||
|
||||
//! \~english Checks if the container has elements.
|
||||
//! \~russian Проверяет не пуст ли массив.
|
||||
//! \~\return
|
||||
//! \~english **true** if the container is not empty, **false** otherwise
|
||||
//! \~russian **true** если массив не пуст, **false** иначе.
|
||||
//! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve()
|
||||
inline bool isNotEmpty() const {return (pim_content.size() > 0);}
|
||||
|
||||
|
||||
|
||||
//! \~english Full access to element key `key`.
|
||||
//! \~russian Полный доступ к элементу по ключу `key`.
|
||||
//! \~\details
|
||||
//! \~english If the map contains no item with key `key`,
|
||||
//! the function inserts a default-constructed value into the map with key `key`,
|
||||
//! and returns a reference to it.
|
||||
//! \~russian Если элемента с таким ключом `key` не существует,
|
||||
//! то он будет создан конструктором по умолчанию и добавлен в массив
|
||||
//! по ключу `key`, а затем возвращена ссылка на этот новый элемент.
|
||||
//! \~\sa \a insert(), \a value(), \a key()
|
||||
inline T & operator [](const Key & key) {
|
||||
bool f(false);
|
||||
ssize_t i = _find(key, f);
|
||||
@@ -267,6 +299,9 @@ public:
|
||||
return pim_content.back();
|
||||
}
|
||||
|
||||
//! \~english Same as \a value().
|
||||
//! \~russian Синоним \a value().
|
||||
//! \~\sa \a operator[](), \a value(), \a key()
|
||||
inline T at(const Key & key) const {return value(key);}
|
||||
|
||||
inline T take(const Key & key) const {
|
||||
@@ -278,6 +313,8 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
//! \~english Inserts all elements in array `other` to this array with overwrite.
|
||||
//! \~russian Вставляет все элементы `other` этот массив с перезаписью.
|
||||
inline PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) {
|
||||
#ifndef NDEBUG
|
||||
if (&other == this) {
|
||||
@@ -301,12 +338,20 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator ==(const PIMap<Key, T> & t) const {
|
||||
return (pim_content == t.pim_content && pim_index == t.pim_index);
|
||||
//! \~english Compare operator with array `m`.
|
||||
//! \~russian Оператор сравнения с массивом `m`.
|
||||
inline bool operator ==(const PIMap<Key, T> & m) const {
|
||||
return (pim_content == m.pim_content && pim_index == m.pim_index);
|
||||
}
|
||||
inline bool operator !=(const PIMap<Key, T> & t) const {
|
||||
return (pim_content != t.pim_content || pim_index != t.pim_index);
|
||||
|
||||
//! \~english Compare operator with array `m`.
|
||||
//! \~russian Оператор сравнения с массивом `m`.
|
||||
inline bool operator !=(const PIMap<Key, T> & m) const {
|
||||
return (pim_content != m.pim_content || pim_index != m.pim_index);
|
||||
}
|
||||
|
||||
//! \~english Tests if element with key `key` exists in the array.
|
||||
//! \~russian Проверяет наличие элемента с ключом `key` в массиве.
|
||||
inline bool contains(const Key & key) const {
|
||||
bool f(false); _find(key, f);
|
||||
return f;
|
||||
|
||||
Reference in New Issue
Block a user