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

Defines List of newed object pointers. [詳解]

公開型

typedef std::list< T * >::iterator iterator
 
typedef std::list< T * >
::const_iterator 
const_iterator
 
typedef std::list< T * >
::reverse_iterator 
reverse_iterator
 
typedef std::list< T * >
::const_reverse_iterator 
const_reverse_iterator
 
typedef std::list< T * >::reference reference
 
typedef std::list< T * >
::const_reference 
const_reference
 
typedef std::list< T * >::size_type size_type
 

公開メンバ関数

 MGPlist ()
 Constructors. [詳解]
 
 MGPlist (const MGPlist< T > &rhs)
 
 MGPlist (size_type n)
 Create a list whose size is n. [詳解]
 
template<class InputIter >
 MGPlist (InputIter first, InputIter last)
 Create a list with a range. The ownership will be transfered. [詳解]
 
 ~MGPlist ()
 Destroy the object and delete all pointers that this holds. [詳解]
 
MGPlist< T > & operator= (const MGPlist< T > &rhs)
 operator overload [詳解]
 
template<class InputIter >
void assign (InputIter first, InputIter last)
 member functions [詳解]
 
const_reference back () const
 
reference back ()
 
const_iterator begin () const
 Return const_iterator at the beginning of list. [詳解]
 
iterator begin ()
 
void clear ()
 clear list, that is, erase all the elements in the list. [詳解]
 
bool empty () const
 
const_iterator end () const
 Return const_iterator at the end of list. [詳解]
 
iterator end ()
 
iterator erase (iterator x)
 erase element x. [詳解]
 
iterator erase (iterator first, iterator last)
 erase sequence [first, last). [詳解]
 
const_iterator find (T *obj) const
 
iterator find (T *obj)
 
const_reference front () const
 
reference front ()
 
iterator insert (iterator it, T *x)
 
template<class InputIter >
void insert (iterator pos, InputIter first, InputIter last)
 Insert given range denoted by [first, last) into one before pos. [詳解]
 
size_type max_size () const
 Returns the size of maximum size. [詳解]
 
void merge (MGPlist< T > &rhs)
 Equivalent to call std::list::merge(). [詳解]
 
void pop_back ()
 pop last element. [詳解]
 
void pop_front ()
 pop first element. [詳解]
 
void push_back (T *x)
 push element x at the end. [詳解]
 
void push_back (MGPlist< T > &x)
 
void push_front (T *x)
 push element x at the first. [詳解]
 
const_reverse_iterator rbegin () const
 Return const_reverse_iterator at the beginning of list. [詳解]
 
reverse_iterator rbegin ()
 
const_reverse_iterator rend () const
 Return const_reverse_iterator at the end of list. [詳解]
 
reverse_iterator rend ()
 
iterator release (iterator i)
 
void remove (T *x)
 Release the ownership of elements that point the same as x. [詳解]
 
template<class Pred >
void remove_if (Pred pred)
 
T * removeAt (iterator x)
 
void reverse ()
 reverse sequence. [詳解]
 
size_type size () const
 Return the number of items that are in the list. [詳解]
 
void sort ()
 Equivalent to call std::list::sort(). [詳解]
 
template<class Traits >
void sort (Traits _Comp)
 
void splice (iterator pos, MGPlist< T > &ls)
 
void splice (iterator pos, MGPlist< T > &ls, iterator i)
 
void splice (iterator pos, MGPlist< T > &ls, iterator first, iterator last)
 
void swap (MGPlist< T > &x)
 Equivalent to call std::list::swap(). [詳解]
 
void unique ()
 Equivalent to call std::list::unique(). [詳解]
 

公開変数類

std::list< T * > m_list
 Member Data. [詳解]
 

フレンド

MG_DLL_DECLR friend std::ostream & operator<< (std::ostream &out, const MGPlist< T > &lst)
 String stream function. [詳解]
 

詳解

template<class T>
class MGPlist< T >

Defines List of newed object pointers.

MGPlist 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 MGPlist.

型定義メンバ詳解

template<class T>
typedef std::list<T*>::const_iterator MGPlist< T >::const_iterator
template<class T>
typedef std::list<T*>::const_reference MGPlist< T >::const_reference
template<class T>
typedef std::list<T*>::const_reverse_iterator MGPlist< T >::const_reverse_iterator
template<class T>
typedef std::list<T*>::iterator MGPlist< T >::iterator

