10 #if !defined(CONTACT_PROPERTIES_EXTENSIONS_H_INCLUDED)
11 #define CONTACT_PROPERTIES_EXTENSIONS_H_INCLUDED
13 #if !defined(DECLARE_HAS_THIS_TYPE_PROPERTIES)
14 #define DECLARE_HAS_THIS_TYPE_PROPERTIES \
15 template<class TVariable> \
16 static bool HasProperty(TVariable const& rV, Properties::Pointer& p) \
21 #define DECLARE_HAS_THIS_TYPE_PROPERTIES_PYTHON(TClassName) \
22 .def_static("HasProperty", &TClassName::HasProperty< Variable< TClassName > >)
24 #define DECLARE_HAS_THIS_TYPE_PROPERTIES_PYTHON_AS_POINTER(TClassName) \
25 .def_static("HasProperty", &TClassName::HasProperty< Variable< TClassName::Pointer > >)
28 #if !defined(DECLARE_ADD_THIS_TYPE_TO_PROPERTIES)
29 #define DECLARE_ADD_THIS_TYPE_TO_PROPERTIES \
30 template<class TVariable> \
31 static void AddToProperties(TVariable const& rV, typename TVariable::Type const& rValue, Properties::Pointer& p) \
33 p->SetValue(rV, rValue); \
36 #define DECLARE_ADD_THIS_TYPE_TO_PROPERTIES_PYTHON(TClassName) \
37 .def_static("AddToProperties", &TClassName::AddToProperties< Variable< TClassName > >)
40 #define DECLARE_ADD_THIS_TYPE_TO_PROPERTIES_PYTHON_AS_POINTER(TClassName) \
41 .def_static("AddToProperties", &TClassName::AddToProperties< Variable< TClassName::Pointer > >)
44 #if !defined(DECLARE_GET_THIS_TYPE_FROM_PROPERTIES)
45 #define DECLARE_GET_THIS_TYPE_FROM_PROPERTIES \
46 template<class TVariable> \
47 static typename TVariable::Type GetFromProperties(TVariable const& rV, Properties::Pointer& p) \
49 return p->GetValue(rV); \
52 #define DECLARE_GET_THIS_TYPE_FROM_PROPERTIES_PYTHON(TClassName) \
53 .def_static("GetFromProperties", &TClassName::GetFromProperties< Variable< TClassName > >)
55 #define DECLARE_GET_THIS_TYPE_FROM_PROPERTIES_PYTHON_AS_POINTER(TClassName) \
56 .def_static("GetFromProperties", &TClassName::GetFromProperties< Variable< TClassName::Pointer > >)