本文整理汇总了C++中Binding::CallListeners方法的典型用法代码示例。如果您正苦于以下问题:C++ Binding::CallListeners方法的具体用法?C++ Binding::CallListeners怎么用?C++ Binding::CallListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Binding
的用法示例。
在下文中一共展示了Binding::CallListeners方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetValue
//--------------------------------------------------------------------------------------
HRESULT BoundValueTable::SetValue( BindAddressHandle handle, const Value* pValue )
{
Binding* binding = NULL;
if(!GetOrAddBinding(&binding, handle, false))
return E_FAIL;
if(binding->bPromoteToParent)
{
BindAddressInfo info;
BindAddressHelper::GetInfo( handle, &info );
Sas::Host::Out( Sas::LEVEL_ERROR, L"Cannot set value on BindAddress that is promoted to parent, %s", info.StrAddress.c_str() );
return E_FAIL;
}
const Value*& pOldValue = binding->pValue;
// If the current value is equal to the value being set, nothing needs to be done
if( Value::Equal( pOldValue, pValue ) )
return S_OK;
// The old value needs to be deallocated before proceeding with the rest of the set.
SAFE_DELETE(pOldValue);
// Clone and store the new value
Value* pNewValue = NULL;
if( NULL != pValue )
{
pNewValue = pValue->Clone();
if( NULL == pNewValue )
return E_OUTOFMEMORY;
}
// Set the value
binding->pValue = pNewValue;
binding->CallListeners( handle );
return S_OK;
}