MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
MGPvector< T > クラステンプレート

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. [詳解]
 

詳解

template<class T>
class MGPvector< T >

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.

型定義メンバ詳解

template<class T>
typedef std::vector<T*>::const_iterator MGPvector< T >::const_iterator
template<class T>
typedef std::vector<T*>::const_reference MGPvector< T >::const_reference
template<class T>
typedef std::vector<T*>::const_reverse_iterator MGPvector< T >::const_reverse_iterator
template<class T>
typedef std::vector<T*>::iterator MGPvector< T >::iterator

Alias. 別名定義

template<class T>
typedef std::vector<T*>::reference MGPvector< T >::reference
template<class T>
typedef std::vector<T*>::reverse_iterator MGPvector< T >::reverse_iterator
template<class T>
typedef std::vector<T*>::size_type MGPvector< T >::size_type

構築子と解体子

template<class T>
MGPvector< T >::MGPvector ( )
inline

void constructor

template<class T>
MGPvector< T >::MGPvector ( size_type  len)
inlineexplicit

default constructor Create a vector whose size is n. 長さlenのベクトルを作成します。 すべての要素はNULLで初期化されます。

template<class T>
MGPvector< T >::MGPvector ( T *  ptr)
inline

Construct MGPvector of length 1 that contains ptr.

template<class T>
MGPvector< T >::MGPvector ( const MGPvector< T > &  rhs)
inline

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は変わりません)

template<class T>
MGPvector< T >::MGPvector ( const std::vector< const T * > &  rhs)
inline

Conversion constructor.

template<class T>
template<class InputIter >
MGPvector< T >::MGPvector ( InputIter  first,
InputIter  last 
)
inline

Create a vector with given range [first, last).

関数詳解

template<class T>
template<class InputIter >
void MGPvector< T >::assign ( InputIter  first,
InputIter  last 
)
inline

Assignment that takes a range. The intersection of this object and [first, last) must be empty.

template<class T>
void MGPvector< T >::assign ( size_type  pos,
T *  ptr 
)
inline
template<class T>
const_reference MGPvector< T >::at ( size_type  n) const
inline

Equivalent to call vector::at(n).

template<class T>
reference MGPvector< T >::at ( size_type  n)
inline
template<class T>
const_reference MGPvector< T >::back ( ) const
inline

Return the reference to the last element in the sequence. If the vector is empty, behavior is undefined.

template<class T>
reference MGPvector< T >::back ( )
inline
template<class T>
const_iterator MGPvector< T >::begin ( ) const
inline

Return const_iterator that points to the first element in the sequence.

template<class T>
iterator MGPvector< T >::begin ( )
inline

Return iterator that points to the first element in the sequence.

template<class T>
size_type MGPvector< T >::capacity ( ) const
inline

Equivalent to call vector::capacity().

template<class T>
void MGPvector< T >::clear ( )
inline

clear Sequence, that is, erase all the elements in the sequence.

template<class T>
bool MGPvector< T >::empty ( ) const
inline

Return true (1) if there are no items in the vector, false(0) otherwise.

template<class T>
const_iterator MGPvector< T >::end ( ) const
inline

Return const_iterator that points one past the last element.

template<class T>
iterator MGPvector< T >::end ( )
inline

Return iterator that points one past the last element.

template<class T>
iterator MGPvector< T >::erase ( iterator  x)
inline

erase the element at x.

template<class T>
iterator MGPvector< T >::erase ( size_type  i)
inline

erase i-th element x.

template<class T>
iterator MGPvector< T >::erase ( iterator  first,
iterator  last 
)
inline

erase sequence [first, last).

template<class T>
const_reference MGPvector< T >::front ( ) const
inline

Return the reference to first element in the vector. If the vector is empty, behavior is undefined.

template<class T>
reference MGPvector< T >::front ( )
inline
template<class T>
const_reference MGPvector< T >::get ( size_type  i) const
inline

ただのポインタを返す。所有権は放棄しないので このポインタを解放してはならない。

template<class T>
reference MGPvector< T >::get ( size_type  i)
inline
template<class T>
iterator MGPvector< T >::insert ( iterator  pos,
T *  ptr 
)
inline

Insert ptr into vector at pos.

template<class T>
template<class InputIter >
void MGPvector< T >::insert ( iterator  pos,
InputIter  first,
InputIter  last 
)
inline

Insert the range [first, last) into the vector at pos.

template<class T>
bool MGPvector< T >::is_null ( size_type  i) const
inline

Test if i-th element is null.

template<class T>
size_type MGPvector< T >::max_size ( ) const
inline

Returns the size of maximum size.

template<class T>
const_reference MGPvector< T >::operator[] ( size_type  pos) const
inline

Subscript access.

if(pos>=size()) return 0;

template<class T>
reference MGPvector< T >::operator[] ( size_type  pos)
inline

if(pos>=size()) return 0;

template<class T>
void MGPvector< T >::pop_back ( )
inline

pop last element.

template<class T>
void MGPvector< T >::push_back ( T *  x)
inline

push element x at the end.

template<class T>
void MGPvector< T >::push_back ( MGPvector< T > &  dst)
inline

push element x at the end. All the ownership of the elements in dst are transfered to this Pvector.

template<class T>
const_reverse_iterator MGPvector< T >::rbegin ( ) const
inline

Return const_reverse_iterator that points the end of the sequence.

template<class T>
reverse_iterator MGPvector< T >::rbegin ( )
inline

Return reverse_iterator that points the end of the sequence.

template<class T>
T* MGPvector< T >::release ( size_type  i)
inline

現在の所有権を放棄し、ただのポインタを返す。 この処理の後はget(i)==nullとなる。 ベクトルの要素自体は削除されません。

template<class T>
void MGPvector< T >::release_all ( )
inline

現在の所有権をすべて放棄する。 この処理の後はget(i)==nullとなる。 ベクトルの要素自体は削除されない。

template<class T>
T* MGPvector< T >::removeAt ( iterator  i)
inline

Remove the T* and return the T*. If i is no valid, behavior is undefined.

template<class T>
T* MGPvector< T >::removeAt ( size_type  i)
inline

Remove the i-th T* in the vector and return the T*. If i is not valid, the behavior is undefined.

template<class T>
const_reverse_iterator MGPvector< T >::rend ( ) const
inline

Return const_reverse_iterator that points to one before the first element in the vector.

template<class T>
reverse_iterator MGPvector< T >::rend ( )
inline

Return reverse_iterator that points to one before the first element in the vector.

template<class T>
void MGPvector< T >::reserve ( size_type  n)
inline

Preallocate memory for specified number of elements if necessary.

template<class T>
void MGPvector< T >::reset ( size_type  i,
T *  ptr = 0 
)
inline

delete the i-th element and replace it with ptr.

template<class T>
void MGPvector< T >::reverse_sequence ( )
inline

reverse the sequence of the elements.

template<class T>
size_type MGPvector< T >::size ( ) const
inline

Return the number of items that are in the sequence.

template<class T>
void MGPvector< T >::swap ( MGPvector< T > &  x)
inline

フレンドと関連関数の詳解

template<class T>
template<class T >
MG_DLL_DECLR friend std::ostream& operator<< ( std::ostream &  out,
const MGPvector< T > &  vector 
)
friend

Debug out.

メンバ詳解

template<class T>
std::vector<T *> MGPvector< T >::m_vector

Member data.


このクラス詳解は次のファイルから抽出されました: