Templates -- Meow  204.13.18
A C++ template contains kinds of interesting classes and functions
meow::ObjArray< T > Class Template Reference

純粹把 std::vector 包起來, 變成繼承自 ObjBase More...

#include "ObjArray.h"

Inheritance diagram for meow::ObjArray< T >:
meow::ObjBase

Public Member Functions

 ObjArray ()
 
 ObjArray (ObjArray const &a)
 
 ObjArray (std::vector< T > const &a)
 
 ObjArray (size_t sz, T const &e)
 
 ~ObjArray ()
 
ObjArraycopyFrom (ObjArray const &a)
 
ObjArrayreferenceFrom (ObjArray const &a)
 
size_t size () const
 
bool empty () const
 
size_t size (size_t res, T const &i)
 
size_t size (size_t res)
 
void clear ()
 
entry (size_t i) const
 
entry (size_t i, T const &e)
 
putBack (T const &e)
 
bool popBack ()
 
ObjArrayoperator= (ObjArray const &a)
 
operator[] (size_t i) const
 
std::vector< T >::reference operator[] (size_t i)
 
bool write (FILE *f, bool bin, unsigned int fg) const
 將物件寫入檔案, 預設implement為直接回傳 false More...
 
bool read (FILE *f, bool bin, unsigned int fg)
 將物件從檔案讀出, 預設implement為直接回傳 false More...
 
ObjBasecreate () const
 回傳一個new出來的物件, 預設implement為直接回傳 NULL More...
 
ObjBasecopyFrom (ObjBase const *b)
 複製, 預設使用operator= More...
 
char const * ctype () const
 用C-style string回傳這個class的type name More...
 
std::string type () const
 用std::string回傳這個class的type name More...
 
- Public Member Functions inherited from meow::ObjBase
virtual ~ObjBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from meow::ObjBase
static char const * ctypeBase ()
 用C-style string回傳base的type name More...
 
static std::string typeBase ()
 用std::string回傳base的type name More...
 
- Protected Member Functions inherited from meow::ObjBase
 ObjBase ()
 Constructor with doing nothing. More...
 

Detailed Description

template<class T>
class meow::ObjArray< T >

純粹把 std::vector 包起來, 變成繼承自 ObjBase

Author
cathook

Definition at line 23 of file ObjArray.h.

Constructor & Destructor Documentation

template<class T >
meow::ObjArray< T >::ObjArray ( )
inline

Definition at line 42 of file ObjArray.h.

template<class T >
meow::ObjArray< T >::ObjArray ( ObjArray< T > const &  a)
inline

Definition at line 45 of file ObjArray.h.

template<class T >
meow::ObjArray< T >::ObjArray ( std::vector< T > const &  a)
inline

Definition at line 48 of file ObjArray.h.

template<class T >
meow::ObjArray< T >::ObjArray ( size_t  sz,
T const &  e 
)
inline

Definition at line 51 of file ObjArray.h.

template<class T >
meow::ObjArray< T >::~ObjArray ( )
inline

Definition at line 54 of file ObjArray.h.

Member Function Documentation

template<class T >
void meow::ObjArray< T >::clear ( )
inline

Definition at line 84 of file ObjArray.h.

template<class T >
ObjArray& meow::ObjArray< T >::copyFrom ( ObjArray< T > const &  a)
inline

Definition at line 57 of file ObjArray.h.

template<class T >
ObjBase* meow::ObjArray< T >::copyFrom ( ObjBase const *  b)
inlinevirtual

複製, 預設使用operator=

Parameters
[in]b資料來源
Returns
this

Reimplemented from meow::ObjBase.

Definition at line 153 of file ObjArray.h.

template<class T >
ObjBase* meow::ObjArray< T >::create ( ) const
inlinevirtual

回傳一個new出來的物件, 預設implement為直接回傳 NULL

Reimplemented from meow::ObjBase.

Definition at line 149 of file ObjArray.h.

template<class T >
char const* meow::ObjArray< T >::ctype ( ) const
inlinevirtual

用C-style string回傳這個class的type name

Reimplemented from meow::ObjBase.

Definition at line 157 of file ObjArray.h.

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

Definition at line 70 of file ObjArray.h.

template<class T >
T meow::ObjArray< T >::entry ( size_t  i) const
inline

Definition at line 88 of file ObjArray.h.

template<class T >
T meow::ObjArray< T >::entry ( size_t  i,
T const &  e 
)
inline

Definition at line 92 of file ObjArray.h.

template<class T >
ObjArray& meow::ObjArray< T >::operator= ( ObjArray< T > const &  a)
inline

Definition at line 108 of file ObjArray.h.

template<class T >
T meow::ObjArray< T >::operator[] ( size_t  i) const
inline

Definition at line 112 of file ObjArray.h.

template<class T >
std::vector<T>::reference meow::ObjArray< T >::operator[] ( size_t  i)
inline

Definition at line 116 of file ObjArray.h.

template<class T >
bool meow::ObjArray< T >::popBack ( )
inline

Definition at line 102 of file ObjArray.h.

template<class T >
T meow::ObjArray< T >::putBack ( T const &  e)
inline

Definition at line 97 of file ObjArray.h.

template<class T >
bool meow::ObjArray< T >::read ( FILE *  f,
bool  bin,
unsigned int  fg 
)
inlinevirtual

將物件從檔案讀出, 預設implement為直接回傳 false

Parameters
[in]f檔案
[in]bin是否為binary模式
[in]fg使用者自訂的argument
Returns
成功或失敗

Reimplemented from meow::ObjBase.

Definition at line 134 of file ObjArray.h.

template<class T >
ObjArray& meow::ObjArray< T >::referenceFrom ( ObjArray< T > const &  a)
inline

Definition at line 62 of file ObjArray.h.

template<class T >
size_t meow::ObjArray< T >::size ( ) const
inline

Definition at line 67 of file ObjArray.h.

template<class T >
size_t meow::ObjArray< T >::size ( size_t  res,
T const &  i 
)
inline

Definition at line 74 of file ObjArray.h.

template<class T >
size_t meow::ObjArray< T >::size ( size_t  res)
inline

Definition at line 79 of file ObjArray.h.

template<class T >
std::string meow::ObjArray< T >::type ( ) const
inlinevirtual

用std::string回傳這個class的type name

Reimplemented from meow::ObjBase.

Definition at line 161 of file ObjArray.h.

template<class T >
bool meow::ObjArray< T >::write ( FILE *  f,
bool  bin,
unsigned int  fg 
) const
inlinevirtual

將物件寫入檔案, 預設implement為直接回傳 false

Parameters
[in]f檔案
[in]bin是否為binary模式
[in]fg使用者自訂的argument
Returns
成功或失敗

Reimplemented from meow::ObjBase.

Definition at line 120 of file ObjArray.h.


The documentation for this class was generated from the following file: