add Callback API in ExporterProperties

This commit is contained in:
Yingying Wang
2020-06-09 11:20:48 -07:00
parent ce838dfafb
commit 578a7ac502
2 changed files with 87 additions and 64 deletions

View File

@@ -580,10 +580,24 @@ ExportProperties::ExportProperties(const ExportProperties &other)
: mIntProperties(other.mIntProperties)
, mFloatProperties(other.mFloatProperties)
, mStringProperties(other.mStringProperties)
, mMatrixProperties(other.mMatrixProperties) {
, mMatrixProperties(other.mMatrixProperties)
//wangyi 0608
, mCallbackProperties(other.mCallbackProperties){
// empty
}
//wangyi 0608
bool ExportProperties::SetPropertyCallback(const char *szName, std::function<void *(void *)> &f) {
return SetGenericProperty<std::function<void *(void *)>>(mCallbackProperties, szName, f);
}
std::function<void *(void *)> ExportProperties::GetPropertyCallback(const char *szName) const {
return GetGenericProperty<std::function<void *(void *)>>(mCallbackProperties, szName, 0);
}
//wangyi 0608
bool ExportProperties::HasPropertyCallback(const char *szName) const {
return HasGenericProperty<std::function<void *(void *)>>(mCallbackProperties, szName);
}
// ------------------------------------------------------------------------------------------------
// Set a configuration property
bool ExportProperties::SetPropertyInteger(const char* szName, int iValue) {