00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GENERIC_PROPERTY_DEF_HH
00021 #define GENERIC_PROPERTY_DEF_HH
00022
00023 #include <ost/log.hh>
00024
00025
00026
00027
00028 template <typename C>
00029 String depr_get_string_a(C& c, const String& k, const String& v)
00030 {
00031 LOGN_MESSAGE("GetGenericStringProperty is deprecated. Use GetStringProp");
00032 return c.GetStringProp(k, v);
00033 }
00034
00035 template <typename C>
00036 String depr_get_string_b(C& c, const String& k)
00037 {
00038 LOGN_MESSAGE("GetGenericStringProperty is deprecated. Use GetStringProp");
00039 return c.GetStringProp(k);
00040 }
00041
00042 template <typename C>
00043 void depr_set_string(C& c, const String& k, const String& v)
00044 {
00045 LOGN_MESSAGE("SetGenericStringProperty is deprecated. Use SetStringProp");
00046 return c.SetStringProp(k, v);
00047 }
00048
00049 template <typename C>
00050 int depr_get_int_a(C& c, const String& k, const int& v)
00051 {
00052 LOGN_MESSAGE("GetGenericIntProperty is deprecated. Use GetIntProp");
00053 return c.GetIntProp(k, v);
00054 }
00055
00056 template <typename C>
00057 int depr_get_int_b(C& c, const String& k)
00058 {
00059 LOGN_MESSAGE("GetGenericIntProperty is deprecated. Use GetIntProp");
00060 return c.GetIntProp(k);
00061 }
00062
00063 template <typename C>
00064 void depr_set_int(C& c, const String& k, const int& v)
00065 {
00066 LOGN_MESSAGE("SetGenericIntProperty is deprecated. Use SetIntProp");
00067 return c.SetIntProp(k, v);
00068 }
00069
00070 template <typename C>
00071 bool depr_get_bool_a(C& c, const String& k, const bool& v)
00072 {
00073 LOGN_MESSAGE("GetGenericBoolProperty is deprecated. Use GetBoolProp");
00074 return c.GetBoolProp(k, v);
00075 }
00076
00077 template <typename C>
00078 bool depr_get_bool_b(C& c, const String& k)
00079 {
00080 LOGN_MESSAGE("GetGenericBoolProperty is deprecated. Use GetBoolProp");
00081 return c.GetBoolProp(k);
00082 }
00083
00084 template <typename C>
00085 void depr_set_bool(C& c, const String& k, const bool& v)
00086 {
00087 LOGN_MESSAGE("SetGenericBoolProperty is deprecated. Use SetBoolProp");
00088 return c.SetBoolProp(k, v);
00089 }
00090
00091 template <typename C>
00092 Real depr_get_float_a(C& c, const String& k, const float& v)
00093 {
00094 LOGN_MESSAGE("GetGenericFloatProperty is deprecated. Use GetFloatProp");
00095 return c.GetFloatProp(k, v);
00096 }
00097
00098 template <typename C>
00099 Real depr_get_float_b(C& c, const String& k)
00100 {
00101 LOGN_MESSAGE("GetGenericFloatProperty is deprecated. Use GetFloatProp");
00102 return c.GetFloatProp(k);
00103 }
00104
00105 template <typename C>
00106 void depr_set_float(C& c, const String& k, const Real& v)
00107 {
00108 LOGN_MESSAGE("SetGenericFloatProperty is deprecated. Use SetFloatProp");
00109 return c.SetFloatProp(k, v);
00110 }
00111
00112 template <typename C>
00113 void depr_clear_props(C& c)
00114 {
00115 LOGN_MESSAGE("ClearGenericProperties is deprecated. Use ClearProps");
00116 c.ClearProps();
00117 }
00118
00119 template <typename C>
00120 bool depr_has_prop(C& c, const String& k)
00121 {
00122 LOGN_MESSAGE("HasGenericProperty is deprecated. Use HasProp");
00123 return c.HasProp(k);
00124 }
00125
00126 template <typename C>
00127 String depr_prop_as_string(C& c, const String& k)
00128 {
00129 LOGN_MESSAGE("GetGenericPropertyStringRepresentation is deprecated. Use GetPropAsString");
00130 return c.GetPropAsString(k);
00131 }
00132
00133 template <typename C, typename O>
00134 void const_generic_prop_def(O& bp_class)
00135 {
00136 bool (C::*get_bool1)(const String&, bool) const=&C::GetBoolProp;
00137 bool (C::*get_bool2)(const String&) const=&C::GetBoolProp;
00138
00139 int (C::*get_int1)(const String&, int) const=&C::GetIntProp;
00140 int (C::*get_int2)(const String&) const=&C::GetIntProp;
00141
00142 Real (C::*get_float1)(const String&, Real) const=&C::GetFloatProp;
00143 Real (C::*get_float2)(const String&) const=&C::GetFloatProp;
00144
00145 String (C::*get_str1)(const String&, const String&) const=&C::GetStringProp;
00146 String (C::*get_str2)(const String&) const=&C::GetStringProp;
00147 bp_class
00148 .def("HasProp", &C::HasProp)
00149 .def("GetPropAsString",
00150 &C::GetPropAsString)
00151 .def("GetBoolProp", get_bool1)
00152 .def("GetBoolProp", get_bool2)
00153 .def("GetFloatProp", get_float1)
00154 .def("GetFloatProp", get_float2)
00155 .def("GetIntProp", get_int1)
00156 .def("GetIntProp", get_int2)
00157 .def("GetStringProp", get_str1)
00158 .def("GetStringProp", get_str2)
00159 .def("GetGenericBoolProperty", &depr_get_bool_a<C>)
00160 .def("GetGenericBoolProperty", &depr_get_bool_b<C>)
00161 .def("GetGenericFloatProperty", &depr_get_float_a<C>)
00162 .def("GetGenericFloatProperty", &depr_get_float_b<C>)
00163 .def("GetGenericIntProperty", &depr_get_int_a<C>)
00164 .def("GetGenericIntProperty", &depr_get_int_b<C>)
00165 .def("GetGenericStringProperty", &depr_get_string_a<C>)
00166 .def("GetGenericStringProperty", &depr_get_string_b<C>)
00167 .def("HasGenericProperty", &depr_has_prop<C>)
00168 .def("GetGenericPropertyStringRepresentation", &depr_prop_as_string<C>)
00169 ;
00170 }
00171
00172 template <typename C, typename O>
00173 void generic_prop_def(O& bp_class)
00174 {
00175 const_generic_prop_def<C, O>(bp_class);
00176 bp_class
00177 .def("SetBoolProp",&C::SetBoolProp)
00178 .def("ClearProps", &C::ClearProps)
00179 .def("GetPropAsString", &C::GetPropAsString)
00180 .def("SetFloatProp", &C::SetFloatProp)
00181 .def("SetIntProp", &C::SetIntProp)
00182 .def("SetStringProp", &C::SetStringProp)
00183 .def("ClearGenericProperties", &depr_clear_props<C>)
00184 .def("SetGenericIntProperty", &depr_set_int<C>)
00185 .def("SetGenericFloatProperty", &depr_set_float<C>)
00186 .def("SetGenericBoolProperty", &depr_set_bool<C>)
00187 .def("SetGenericStringProperty", &depr_set_string<C>)
00188 ;
00189 }
00190
00191 #endif