00001 // 00002 // Copyright (c) 2003 00003 // Paul Hamilton; pHamtec P/L 00004 // 00005 // Permission to use, copy, modify, distribute and sell this software 00006 // and its documentation for any purpose is hereby granted without fee, 00007 // provided that the above copyright notice appears in all copies and 00008 // that both the copyright notice and this permission notice appear in 00009 // supporting documentation. No representations are made about the 00010 // suitability of this software for any purpose. It is provided "as is" 00011 // without express or implied warranty. 00012 // 00013 // bar.cpp 00014 // 00015 // 4-Jul-2003 phamilton Created 00016 // 00017 00018 #include "bar.hpp" 00019 #include "../member.hpp" 00020 #include "../member_visitor.hpp" 00021 #include "../object_visitor.hpp" 00022 00023 using namespace ph::reflect; 00024 using namespace reflect_test; 00025 00026 bool bar::accept(ph::common::member_visitor *v) 00027 { 00028 if (!base::accept(v)) 00029 return false; 00030 pod_member<int> _x(&x); 00031 if (!v->visit(this, "x", &_x)) 00032 return false; 00033 pod_member<double> _y(&y); 00034 if (!v->visit(this, "y", &_y)) 00035 return false; 00036 pod_member<int> _z(&z); 00037 if (!v->visit(this, "z", &_z)) 00038 return false; 00039 return true; 00040 } 00041 00042 bool bar::accept(ph::common::const_member_visitor *v) const 00043 { 00044 if (!base::accept(v)) 00045 return false; 00046 const_pod_member<int> _x(&x); 00047 if (!v->visit(this, "x", &_x)) 00048 return false; 00049 const_pod_member<double> _y(&y); 00050 if (!v->visit(this, "y", &_y)) 00051 return false; 00052 const_pod_member<int> _z(&z); 00053 if (!v->visit(this, "z", &_z)) 00054 return false; 00055 return true; 00056 } 00057 00058 bool bar::accept(ph::common::object_visitor *v) 00059 { 00060 if (!base::accept(v)) 00061 return false; 00062 if (!v->visit(this)) 00063 return false; 00064 return true; 00065 } 00066 00067 bool bar::accept(ph::common::const_object_visitor *v) const 00068 { 00069 if (!base::accept(v)) 00070 return false; 00071 if (!v->visit(this)) 00072 return false; 00073 return true; 00074 }