浏览该文件的文档.
10 #define DECLARE_APIOBJECT(className)\
12 typedef AnyCore::A##className##Ptr ObjectPtr;\
13 static className Null;\
15 className(int, bool);\
16 className(const className::ObjectPtr& implObject)\
20 virtual ~className(){}\
21 virtual bool IsNull() const { return className##Impl_ == 0; }\
22 bool IsValid() const { return !IsNull(); }\
24 ObjectPtr className##Impl_;\
26 const ObjectPtr& GetImpl() const { return className##Impl_; }\
27 void SetImpl(const ObjectPtr& impl) { className##Impl_ = impl; }
29 #define IMPLEMENT_APIOBJECT(className)\
30 className className::Null(1,true);\
31 className::className(int, bool){}
33 #define DECLARE_APISUPER(className, super)\
36 static className Null;\
37 typedef AnyCore::A##className##Ptr ObjectPtr;\
39 className(int, bool);\
40 className(const className::ObjectPtr& implObject)\
44 virtual ~className(){}\
45 virtual bool IsNull() const { return className##Impl_ == 0; }\
46 bool IsValid() const { return !IsNull(); }\
48 ObjectPtr className##Impl_;\
50 const ObjectPtr& GetImpl() const { return className##Impl_; }\
51 void SetImpl(const ObjectPtr& impl);
53 #define IMPLEMENT_APISUPER(className)\
54 className className::Null(1,true);\
55 className::className(int aa,bool bb):Super(aa,bb){}\
56 void className::SetImpl(const ObjectPtr& impl) { Super::SetImpl(impl); className##Impl_ = impl; }
60 #endif // APIObject_h__