#include <ObjectStream.h>
Inherits AZ::DataStream.
|
enum | FilterFlags { FILTERFLAG_STRICT = 1 << 0
, FILTERFLAG_IGNORE_UNKNOWN_CLASSES = 1 << 1
} |
|
typedef AZStd::function< void(void **, const SerializeContext::ClassData **, const Uuid &, SerializeContext *)> | InplaceLoadRootInfoCB |
|
typedef AZStd::function< void(void *, const Uuid &, SerializeContext *) > | ClassReadyCB |
| Called for each root object loaded.
|
|
typedef AZStd::function< void(Handle, bool) > | CompletionCB |
| Called to indicate that loading has completed.
|
|
enum | StreamType { ST_XML
, ST_JSON
, ST_BINARY
, ST_MAX
} |
|
|
virtual bool | WriteClass (const void *classPtr, const Uuid &classId, const SerializeContext::ClassData *classData=nullptr)=0 |
|
virtual bool | Finalize ()=0 |
| returns true if successfully flushed and closed the object stream, false otherwise
|
|
template<typename T > |
bool | WriteClass (const T *obj, const char *elemName=nullptr) |
| Writes a root object. Call this inside the ClassWriterCB.
|
|
StreamType | GetType () const |
|
void | SetType (StreamType fmt) |
|
◆ InplaceLoadRootInfoCB
Allows the user to provide information about the root element for in-place loading. Can be asked to provide once of two things
- Parameters
-
rootAddress | when this is not null, you need to provide the address for inplace loading. If you return null the default object factory will be called (like if you did not provide the callback) |
classData | if the class Uuid can't be find in the serializeContext (only in very special cases, like generics in-place loading), you will be asked to provide classData. |
classId | provided to you for information |
context | provided to you for information |
◆ FilterFlags
Filter flags control the overall behavior of the serialize operation and can cause it to skip over unnecessary data (the default) or instead throw an error and fail if any error is encountered.
Enumerator |
---|
FILTERFLAG_STRICT | If the FILTERFLAG_STRICT flag is set, the serialization operation will return false (failure to deserialize) if ANY error has occurred at all even non-fatal errors. So any kind of issue - asset missing, unknown class, non-deprecatd class, container failure, even things which it can continue reading through and ignore safely, will cause it to return false for the entire serialization. This should only be used in cases where the incoming data is EXPECTED to be 100% pristine (network payloads sent between clients of the same version for example)
Note that even in non-strict mode, if errors are encountered, they will still be emitted as errors, but the serializer will continue and not return "false" for the entire operation just becuase of a single recoverable error.
|
FILTERFLAG_IGNORE_UNKNOWN_CLASSES | if FILTERFLAG_IGNORE_UNKNOWN_CLASSES is set, deprecated or unrecognized classes will be SILENTLY ignored with no error output. this is only to be rarely used, when reading data you know contains classes that you want to ignore silently, not for ignoring errors in general.
|
The documentation for this class was generated from the following file:
- Code/Framework/AzCore/AzCore/Serialization/ObjectStream.h