src/core/attribute-accessor-helper.h
changeset 2950 9e20fb862cd8
parent 2724 62557689f8f9
child 2965 4b28e9740e3b
equal deleted inserted replaced
2949:a42da8051124 2950:9e20fb862cd8
   100       }
   100       }
   101       virtual bool DoGet (const T *object, V *v) const {
   101       virtual bool DoGet (const T *object, V *v) const {
   102 	v->Set (object->*m_memberVariable);
   102 	v->Set (object->*m_memberVariable);
   103 	return true;
   103 	return true;
   104       }
   104       }
       
   105       virtual bool HasGetter (void) const {
       
   106         return true;
       
   107       }
       
   108       virtual bool HasSetter (void) const {
       
   109         return true;
       
   110       }
   105       
   111       
   106       U T::*m_memberVariable;
   112       U T::*m_memberVariable;
   107     };
   113     };
   108   return Ptr<const AttributeAccessor> (new MemberVariable (memberVariable), false);
   114   return Ptr<const AttributeAccessor> (new MemberVariable (memberVariable), false);
   109 }
   115 }
   125       }
   131       }
   126       virtual bool DoGet (const T *object, V *v) const {
   132       virtual bool DoGet (const T *object, V *v) const {
   127 	v->Set ((object->*m_getter) ());
   133 	v->Set ((object->*m_getter) ());
   128 	return true;
   134 	return true;
   129       }
   135       }
       
   136       virtual bool HasGetter (void) const {
       
   137         return true;
       
   138       }
       
   139       virtual bool HasSetter (void) const {
       
   140         return false;
       
   141       }
   130       U (T::*m_getter) (void) const;
   142       U (T::*m_getter) (void) const;
   131     };
   143     };
   132   return Ptr<const AttributeAccessor> (new MemberMethod (getter), false);
   144   return Ptr<const AttributeAccessor> (new MemberMethod (getter), false);
   133 }
   145 }
   134 
   146 
   149 	(object->*m_setter) (U (v->Get ()));
   161 	(object->*m_setter) (U (v->Get ()));
   150 	return true;
   162 	return true;
   151       }
   163       }
   152       virtual bool DoGet (const T *object, V *v) const {
   164       virtual bool DoGet (const T *object, V *v) const {
   153 	return false;
   165 	return false;
       
   166       }
       
   167       virtual bool HasGetter (void) const {
       
   168         return false;
       
   169       }
       
   170       virtual bool HasSetter (void) const {
       
   171         return true;
   154       }
   172       }
   155       void (T::*m_setter) (U);
   173       void (T::*m_setter) (U);
   156     };
   174     };
   157   return Ptr<const AttributeAccessor> (new MemberMethod (setter), false);
   175   return Ptr<const AttributeAccessor> (new MemberMethod (setter), false);
   158 }
   176 }
   178       }
   196       }
   179       virtual bool DoGet (const T *object, W *v) const {
   197       virtual bool DoGet (const T *object, W *v) const {
   180 	v->Set ((object->*m_getter) ());
   198 	v->Set ((object->*m_getter) ());
   181 	return true;
   199 	return true;
   182       }
   200       }
       
   201       virtual bool HasGetter (void) const {
       
   202         return true;
       
   203       }
       
   204       virtual bool HasSetter (void) const {
       
   205         return true;
       
   206       }
   183       void (T::*m_setter) (U);
   207       void (T::*m_setter) (U);
   184       V (T::*m_getter) (void) const;
   208       V (T::*m_getter) (void) const;
   185     };
   209     };
   186   return Ptr<const AttributeAccessor> (new MemberMethod (setter, getter), false);
   210   return Ptr<const AttributeAccessor> (new MemberMethod (setter, getter), false);
   187 }
   211 }