Templates -- Meow  1.1.4
A C++ template which is unable and also not allowed to compile to obj-file first.
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 
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 ()
 

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 38 of file ObjDictionary.h.

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

Definition at line 41 of file ObjDictionary.h.

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

Definition at line 45 of file ObjDictionary.h.

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

Definition at line 49 of file ObjDictionary.h.

Member Function Documentation

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

Definition at line 69 of file ObjDictionary.h.

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

Definition at line 52 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 143 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 139 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 147 of file ObjDictionary.h.

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

Definition at line 65 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 73 of file ObjDictionary.h.

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

Definition at line 77 of file ObjDictionary.h.

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

Definition at line 89 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 81 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 85 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 93 of file ObjDictionary.h.

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

Definition at line 97 of file ObjDictionary.h.

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

Definition at line 101 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 121 of file ObjDictionary.h.

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

Definition at line 57 of file ObjDictionary.h.

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

Definition at line 62 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 151 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 105 of file ObjDictionary.h.


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