Templates -- Meow  1.1.4
A C++ template which is unable and also not allowed to compile to obj-file first.
ObjProperties.h
Go to the documentation of this file.
1 #ifndef oo_ObjProperties_H__
2 #define oo_ObjProperties_H__
3 
4 #include "ObjBase.h"
5 
6 #include <cstdlib>
7 
8 namespace meow {
9 
10 template<size_t SID>
11 
13 class ObjProperties: public ObjBase {
14 private:
15 public:
16  ObjProperties();
17 
18  ObjProperties(ObjProperties const& p);
19 
20  virtual ~ObjProperties();
21 
22  size_t propertySize() const;
23 
24  bool propertyEmpty() const;
25 
26  void propertyClear();
27 
28  ObjBase const* property(std::string name) const;
29 
30  ObjBase* property(std::string name);
31 
32  bool propertyAdd(std::string name, ObjBase* obj, bool autoRemove);
33 
34  bool propertyDel(std::string name);
35 
36  ObjProperties& properties() const;
37 
39 
40  bool write(FILE* f, bool bin, unsigned int fg) const;
41 
42  bool read(FILE* f, bool bin, unsigned int fg);
43 
44  ObjBase* create() const;
45 
46  ObjBase* copyFrom(ObjBase const* b);
47 
48  char const* ctype() const;
49 
50  std::string type() const;
51 };
52 
53 }
54 
55 #endif // oo_ObjProperties_H__
ObjBase * create() const
回傳一個new出來的物件, 預設implement為直接回傳 NULL
ObjProperties & properties() const
char const * ctype() const
用C-style string回傳這個class的type name
bool propertyDel(std::string name)
virtual ~ObjProperties()
一切物件的Base, 並要求每個物件都要有read, write, create, ... 等功能
Definition: ObjBase.h:15
bool propertyAdd(std::string name, ObjBase *obj, bool autoRemove)
目前擺爛中
Definition: ObjProperties.h:13
bool read(FILE *f, bool bin, unsigned int fg)
將物件從檔案讀出, 預設implement為直接回傳 false
size_t propertySize() const
std::string type() const
用std::string回傳這個class的type name
ObjBase * copyFrom(ObjBase const *b)
複製, 預設使用operator=
bool write(FILE *f, bool bin, unsigned int fg) const
將物件寫入檔案, 預設implement為直接回傳 false
bool propertyEmpty() const
ObjBase const * property(std::string name) const