Alias. 別名定義

template<class T>
typedef std::list<T*>::reference MGPlist< T >::reference
template<class T>
typedef std::list<T*>::reverse_iterator MGPlist< T >::reverse_iterator
template<class T>
typedef std::list<T*>::size_type MGPlist< T >::size_type

構築子と解体子

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

Constructors.

The default constructor.

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

The 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は 0となります)

template<class T>
MGPlist< T >::MGPlist ( size_type  n)
inlineexplicit

Create a list whose size is n.

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

Create a list with a range. The ownership will be transfered.

関数詳解

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

member functions

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

template<class T>
const_reference MGPlist< T >::back ( ) const
inline

Return(but does not remove) last element in the list. If list is empty, behavior is undefined.

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

Return const_iterator at the beginning of list.

template<class T>
iterator MGPlist< T >::begin ( )
inline
template<class T>
void MGPlist< T >::clear ( )
inline

clear list, that is, erase all the elements in the list.

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

Return true if there are no items in the list, false otherwise.

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

Return const_iterator at the end of list.

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

erase element x.

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

erase sequence [first, last).

template<class T>
const_iterator MGPlist< T >::find ( T *  obj) const
inline

find the position of the object T* found first. If not found, end() will be returned.

template<class T>
iterator MGPlist< T >::find ( T *  obj)
inline
template<class T>
const_reference MGPlist< T >::front ( ) const
inline

Return(but does not remove) first element in the list. If list is empty, behavior is undefined.

template<class T>
reference MGPlist< T >::front ( )
inline
template<class T>
iterator MGPlist< T >::insert ( iterator  it,
T *  x 
)
inline

insert an element x before the position it. Function's return value is the iterator of x after inserted.

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

Insert given range denoted by [first, last) into one before pos.

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

Returns the size of maximum size.

template<class T>
void MGPlist< T >::merge ( MGPlist< T > &  rhs)
inline

Equivalent to call std::list::merge().

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

pop last element.

template<class T>
void MGPlist< T >::pop_front ( )
inline

pop first element.

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

push element x at the end.

template<class T>
void MGPlist< T >::push_back ( MGPlist< T > &  x)
inline
template<class T>
void MGPlist< T >::push_front ( T *  x)
inline

push element x at the first.

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

Return const_reverse_iterator at the beginning of list.

template<class T>
reverse_iterator MGPlist< T >::rbegin ( )
inline
template<class T>
iterator MGPlist< T >::release ( iterator  i)
inline

Release the pointer at th position i. Returned will be the position after the released gel.

template<class T>
void MGPlist< T >::remove ( T *  x)
inline

Release the ownership of elements that point the same as x.

template<class T>
template<class Pred >
void MGPlist< T >::remove_if ( Pred  pred)
inline

Release the ownership of elements that pred(x) is true, where x is an element of the list.

template<class T>
T* MGPlist< T >::removeAt ( iterator  x)
inline

Remove the T* at the iterator x and return the T*. If x is no valid, behavior is undefined. 現在の所有権を放棄し、ただのポインタを返す。

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

Return const_reverse_iterator at the end of list.

template<class T>
reverse_iterator MGPlist< T >::rend ( )
inline
template<class T>
void MGPlist< T >::reverse ( )
inline

reverse sequence.

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

Return the number of items that are in the list.

template<class T>
void MGPlist< T >::sort ( )
inline

Equivalent to call std::list::sort().

template<class T>
template<class Traits >
void MGPlist< T >::sort ( Traits  _Comp)
inline
template<class T>
void MGPlist< T >::splice ( iterator  pos,
MGPlist< T > &  ls 
)
inline
template<class T>
void MGPlist< T >::splice ( iterator  pos,
MGPlist< T > &  ls,
iterator  i 
)
inline
template<class T>
void MGPlist< T >::splice ( iterator  pos,
MGPlist< T > &  ls,
iterator  first,
iterator  last 
)
inline
template<class T>
void MGPlist< T >::swap ( MGPlist< T > &  x)
inline

Equivalent to call std::list::swap().

template<class T>
void MGPlist< T >::unique ( )
inline

Equivalent to call std::list::unique().

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

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

String stream function.

メンバ詳解

template<class T>
std::list<T*> MGPlist< T >::m_list

Member Data.


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