Templates -- Meow  1.2.9
A C++ template contains kinds of interesting classes and functions
meow::ObjDictionary< Key, Value > Class Template Reference

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

#include "ObjDictionary.h"

Inheritance diagram for meow::ObjDictionary< Key, Value >:
meow::ObjBase

Public Member Functions

 ObjDictionary ()
 
 ObjDictionary (ObjDictionary const &d)
 
 ObjDictionary (std::map< Key, Value > const &d)
 
 ~ObjDictionary ()
 
ObjDictionarycopyFrom (ObjDictionary const &d)
 
ObjDictionaryreferenceFrom (ObjDictionary const &d)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
std::map< Key, Value >
::const_iterator 
first () const
 
std::map< Key, Value >::iterator first ()
 
std::map< Key, Value >
::const_iterator 
end () const
 
std::map< Key, Value >::iterator end ()
 
std::map< Key, Value >
::const_iterator 
find (Key const &k) const
 
std::map< Key, Value >::iterator find (Key const &k)
 
bool exist (Key const &k) const
 
void insert (Key const &k, Value const &v)
 
ObjDictionaryoperator= (ObjDictionary const &a)
 
Value operator[] (Key const &k)
 
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 Key, class Value>
class meow::ObjDictionary< Key, Value >

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

Author
cathook

Definition at line 23 of file ObjDictionary.h.

Constructor & Destructor Documentation

template<class Key , class Value >
meow::ObjDictionary< Key, Value >::ObjDictionary ( )
inline

Definition at line 40 of file ObjDictionary.h.

template<class Key , class Value >
meow::ObjDictionary< Key, Value >::ObjDictionary ( ObjDictionary< Key, Value > const &  d)
inline

Definition at line 43 of file ObjDictionary.h.

template<class Key , class Value >
meow::ObjDictionary< Key, Value >::ObjDictionary ( std::map< Key, Value > const &  d)
inline

Definition at line 47 of file ObjDictionary.h.

template<class Key , class Value >
meow::ObjDictionary< Key, Value >::~ObjDictionary ( )
inline

Definition at line 50 of file ObjDictionary.h.

Member Function Documentation

template<class Key , class Value >
void meow::ObjDictionary< Key, Value >::clear ( )
inline

Definition at line 71 of file ObjDictionary.h.

template<class Key , class Value >
ObjDictionary& meow::ObjDictionary< Key, Value >::copyFrom ( ObjDictionary< Key, Value > const &  d)
inline

Definition at line 53 of file ObjDictionary.h.

template<class Key , class Value >
ObjBase* meow::ObjDictionary< Key, Value >::copyFrom ( ObjBase const *  b)
inlinevirtual

複製, 預設使用operator=

Parameters
[in]b資料來源
Returns
this

Reimplemented from meow::ObjBase.

Definition at line 152 of file ObjDictionary.h.

template<class Key , class Value >
ObjBase* meow::ObjDictionary< Key, Value >::create ( ) const
inlinevirtual

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

Reimplemented from meow::ObjBase.

Definition at line 148 of file ObjDictionary.h.

template<class Key , class Value >
char const* meow::ObjDictionary< Key, Value >::ctype ( ) const
inlinevirtual

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

Reimplemented from meow::ObjBase.

Definition at line 156 of file ObjDictionary.h.

template<class Key , class Value >
bool meow::ObjDictionary< Key, Value >::empty ( ) const
inline

Definition at line 67 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::const_iterator meow::ObjDictionary< Key, Value >::end ( ) const
inline

Definition at line 83 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::iterator meow::ObjDictionary< Key, Value >::end ( )
inline

Definition at line 87 of file ObjDictionary.h.

template<class Key , class Value >
bool meow::ObjDictionary< Key, Value >::exist ( Key const &  k) const
inline

Definition at line 99 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::const_iterator meow::ObjDictionary< Key, Value >::find ( Key const &  k) const
inline

Definition at line 91 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::iterator meow::ObjDictionary< Key, Value >::find ( Key const &  k)
inline

Definition at line 95 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::const_iterator meow::ObjDictionary< Key, Value >::first ( ) const
inline

Definition at line 75 of file ObjDictionary.h.

template<class Key , class Value >
std::map<Key, Value>::iterator meow::ObjDictionary< Key, Value >::first ( )
inline

Definition at line 79 of file ObjDictionary.h.

template<class Key , class Value >
void meow::ObjDictionary< Key, Value >::insert ( Key const &  k,
Value const &  v 
)
inline

Definition at line 103 of file ObjDictionary.h.

template<class Key , class Value >
ObjDictionary& meow::ObjDictionary< Key, Value >::operator= ( ObjDictionary< Key, Value > const &  a)
inline

Definition at line 107 of file ObjDictionary.h.

template<class Key , class Value >
Value meow::ObjDictionary< Key, Value >::operator[] ( Key const &  k)
inline

Definition at line 111 of file ObjDictionary.h.

template<class Key , class Value >
bool meow::ObjDictionary< Key, Value >::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 130 of file ObjDictionary.h.

template<class Key , class Value >
ObjDictionary& meow::ObjDictionary< Key, Value >::referenceFrom ( ObjDictionary< Key, Value > const &  d)
inline

Definition at line 58 of file ObjDictionary.h.

template<class Key , class Value >
size_t meow::ObjDictionary< Key, Value >::size ( ) const
inline

Definition at line 63 of file ObjDictionary.h.

template<class Key , class Value >
std::string meow::ObjDictionary< Key, Value >::type ( ) const
inlinevirtual

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

Reimplemented from meow::ObjBase.

Definition at line 160 of file ObjDictionary.h.

template<class Key , class Value >
bool meow::ObjDictionary< Key, Value >::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 115 of file ObjDictionary.h.


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