|
AGX Dynamics 2.41.2.0
|
Class for writing serialized data in binary format to a stream. More...
#include <OutputArchive.h>
Inheritance diagram for agxStream::OutputArchive:Classes | |
| struct | IdEntry |
| struct | ObjectToIdMapContext |
| This struct is used to handle id-collisions when using incremental journal. More... | |
Public Types | |
| typedef agx::HashTable< const Serializable *, IdEntry > | ObjectToIdMap |
| typedef agx::HashTable< StorageAgent *, agx::UInt32 > | StorageAgentToIdMap |
| typedef agx::Event2< const Serializable *, agx::UInt32 > | StoreEvent |
Public Member Functions | |
| OutputArchive (std::ostream &outputStream) | |
| Create and associate an OutputArchive for writing to an open stream. | |
| OutputArchive (std::ostream &outputStream, ObjectToIdMapContext &cache) | |
| virtual void | addAttribute (const char *name, agx::Int32 value) |
| virtual void | addAttribute (const char *name, agx::Int8 value) |
| virtual void | addAttribute (const char *name, agx::UInt16 value) |
| virtual void | addAttribute (const char *name, agx::UInt32 value) |
| virtual void | addAttribute (const char *name, agx::UInt64 value) |
| virtual void | addAttribute (const char *name, agx::UInt8 value) |
| virtual void | addAttribute (const char *name, bool value) |
| virtual void | addAttribute (const char *name, char value) |
| virtual void | addAttribute (const char *name, const agx::Uuid &value) |
| virtual void | addAttribute (const char *name, const char *value) |
| virtual void | addAttribute (const char *name, double value) |
| virtual void | addAttribute (const char *name, float value) |
| bool | addModification (const char *str) |
| Add a modification string that will be stored in the archive. | |
| virtual void | beginSection (const char *) override |
| void | close () override |
| Call flush. | |
| virtual void | endSection (const char *) override |
| void | flush () |
| Make sure all data in buffer is written to associated stream. | |
| bool | getEndianMatch () const |
| int | getNumObjectsSkipped () const |
| int | getNumObjectsWritten () const |
| std::ostream & | getStream () |
| Return a reference to the output stream. | |
| bool | getUseCurrentDate () |
| Return if the current date (and time) at execution time should be used when creating archive, or if the build date should be used. | |
| agx::UInt32 | getWriteBufferSize () const |
| bool | hasModification (const agx::String &modification) const |
| void | open (const std::string &appName) |
| Open a new stream and write an archive header with some version information. | |
| void | setWriteBufferSize (agx::UInt32 bufferSize) |
| Specify a new buffer size for the write buffer. | |
| virtual void | write (agx::Int16 val) |
| virtual void | write (agx::Int32 val) |
| virtual void | write (agx::Int64 val) |
| virtual void | write (agx::Int8 val) |
| virtual void | write (agx::UInt16 val) |
| virtual void | write (agx::UInt32 val) |
| virtual void | write (agx::UInt64 val) |
| virtual void | write (agx::UInt8 val) |
| virtual void | write (bool val) |
| virtual void | write (char val) |
| void | write (const agx::AffineMatrix4x4d &val) |
| void | write (const agx::AffineMatrix4x4f &val) |
| void | write (const agx::Matrix3x3d &val) |
| void | write (const agx::Matrix3x3f &val) |
| virtual void | write (const agx::Name &val) |
| void | write (const agx::Quat &val) |
| void | write (const agx::RangeReal &val) |
| void | write (const agx::SPDMatrix3x3 &val) |
| virtual void | write (const agx::String &val) |
| virtual void | write (const agx::Uuid &val) |
| void | write (const agx::Vec2d &val) |
| void | write (const agx::Vec2f &val) |
| void | write (const agx::Vec2i32 &val) |
| void | write (const agx::Vec2i64 &val) |
| void | write (const agx::Vec3d &val) |
| void | write (const agx::Vec3f &val) |
| void | write (const agx::Vec3i32 &val) |
| void | write (const agx::Vec3i64 &val) |
| void | write (const agx::Vec4d &val) |
| void | write (const agx::Vec4f &val) |
| void | write (const Serializable &serializable, StorageMode mode) |
| void | write (const Serializable *serializable, StorageMode mode) |
| virtual void | write (const std::string &val) |
| virtual void | write (const void *buf, size_t len) |
| This method will write raw data into the archive. | |
| virtual void | write (double val) |
| virtual void | write (float val) |
| template<typename VECTOR_TYPE > | |
| AGXCORE_EXPORT void | write_vector (const agx::String &name, const VECTOR_TYPE &val) |
| Write an array of data. | |
| virtual void | writeObjectByRef (const Serializable *obj) |
| virtual void | writeObjectByVal (const Serializable &obj) |
Public Member Functions inherited from agxStream::Archive | |
| Archive () | |
| virtual void | beginSection (const char *)=0 |
| virtual void | close () |
| virtual void | endSection (const char *)=0 |
| bool | getBinaryMode () const |
| bool | isOpen () const |
| virtual void | newAttribute () |
| Called whenever a new item is initiated. | |
| void | setBinaryMode (bool m) |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Static Public Member Functions | |
| static void | setUseCurrentDate (bool flag) |
| Specify if the current date (and time) at execution time should be used when creating archive, or if the build date should be used. | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Public Attributes | |
| StoreEvent | storeEvent |
Protected Member Functions | |
| OutputArchive () | |
| OutputArchive (const OutputArchive &) | |
| virtual | ~OutputArchive () |
| Destructor. | |
| OutputArchive & | operator= (const OutputArchive &) |
| virtual void | writeArchiveHeader (const std::string &appName, agx::UInt8 generationVersion, agx::UInt8 majorVersion, agx::UInt8 minorVersion, agx::UInt8 patchVersion, const std::string &revision, agx::UInt16 serializationVersion) |
| void | writeBitSize () |
| virtual void | writeHeaderData (agx::UInt32 magic, const std::string &appName, agx::UInt8 generationVersion, agx::UInt8 majorVersion, agx::UInt8 minorVersion, agx::UInt8 patchVersion, const std::string &revision, agx::UInt16 serializationVersion) |
| virtual void | writeObjectHeader (StorageMode mode, StorageAgent *agent) |
| virtual void | writeTypeHeader (StorageAgent *agent) |
Protected Member Functions inherited from agxStream::Archive | |
| virtual | ~Archive () |
| Destructor. | |
| void | open () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Attributes | |
| ObjectToIdMapContext | m_defaultCache |
| int | m_numObjectsSkipped |
| int | m_numObjectsWritten |
| ObjectToIdMapContext & | m_objectToIdMap |
| std::ostream & | m_outputStream |
| StorageAgentToIdMap | m_storageAgentToIdMap |
Protected Attributes inherited from agxStream::Archive | |
| bool | m_isOpen |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Class for writing serialized data in binary format to a stream.
Definition at line 56 of file OutputArchive.h.
| typedef agx::HashTable< const Serializable*, IdEntry > agxStream::OutputArchive::ObjectToIdMap |
Definition at line 68 of file OutputArchive.h.
| typedef agx::HashTable< StorageAgent*, agx::UInt32 > agxStream::OutputArchive::StorageAgentToIdMap |
Definition at line 69 of file OutputArchive.h.
| typedef agx::Event2<const Serializable *, agx::UInt32> agxStream::OutputArchive::StoreEvent |
Definition at line 59 of file OutputArchive.h.
| agxStream::OutputArchive::OutputArchive | ( | std::ostream & | outputStream | ) |
Create and associate an OutputArchive for writing to an open stream.
| agxStream::OutputArchive::OutputArchive | ( | std::ostream & | outputStream, |
| ObjectToIdMapContext & | cache | ||
| ) |
|
protected |
|
protectedvirtual |
Destructor.
|
protected |
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
Referenced by agxStream::StoreObjects< T >::~StoreObjects().
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
| bool agxStream::OutputArchive::addModification | ( | const char * | str | ) |
Add a modification string that will be stored in the archive.
This method need to be called before the open method (because thats when the header is written).
|
inlineoverridevirtual |
Implements agxStream::Archive.
Reimplemented in agxStream::XMLOutputArchive.
Definition at line 200 of file OutputArchive.h.
Referenced by agxStream::StoreObjects< T >::~StoreObjects().
|
overridevirtual |
|
inlineoverridevirtual |
Implements agxStream::Archive.
Reimplemented in agxStream::XMLOutputArchive.
Definition at line 201 of file OutputArchive.h.
Referenced by agxStream::StoreObjects< T >::~StoreObjects().
| void agxStream::OutputArchive::flush | ( | ) |
Make sure all data in buffer is written to associated stream.
|
inline |
Definition at line 196 of file OutputArchive.h.
|
inline |
Definition at line 109 of file OutputArchive.h.
|
inline |
Definition at line 102 of file OutputArchive.h.
|
inline |
Return a reference to the output stream.
Definition at line 92 of file OutputArchive.h.
| bool agxStream::OutputArchive::getUseCurrentDate | ( | ) |
Return if the current date (and time) at execution time should be used when creating archive, or if the build date should be used.
| agx::UInt32 agxStream::OutputArchive::getWriteBufferSize | ( | ) | const |
| bool agxStream::OutputArchive::hasModification | ( | const agx::String & | modification | ) | const |
modification hash | void agxStream::OutputArchive::open | ( | const std::string & | appName | ) |
Open a new stream and write an archive header with some version information.
|
protected |
|
static |
Specify if the current date (and time) at execution time should be used when creating archive, or if the build date should be used.
Default is enabled.
| void agxStream::OutputArchive::setWriteBufferSize | ( | agx::UInt32 | bufferSize | ) |
Specify a new buffer size for the write buffer.
Default = 8192 bytes A call to this method will flush the buffer to the stream if bufferSize is less than the current size
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
References agxStream::write().
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
| void agxStream::OutputArchive::write | ( | const agx::AffineMatrix4x4d & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::AffineMatrix4x4f & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Matrix3x3d & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Matrix3x3f & | val | ) |
|
inlinevirtual |
Reimplemented in agxStream::XMLOutputArchive.
Definition at line 148 of file OutputArchive.h.
References agxStream::write().
| void agxStream::OutputArchive::write | ( | const agx::Quat & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::RangeReal & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::SPDMatrix3x3 & | val | ) |
|
virtual |
Reimplemented in agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
| void agxStream::OutputArchive::write | ( | const agx::Vec2d & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec2f & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec2i32 & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec2i64 & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec3d & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec3f & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec3i32 & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec3i64 & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec4d & | val | ) |
| void agxStream::OutputArchive::write | ( | const agx::Vec4f & | val | ) |
| void agxStream::OutputArchive::write | ( | const Serializable & | serializable, |
| StorageMode | mode | ||
| ) |
| void agxStream::OutputArchive::write | ( | const Serializable * | serializable, |
| StorageMode | mode | ||
| ) |
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
This method will write raw data into the archive.
Notice that you should always have called beginSection() prior to calling this method. Otherwise it is not compatible with XML output.
| buf | - Pointer to the data to be written |
| len | - Number of bytes to write |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
|
virtual |
Reimplemented in agxStream::XMLOutputArchive, and agxStream::XMLOutputArchive.
| AGXCORE_EXPORT void agxStream::OutputArchive::write_vector | ( | const agx::String & | name, |
| const VECTOR_TYPE & | val | ||
| ) |
Write an array of data.
Only works for agx::VectorPOD<> types.
| name | - name of the vector data |
| val | - The array data to be written. |
|
protectedvirtual |
|
protected |
|
protectedvirtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Definition at line 286 of file OutputArchive.h.
|
protected |
Definition at line 292 of file OutputArchive.h.
|
protected |
Definition at line 291 of file OutputArchive.h.
|
protected |
Definition at line 287 of file OutputArchive.h.
|
protected |
Definition at line 285 of file OutputArchive.h.
|
protected |
Definition at line 288 of file OutputArchive.h.
| StoreEvent agxStream::OutputArchive::storeEvent |
Definition at line 60 of file OutputArchive.h.