本文整理汇总了C++中FArchive::IsObjectReferenceCollector方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::IsObjectReferenceCollector方法的具体用法?C++ FArchive::IsObjectReferenceCollector怎么用?C++ FArchive::IsObjectReferenceCollector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FArchive
的用法示例。
在下文中一共展示了FArchive::IsObjectReferenceCollector方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Serialize
bool FLevelSequenceObjectReferenceMap::Serialize(FArchive& Ar)
{
int32 Num = Map.Num();
Ar << Num;
if (Ar.IsLoading())
{
while(Num-- > 0)
{
FGuid Key;
Ar << Key;
FLevelSequenceObjectReference Value;
Ar << Value;
Map.Add(Key, Value);
}
}
else if (Ar.IsSaving() || Ar.IsCountingMemory() || Ar.IsObjectReferenceCollector())
{
for (auto& Pair : Map)
{
Ar << Pair.Key;
Ar << Pair.Value;
}
}
return true;
}
示例2: Serialize
void UClassProperty::Serialize( FArchive& Ar )
{
Super::Serialize( Ar );
Ar << MetaClass;
#if USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if (Ar.IsLoading() || Ar.IsObjectReferenceCollector())
{
if (ULinkerPlaceholderClass* PlaceholderClass = Cast<ULinkerPlaceholderClass>(MetaClass))
{
PlaceholderClass->AddReferencingProperty(this);
}
}
#endif // USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if( !(MetaClass||HasAnyFlags(RF_ClassDefaultObject)) )
{
// If we failed to load the MetaClass and we're not a CDO, that means we relied on a class that has been removed or doesn't exist.
// The most likely cause for this is either an incomplete recompile, or if content was migrated between games that had native class dependencies
// that do not exist in this game. We allow blueprint classes to continue, because compile on load will error out, and stub the class that was using it
UClass* TestClass = dynamic_cast<UClass*>(GetOwnerStruct());
if( TestClass && TestClass->HasAllClassFlags(CLASS_Native) && !TestClass->HasAllClassFlags(CLASS_NewerVersionExists) && (TestClass->GetOutermost() != GetTransientPackage()) )
{
checkf(false, TEXT("Class property tried to serialize a missing class. Did you remove a native class and not fully recompile?"));
}
}
}
示例3: Serialize
bool FEdGraphPinType::Serialize(FArchive& Ar)
{
if (Ar.UE4Ver() < VER_UE4_EDGRAPHPINTYPE_SERIALIZATION)
{
return false;
}
Ar << PinCategory;
Ar << PinSubCategory;
// See: FArchive& operator<<( FArchive& Ar, FWeakObjectPtr& WeakObjectPtr )
// The PinSubCategoryObject should be serialized into the package.
if(!Ar.IsObjectReferenceCollector() || Ar.IsModifyingWeakAndStrongReferences() || Ar.IsPersistent())
{
UObject* Object = PinSubCategoryObject.Get(true);
Ar << Object;
if( Ar.IsLoading() || Ar.IsModifyingWeakAndStrongReferences() )
{
PinSubCategoryObject = Object;
}
}
Ar << bIsArray;
Ar << bIsReference;
Ar << bIsWeakPointer;
if (Ar.UE4Ver() >= VER_UE4_MEMBERREFERENCE_IN_PINTYPE)
{
Ar << PinSubCategoryMemberReference;
}
else if (Ar.IsLoading() && Ar.IsPersistent())
{
if ((PinCategory == TEXT("delegate")) || (PinCategory == TEXT("mcdelegate")))
{
if (const UFunction* Signature = Cast<const UFunction>(PinSubCategoryObject.Get()))
{
PinSubCategoryMemberReference.MemberName = Signature->GetFName();
PinSubCategoryMemberReference.MemberParent = Signature->GetOwnerClass();
PinSubCategoryObject = NULL;
}
else
{
ensure(true);
}
}
}
if (Ar.UE4Ver() >= VER_UE4_SERIALIZE_PINTYPE_CONST)
{
Ar << bIsConst;
}
else if (Ar.IsLoading())
{
bIsConst = false;
}
return true;
}
示例4: Serialize
void UDelegateProperty::Serialize( FArchive& Ar )
{
Super::Serialize( Ar );
Ar << SignatureFunction;
#if USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if (Ar.IsLoading() || Ar.IsObjectReferenceCollector())
{
if (auto PlaceholderFunc = Cast<ULinkerPlaceholderFunction>(SignatureFunction))
{
PlaceholderFunc->AddReferencingProperty(this);
}
}
#endif // USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
}
示例5: Serialize
void UObjectPropertyBase::Serialize( FArchive& Ar )
{
Super::Serialize( Ar );
Ar << PropertyClass;
#if USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
if (Ar.IsLoading() || Ar.IsObjectReferenceCollector())
{
if (ULinkerPlaceholderClass* PlaceholderClass = Cast<ULinkerPlaceholderClass>(PropertyClass))
{
PlaceholderClass->AddReferencingProperty(this);
}
}
#endif // USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
}
示例6: Serialize
// UObject interface.
void UTransBuffer::Serialize( FArchive& Ar )
{
check( !Ar.IsPersistent() );
CheckState();
Super::Serialize( Ar );
if ( IsObjectSerializationEnabled() || !Ar.IsObjectReferenceCollector() )
{
Ar << UndoBuffer;
}
Ar << ResetReason << UndoCount << ActiveCount << ActiveRecordCounts;
CheckState();
}
示例7: SerializeItem
void ULazyObjectProperty::SerializeItem( FArchive& Ar, void* Value, void const* Defaults ) const
{
// We never serialize our reference while the garbage collector is harvesting references
// to objects, because we don't want lazy pointers to keep objects from being garbage collected
if( !Ar.IsObjectReferenceCollector() || Ar.IsModifyingWeakAndStrongReferences() )
{
UObject* ObjectValue = GetObjectPropertyValue(Value);
Ar << *(FLazyObjectPtr*)Value;
if ((Ar.IsLoading() || Ar.IsModifyingWeakAndStrongReferences()) && ObjectValue != GetObjectPropertyValue(Value))
{
CheckValidObject(Value);
}
}
}
示例8: SerializeItem
void UAssetObjectProperty::SerializeItem( FArchive& Ar, void* Value, int32 MaxReadBytes, void const* Defaults ) const
{
// We never serialize our reference while the garbage collector is harvesting references
// to objects, because we don't want asset pointers to keep objects from being garbage collected
if( !Ar.IsObjectReferenceCollector() || Ar.IsModifyingWeakAndStrongReferences() )
{
FAssetPtr OldValue = *(FAssetPtr*)Value;
Ar << *(FAssetPtr*)Value;
if (Ar.IsLoading() || Ar.IsModifyingWeakAndStrongReferences())
{
if (OldValue.GetUniqueID() != ((FAssetPtr*)Value)->GetUniqueID())
{
CheckValidObject(Value);
}
}
}
}
示例9: SerializeItem
void UAssetObjectProperty::SerializeItem( FArchive& Ar, void* Value, void const* Defaults ) const
{
// We never serialize our reference while the garbage collector is harvesting references
// to objects, because we don't want asset pointers to keep objects from being garbage collected
// Allow persistent archives so they can keep track of string references. (e.g. FArchiveSaveTagImports)
if( !Ar.IsObjectReferenceCollector() || Ar.IsModifyingWeakAndStrongReferences() || Ar.IsPersistent() )
{
FAssetPtr OldValue = *(FAssetPtr*)Value;
Ar << *(FAssetPtr*)Value;
if (Ar.IsLoading() || Ar.IsModifyingWeakAndStrongReferences())
{
if (OldValue.GetUniqueID() != ((FAssetPtr*)Value)->GetUniqueID())
{
CheckValidObject(Value);
}
}
}
}
示例10: Serialize
// UObject interface.
void UTransBuffer::Serialize( FArchive& Ar )
{
check( !Ar.IsPersistent() );
CheckState();
// Handle garbage collection.
Super::Serialize( Ar );
// We cannot support undoing across GC if we allow it to eliminate references so we need
// to suppress it.
if ( IsObjectSerializationEnabled() || !Ar.IsObjectReferenceCollector() )
{
Ar.AllowEliminatingReferences( false );
Ar << UndoBuffer;
Ar.AllowEliminatingReferences( true );
}
Ar << ResetReason << UndoCount << ActiveCount;
CheckState();
}
示例11: Serialize
/**
* Serialize function used to serialize this bulk data structure.
*
* @param Ar Archive to serialize with
* @param Owner Object owning the bulk data
* @param Idx Index of bulk data item being serialized
*/
void FUntypedBulkData::Serialize( FArchive& Ar, UObject* Owner, int32 Idx )
{
check( LockStatus == LOCKSTATUS_Unlocked );
if(Ar.IsTransacting())
{
// Special case for transacting bulk data arrays.
// constructing the object during load will save it to the transaction buffer. If it tries to load the bulk data now it will try to break it.
bool bActuallySave = Ar.IsSaving() && (!Owner || !Owner->HasAnyFlags(RF_NeedLoad));
Ar << bActuallySave;
if (bActuallySave)
{
if(Ar.IsLoading())
{
// Flags for bulk data.
Ar << BulkDataFlags;
// Number of elements in array.
Ar << ElementCount;
// Allocate bulk data.
check(bShouldFreeOnEmpty);
BulkData = FMemory::Realloc( BulkData, GetBulkDataSize() );
// Deserialize bulk data.
SerializeBulkData( Ar, BulkData );
}
else if(Ar.IsSaving())
{
// Flags for bulk data.
Ar << BulkDataFlags;
// Number of elements in array.
Ar << ElementCount;
// Don't attempt to load or serialize BulkData if the current size is 0.
// This could be a newly constructed BulkData that has not yet been loaded,
// and allocating 0 bytes now will cause a crash when we load.
if (GetBulkDataSize() > 0)
{
// Make sure bulk data is loaded.
MakeSureBulkDataIsLoaded();
// Serialize bulk data.
SerializeBulkData(Ar, BulkData);
}
}
}
}
else if( Ar.IsPersistent() && !Ar.IsObjectReferenceCollector() && !Ar.ShouldSkipBulkData() )
{
#if TRACK_BULKDATA_USE
FThreadSafeBulkDataToObjectMap::Get().Add( this, Owner );
#endif
// Offset where the bulkdata flags are stored
int64 SavedBulkDataFlagsPos = Ar.Tell();
Ar << BulkDataFlags;
// Number of elements in array.
Ar << ElementCount;
// We're loading from the persistent archive.
if( Ar.IsLoading() )
{
Filename = TEXT("");
// @todo when Landscape (and others?) only Lock/Unlock once, we can enable this
if (false) // FPlatformProperties::RequiresCookedData())
{
// Bulk data that is being serialized via seekfree loading is single use only. This allows us
// to free the memory as e.g. the bulk data won't be attached to an archive in the case of
// seek free loading.
BulkDataFlags |= BULKDATA_SingleUse;
}
// Size on disk, which in the case of compression is != GetBulkDataSize()
Ar << BulkDataSizeOnDisk;
Ar << BulkDataOffsetInFile;
// fix up the file offset
if (Owner != NULL && Owner->GetLinker())
{
BulkDataOffsetInFile += Owner->GetLinker()->Summary.BulkDataStartOffset;
}
// determine whether the payload is stored inline or at the end of the file
bool bPayloadInline = !(BulkDataFlags&BULKDATA_PayloadAtEndOfFile);
// check( (bPayloadInline && BulkDataOffsetInFile == Ar.Tell()) ||
// (!bPayloadInline && BulkDataOffsetInFile > Ar.Tell()));
//.........这里部分代码省略.........