本文整理汇总了C++中DynamicArray::Begin方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicArray::Begin方法的具体用法?C++ DynamicArray::Begin怎么用?C++ DynamicArray::Begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicArray
的用法示例。
在下文中一共展示了DynamicArray::Begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForceFullyLoadRootPackages
void ForciblyFullyLoadedPackageManager::ForceFullyLoadRootPackages()
{
DynamicArray< AssetPath > rootPackages;
AssetLoader::GetStaticInstance()->EnumerateRootPackages( rootPackages );
for (DynamicArray< AssetPath >::Iterator iter = rootPackages.Begin();
iter != rootPackages.End(); ++iter)
{
//ForceFullyLoadPackage( *iter );
AssetPtr package;
AssetLoader::GetStaticInstance()->LoadObject( *iter, package );
}
}
示例2: ReplaceAsset
void Asset::ReplaceAsset( Asset* pNewAsset, const AssetPath &objectToReplace )
{
AssetAwareThreadSynchronizer::Lock assetLock;
// Acquire a write lock on the object list to prevent objects from being added and removed as well as keep
// objects from being renamed while this object is being renamed.
ScopeWriteLock scopeLock( sm_objectListLock );
Asset *pOldAsset = Asset::FindObject( objectToReplace );
HELIUM_ASSERT( pNewAsset->GetMetaClass()->IsType( pOldAsset->GetMetaClass() ) );
DynamicArray<AssetFixup> fixups;
// For every asset in existence
for ( SparseArray< AssetWPtr >::Iterator iter = sm_objects.Begin();
iter != sm_objects.End(); ++iter)
{
if ( !iter )
{
continue;
}
Asset* pPossibleFixupAsset = iter->Get();
if ( !pPossibleFixupAsset || pPossibleFixupAsset->IsDefaultTemplate() )
{
continue;
}
// Ignore it if it's the asset we're swapping
if ( pPossibleFixupAsset->m_id == pNewAsset->m_id || pPossibleFixupAsset->m_id == pOldAsset->m_id )
{
continue;
}
// If the asset has the old asset as a template (direct or indirect)
Asset *pTemplate = pPossibleFixupAsset->GetTemplateAsset().Get();
while ( pTemplate && !pTemplate->IsDefaultTemplate() )
{
if ( pTemplate == pOldAsset )
{
// Then save it off
// TODO: Does order matter? Right now we probably want bases first so that changes ripple down the template
// tree but in future we should probably have a flag of some sort to say if a field is set or not. Maybe in tools only.
AssetFixup &fixup = *fixups.New();
fixup.pAsset = pPossibleFixupAsset;
break;
}
pTemplate = pTemplate->GetTemplateAsset().Get();
}
}
const Reflect::MetaStruct *pStruct = pOldAsset->GetMetaClass();
// Get all the bases
// TODO: Declare a max depth for inheritance to save heap allocs -geoff
DynamicArray< const Reflect::MetaStruct* > bases;
for ( const Reflect::MetaStruct* current = pStruct; current != NULL; current = current->m_Base )
{
bases.Push( current );
}
// For all assets that depend on the changing asset
for ( DynamicArray<AssetFixup>::Iterator iter = fixups.Begin();
iter != fixups.End(); ++iter)
{
// Get the template (old) asset's type
Asset *pAsset = iter->pAsset;
// Get all the fields that should be modified due to the base template changing
// TODO: Declare a max count for fields to save heap allocs -geoff
DynamicArray< const Reflect::Field* > fields;
while ( !bases.IsEmpty() )
{
const Reflect::MetaStruct* current = bases.Pop();
DynamicArray< Reflect::Field >::ConstIterator itr = current->m_Fields.Begin();
DynamicArray< Reflect::Field >::ConstIterator end = current->m_Fields.End();
for ( ; itr != end; ++itr )
{
// Field is guaranteed to be in all objects of the template dependency chain
const Reflect::Field* field = &*itr;
// For every field
for ( uint32_t i = 0; i < field->m_Count; ++i )
{
bool isOverridden = false;
Reflect::Pointer assetPointer( field, pAsset, i );
// Is there anywhere in the template chain that the field gets overridden?
Asset *pTemplate = pAsset->GetTemplateAsset();
while ( pTemplate )
{
Reflect::Pointer templatePointer( field, pTemplate, i );
if ( !field->m_Translator->Equals( assetPointer, templatePointer ) )
{
// Yes, bail
isOverridden = true;
break;
//.........这里部分代码省略.........