本文整理汇总了C++中reflect::ObjectPtr::IsA方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::IsA方法的具体用法?C++ ObjectPtr::IsA怎么用?C++ ObjectPtr::IsA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reflect::ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::IsA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanAdd
///////////////////////////////////////////////////////////////////////////////
// Returns true if the specified item can be added to the array. This is
// determined by checking to make sure that the item derived from the common
// base class that was specified earlier.
//
bool ClipboardElementArray::CanAdd( const Reflect::ObjectPtr& item ) const
{
if ( !item.ReferencesObject() )
{
return false;
}
return item->IsA( GetCommonBaseClass() );
}
示例2: CacheResource
//.........这里部分代码省略.........
{
continue;
}
const Resource::PreprocessedData& rVariantData = pVariant->GetPreprocessedData(
static_cast< Cache::EPlatform >( platformIndex ) );
HELIUM_ASSERT( rVariantData.bLoaded );
const DynamicArray< DynamicArray< uint8_t > >& rVariantSubDataBuffers = rVariantData.subDataBuffers;
size_t variantSubDataCount = rVariantSubDataBuffers.GetSize();
HELIUM_ASSERT( variantSubDataCount != 0 );
HELIUM_ASSERT( variantSubDataCount % shaderProfileCount == 0 );
size_t systemOptionSetCount = variantSubDataCount / shaderProfileCount;
for( size_t profileIndex = 0; profileIndex < shaderProfileCount; ++profileIndex )
{
// Get the first option set of each profile
const DynamicArray< uint8_t >& rVariantSubData =
rVariantSubDataBuffers[ profileIndex * systemOptionSetCount ];
Reflect::ObjectPtr variantSubDataObjectPtr =
Cache::ReadCacheObjectFromBuffer(rVariantSubData);
if (!variantSubDataObjectPtr.ReferencesObject())
{
HELIUM_TRACE(
TraceLevels::Error,
"MaterialResourceHandler: A shader variant subdata could not be read. (Option Set: %d Profile: %d)",
0,
profileIndex );
failedToWriteASubdata = true;
}
else if (!variantSubDataObjectPtr->IsA(Reflect::GetMetaClass<CompiledShaderData>()))
{
HELIUM_TRACE(
TraceLevels::Error,
"MaterialResourceHandler: A shader variant subdata was of an unexpected type. (Option Set: %d Profile: %d)\n",
0,
profileIndex );
failedToWriteASubdata = true;
}
else
{
CompiledShaderData &csd = *Reflect::AssertCast<CompiledShaderData>(variantSubDataObjectPtr.Get());
size_t bufferCount = csd.constantBuffers.GetSize();
for( size_t bufferIndex = 0; bufferIndex < bufferCount; ++bufferIndex )
{
const ShaderConstantBufferInfo& rBufferInfo = csd.constantBuffers[ bufferIndex ];
if( rBufferInfo.name != parameterConstantBufferName )
{
continue;
}
size_t bufferSize = rBufferInfo.size;
DynamicArray< uint8_t >& rMaterialSubData =
rSubDataBuffers[ profileIndex * RShader::TYPE_MAX + shaderTypeIndex ];
rMaterialSubData.Clear();
rMaterialSubData.Reserve( bufferSize );
rMaterialSubData.Add( 0, bufferSize );