Example #1
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFTypeDef::pvtGetUInt8Array8Type (
      ImplAAFTypeDef ** ppRawTypeDef)
{
  if (! ppRawTypeDef)
	return AAFRESULT_NULL_PARAM;
  
  ImplAAFDictionarySP pDict;
  AAFRESULT hr = GetDictionary(&pDict);
  if (AAFRESULT_FAILED (hr)) return hr;
  
  return pDict->LookupTypeDef (kAAFTypeID_UInt8Array, ppRawTypeDef);
}
Example #2
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFPropertyDef::GetTypeDef (
      ImplAAFTypeDef ** ppTypeDef) const
{
  if (! ppTypeDef) return AAFRESULT_NULL_PARAM;

  if (! _cachedType)
	{
	  ImplAAFDictionarySP pDict;
	  AAFRESULT hr;

	  hr = GetDictionary(&pDict);
	  if (AAFRESULT_FAILED (hr)) return hr;
	  ASSERTU (pDict);

	  ImplAAFPropertyDef * pNonConstThis =
		  (ImplAAFPropertyDef *) this;
	  aafUID_t typeId = _Type;

	  ImplAAFTypeDef * tmp = 0;
	  hr = pDict->LookupTypeDef (typeId, &tmp);
	  if (AAFRESULT_FAILED (hr))
		return hr;
	  ASSERTU (tmp);
	  if (!_cachedType) {
		pNonConstThis->_cachedType = tmp;
		_cachedType->AcquireReference();
	  }
	  // If lookup caused this to already be put into the cache, just
	  // throw away the current copy (in tmp)
	  tmp->ReleaseReference ();
	  tmp = 0;
	}
  ASSERTU (ppTypeDef);
  *ppTypeDef = _cachedType;
  ASSERTU (*ppTypeDef);
  (*ppTypeDef)->AcquireReference ();

  return AAFRESULT_SUCCESS;
}
Example #3
0
ImplAAFTypeDef* ImplAAFTypeDefExtEnum::NonRefCountedBaseType () const
{
	if(_baseTypeIsCached)
	{
		return _cachedBaseType;
	}
	else
	{	
		ImplAAFTypeDef* result;
		AAFRESULT hr;
		ImplAAFDictionarySP pDict;
		hr = GetDictionary (&pDict);
		ASSERTU (AAFRESULT_SUCCEEDED(hr));
		ASSERTU (pDict);
		
		hr = pDict->LookupTypeDef (kAAFTypeID_AUID, &result);
		ASSERTU (AAFRESULT_SUCCEEDED(hr));
		ASSERTU (result);
 		((ImplAAFTypeDefExtEnum*)this)->_cachedBaseType = result;
 		((ImplAAFTypeDefExtEnum*)this)->_baseTypeIsCached = true;
		return result;
	}
}