| 29 | namespace TEngine { |
| 30 | |
| 31 | class BaseObject : public Attribute |
| 32 | { |
| 33 | public: |
| 34 | bool RealExistClassAttr(const std::string& name) const |
| 35 | { |
| 36 | return ClassAttr()->ExistAttr(name); |
| 37 | } |
| 38 | |
| 39 | any& RealGetClassAttr(const std::string& name) |
| 40 | { |
| 41 | return ClassAttr()->GetAttr(name); |
| 42 | } |
| 43 | |
| 44 | const any& RealGetClassAttr(const std::string& name) const |
| 45 | { |
| 46 | return ClassAttr()->GetAttr(name); |
| 47 | } |
| 48 | |
| 49 | std::vector<std::string> RealListClassAttr(void) const |
| 50 | { |
| 51 | std::vector<std::string> result; |
| 52 | |
| 53 | result = ClassAttr()->ListAttr(); |
| 54 | |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | virtual bool ExistClassAttr(const std::string& name) const |
| 59 | { |
| 60 | return RealExistClassAttr(name); |
| 61 | } |
| 62 | |
| 63 | virtual const any& GetClassAttr(const std::string& name) const |
| 64 | { |
| 65 | return RealGetClassAttr(name); |
| 66 | } |
| 67 | |
| 68 | virtual any& GetClassAttr(const std::string& name) |
| 69 | { |
| 70 | return RealGetClassAttr(name); |
| 71 | } |
| 72 | |
| 73 | virtual void SetClassAttr(const std::string& name, const any& val) |
| 74 | { |
| 75 | ClassAttr()->SetAttr(name, val); |
| 76 | } |
| 77 | |
| 78 | virtual std::vector<std::string> ListClassAttr(void) const |
| 79 | { |
| 80 | return RealListClassAttr(); |
| 81 | } |
| 82 | |
| 83 | bool ExistAttr(const std::string& name) const override |
| 84 | { |
| 85 | if(dict_map_.count(name)) |
| 86 | return true; |
| 87 | |
| 88 | if(ExistClassAttr(name)) |