MGCL V10
V10
MGCL V10
|
Defines Vector of newed object pointers. [詳解]
公開型 | |
typedef std::vector< T * > ::iterator | iterator |
typedef std::vector< T * > ::const_iterator | const_iterator |
typedef std::vector< T * > ::reverse_iterator | reverse_iterator |
typedef std::vector< T * > ::const_reverse_iterator | const_reverse_iterator |
typedef std::vector< T * > ::reference | reference |
typedef std::vector< T * > ::const_reference | const_reference |
typedef std::vector< T * > ::size_type | size_type |
公開メンバ関数 | |
MGPvector () | |
void constructor [詳解] | |
MGPvector (size_type len) | |
MGPvector (T *ptr) | |
Construct MGPvector of length 1 that contains ptr. [詳解] | |
MGPvector (const MGPvector< T > &rhs) | |
MGPvector (const std::vector< const T * > &rhs) | |
Conversion constructor. [詳解] | |
template<class InputIter > | |
MGPvector (InputIter first, InputIter last) | |
Create a vector with given range [first, last). [詳解] | |
~MGPvector () | |
Destroy the object and delete all pointers that this object holds. [詳解] | |
const_reference | operator[] (size_type pos) const |
Subscript access. [詳解] | |
reference | operator[] (size_type pos) |
MGPvector< T > & | operator= (const MGPvector< T > &rhs) |
template<class InputIter > | |
void | assign (InputIter first, InputIter last) |
void | assign (size_type pos, T *ptr) |
const_reference | at (size_type n) const |
Equivalent to call vector::at(n). [詳解] | |
reference | at (size_type n) |
const_reference | back () const |
reference | back () |
const_iterator | begin () const |
Return const_iterator that points to the first element in the sequence. [詳解] | |
iterator | begin () |
Return iterator that points to the first element in the sequence. [詳解] | |
size_type | capacity () const |
Equivalent to call vector::capacity(). [詳解] | |
void | clear () |
clear Sequence, that is, erase all the elements in the sequence. [詳解] | |
bool | empty () const |
const_iterator | end () const |
Return const_iterator that points one past the last element. [詳解] | |
iterator | end () |
Return iterator that points one past the last element. [詳解] | |
iterator | erase (iterator x) |
erase the element at x. [詳解] | |
iterator | erase (size_type i) |
erase i-th element x. [詳解] | |
iterator | erase (iterator first, iterator last) |
erase sequence [first, last). [詳解] | |
const_reference | front () const |
reference | front () |
const_reference | get (size_type i) const |
reference | get (size_type i) |
iterator | insert (iterator pos, T *ptr) |
Insert ptr into vector at pos. [詳解] | |
template<class InputIter > | |
void | insert (iterator pos, InputIter first, InputIter last) |
Insert the range [first, last) into the vector at pos. [詳解] | |
bool | is_null (size_type i) const |
Test if i-th element is null. [詳解] | |
size_type | max_size () const |
Returns the size of maximum size. [詳解] | |
void | pop_back () |
pop last element. [詳解] | |
void | push_back (T *x) |
push element x at the end. [詳解] | |
void | push_back (MGPvector< T > &dst) |
const_reverse_iterator | rbegin () const |
Return const_reverse_iterator that points the end of the sequence. [詳解] | |
reverse_iterator | rbegin () |
Return reverse_iterator that points the end of the sequence. [詳解] | |
const_reverse_iterator | rend () const |
reverse_iterator | rend () |
T * | release (size_type i) |
void | release_all () |
T * | removeAt (iterator i) |
T * | removeAt (size_type i) |
void | reverse_sequence () |
reverse the sequence of the elements. [詳解] | |
void | reserve (size_type n) |
void | reset (size_type i, T *ptr=0) |
delete the i-th element and replace it with ptr. [詳解] | |
void | resize (size_type n) |
size_type | size () const |
Return the number of items that are in the sequence. [詳解] | |
void | swap (MGPvector< T > &x) |
公開変数類 | |
std::vector< T * > | m_vector |
Member data. [詳解] | |
フレンド | |
template<class T > | |
MG_DLL_DECLR friend std::ostream & | operator<< (std::ostream &out, const MGPvector< T > &vector) |
Debug out. [詳解] | |
Defines Vector of newed object pointers.
MGPvector is a list of std::auto_ptr<class T>. The member pointers of newed objects will be destructed when MGPList object is destructed. That is, the ownerships of the members all of the ownerships will be transfered to the copied or assigned new MGPvector.
typedef std::vector<T*>::const_iterator MGPvector< T >::const_iterator |
typedef std::vector<T*>::const_reference MGPvector< T >::const_reference |
typedef std::vector<T*>::const_reverse_iterator MGPvector< T >::const_reverse_iterator |
typedef std::vector<T*>::reverse_iterator MGPvector< T >::reverse_iterator |
default constructor Create a vector whose size is n. 長さlenのベクトルを作成します。 すべての要素はNULLで初期化されます。
Construct MGPvector of length 1 that contains ptr.
copy constructor The argument rhs will be cleared, since the ownership of all data of rhs should be transfered to this object. 所有権はすべて、新しいオブジェクトに移るので rhsのすべての要素はNULLになります。(sizeは変わりません)
Conversion constructor.
|
inline |
Create a vector with given range [first, last).
|
inline |
Assignment that takes a range. The intersection of this object and [first, last) must be empty.
|
inline |
Equivalent to call vector::at(n).
|
inline |
Return the reference to the last element in the sequence. If the vector is empty, behavior is undefined.
|
inline |
Return const_iterator that points to the first element in the sequence.
Return iterator that points to the first element in the sequence.
Equivalent to call vector::capacity().
|
inline |
clear Sequence, that is, erase all the elements in the sequence.
|
inline |
Return true (1) if there are no items in the vector, false(0) otherwise.
|
inline |
Return const_iterator that points one past the last element.
Return iterator that points one past the last element.
erase sequence [first, last).
|
inline |
Return the reference to first element in the vector. If the vector is empty, behavior is undefined.
|
inline |
ただのポインタを返す。所有権は放棄しないので このポインタを解放してはならない。
Insert ptr into vector at pos.
|
inline |
Insert the range [first, last) into the vector at pos.
Test if i-th element is null.
Returns the size of maximum size.
|
inline |
Subscript access.
if(pos>=size()) return 0;
if(pos>=size()) return 0;
|
inline |
pop last element.
|
inline |
push element x at the end.
push element x at the end. All the ownership of the elements in dst are transfered to this Pvector.
|
inline |
Return const_reverse_iterator that points the end of the sequence.
|
inline |
Return reverse_iterator that points the end of the sequence.
現在の所有権を放棄し、ただのポインタを返す。 この処理の後はget(i)==nullとなる。 ベクトルの要素自体は削除されません。
|
inline |
現在の所有権をすべて放棄する。 この処理の後はget(i)==nullとなる。 ベクトルの要素自体は削除されない。
Remove the T* and return the T*. If i is no valid, behavior is undefined.
Remove the i-th T* in the vector and return the T*. If i is not valid, the behavior is undefined.
|
inline |
Return const_reverse_iterator that points to one before the first element in the vector.
|
inline |
Return reverse_iterator that points to one before the first element in the vector.
Preallocate memory for specified number of elements if necessary.
delete the i-th element and replace it with ptr.
|
inline |
reverse the sequence of the elements.
Return the number of items that are in the sequence.
|
friend |
Debug out.
std::vector<T *> MGPvector< T >::m_vector |
Member data.