|
AGXDynamics
2.31.1.0
|
XML version of an input archive for restoring data written with the XMLOutputArchive. More...
#include <XMLInputArchive.h>
Inheritance diagram for agxStream::XMLInputArchive:Classes | |
| struct | StackElement |
Public Types | |
| typedef agx::HashTable < agx::UInt, bool > | BuildConfigurationTable |
| typedef agx::Vector< std::string > | IdToClassNameVector |
| typedef agx::VectorPOD < Serializable * > | IdToObjectVector |
| typedef agx::Vector < StorageAgent * > | IdToStorageAgentVector |
| typedef agx::Event3 < agx::UInt32, Serializable *, const std::string & > | RestoreEvent |
| enum | RestoreMode { TRY_BY_VALUE, TRY_BY_REFERENCE, DEFAULT = TRY_BY_REFERENCE } |
Public Member Functions | |
| XMLInputArchive (std::istream &inputStream) | |
| Constructor creating a XMLInputArchive for reading XML streams. More... | |
| XMLInputArchive (std::istream &inputStream, IdToObjectVector &idCache, IdToClassNameVector &nameCache) | |
| bool | addRestoreListener (RestoreListener *listener) |
| Add a listener that will be called for each restored Serializable object. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| virtual void | beginSection (const char *title) |
| virtual void | close () |
| virtual void | endSection (const char *title) |
| bool | eof () const |
| agx::String | getAppName () const |
| agx::String | getArchiveDate () const |
| virtual void | getAttribute (const char *name, std::string &value) |
| virtual void | getAttribute (const char *name, float &value) |
| virtual void | getAttribute (const char *name, double &value) |
| virtual void | getAttribute (const char *name, bool &value) |
| virtual void | getAttribute (const char *name, char &value) |
| virtual void | getAttribute (const char *name, agx::Int8 &value) |
| virtual void | getAttribute (const char *name, agx::UInt8 &value) |
| virtual void | getAttribute (const char *name, agx::UInt16 &value) |
| virtual void | getAttribute (const char *name, agx::UInt32 &value) |
| virtual void | getAttribute (const char *name, agx::Int32 &value) |
| virtual void | getAttribute (const char *name, agx::UInt64 &value) |
| virtual void | getAttribute (const char *name, agx::Uuid &value) |
| bool | getBinaryMode () const |
| agx::String | getBuildDate () const |
| const BuildConfigurationTable & | getBuildFlags () const |
| agx::String | getBuildTime () const |
| bool | getEndianMatch () const |
| agx::String | getErrorMessage (const agx::String &message) |
| agx::UInt8 | getGenerationVersion () const |
| agx::UInt8 | getMajorVersion () const |
| agx::UInt8 | getMinorVersion () const |
| virtual size_t | getNumBytesRead () const |
| int | getNumObjectsRead () const |
| agx::UInt8 | getPatchVersion () const |
| int | getReferenceCount () const |
| RestoreMode | getRestoreMode () const |
| agx::String | getRevision () const |
| agx::UInt16 | getSerializationVersion () const |
| std::istream & | getStream () |
| Return a reference to the inputstream. More... | |
| size_t | getVersion () const |
| bool | hasModification (const char *str) const |
| bool | hasModifications (const agx::StringVector &modifications) const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isOpen () const |
| virtual void | newAttribute () |
| Called whenever a new item is initiated. More... | |
| void | open () |
| virtual void | read (char &val) |
| virtual void | read (bool &val) |
| virtual void | read (agx::Int8 &val) |
| virtual void | read (agx::UInt8 &val) |
| virtual void | read (agx::Int16 &val) |
| virtual void | read (agx::UInt16 &val) |
| virtual void | read (agx::Vec3d &val) |
| virtual void | read (agx::Vec3f &val) |
| virtual void | read (agx::Uuid &val) |
| virtual void | read (agx::UInt32 &val) |
| virtual void | read (agx::Int32 &val) |
| virtual void | read (std::string &val) |
| virtual void | read (agx::UInt64 &val) |
| virtual void | read (agx::Int64 &val) |
| virtual void | read (float &val) |
| virtual void | read (double &val) |
| virtual void | read (void *buf, size_t size) |
| This method will read raw data from the archive. More... | |
| virtual void | read (agx::RangeReal &val) |
| virtual void | read (agx::Vec2f &val) |
| virtual void | read (agx::Vec2d &val) |
| virtual void | read (agx::Vec2i32 &val) |
| virtual void | read (agx::Vec2i64 &val) |
| virtual void | read (agx::Vec3i32 &val) |
| virtual void | read (agx::Vec3i64 &val) |
| virtual void | read (agx::Vec4f &val) |
| virtual void | read (agx::Vec4d &val) |
| virtual void | read (agx::Quat &val) |
| virtual void | read (agx::SPDMatrix3x3 &val) |
| virtual void | read (agx::Matrix3x3d &val) |
| virtual void | read (agx::Matrix3x3f &val) |
| virtual void | read (agx::AffineMatrix4x4f &val) |
| virtual void | read (agx::AffineMatrix4x4d &val) |
| virtual void | read (agx::String &val) |
| virtual void | read (agx::Name &val) |
| template<typename VECTOR_TYPE > | |
| AGXCORE_EXPORT void | read_vector (const agx::String &name, VECTOR_TYPE &val) |
| Read an array of data. More... | |
| Serializable * | readObjectByRef () |
| bool | readObjectByVal (Serializable &obj) |
| template<typename T > | |
| void | readRef (T **obj, StorageMode mode) |
| void | readVal (Serializable &obj, StorageMode mode) |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| bool | removeRestoreListener (RestoreListener *listener) |
| Remove a RestoreListener. More... | |
| void | setBinaryMode (bool m) |
| void | setFinished () |
| Must be called when archive is de-serialized successfully. More... | |
| void | setRestoreMode (RestoreMode mode) |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Public Attributes | |
| RestoreEvent | restoreEvent |
Protected Types | |
| typedef agx::HashTable < RestoreListener *, RestoreListenerRef > | RestoreListenerHash |
Protected Member Functions | |
| virtual | ~XMLInputArchive () |
| Destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| void | eof (bool flag) |
| agx::TiXmlElement * | getElement (const char *variable) |
| agx::String | getSerializationVersionStringMessage () const |
| agx::String | getVersionStringMessage () const |
| void | init () |
| virtual void | readArchiveHeader () |
| void | readCompareBitSize () |
| void | readHeaderData () |
| virtual void | readObjectHeader (StorageMode &storageMode, StorageAgent *&agent) |
| virtual void | readTypeHeader (StorageAgent *&agent) |
| bool | removeObject (Serializable *object) |
| Remove the serialized object from list. More... | |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| agx::TiXmlElement * | m_currentElement |
| std::string | m_currTitle |
| IdToClassNameVector | m_defaultNameCache |
| IdToObjectVector | m_defaultObjectCache |
| agx::TiXmlDocument * | m_document |
| IdToClassNameVector & | m_idToClassNameVector |
| IdToObjectVector & | m_IdToObjectVector |
| IdToStorageAgentVector | m_IdToStorageAgentVector |
| std::istream & | m_inputStream |
| bool | m_isOpen |
| agx::TiXmlNode * | m_lastNode |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| RestoreListenerHash | m_restoreListeners |
| agx::Vector< StackElement > | m_sectionStack |
| std::stringstream | m_stringBuf |
XML version of an input archive for restoring data written with the XMLOutputArchive.
Definition at line 43 of file XMLInputArchive.h.
|
inherited |
Definition at line 114 of file InputArchive.h.
|
inherited |
Definition at line 60 of file InputArchive.h.
|
inherited |
Definition at line 59 of file InputArchive.h.
|
inherited |
Definition at line 61 of file InputArchive.h.
|
inherited |
Definition at line 55 of file InputArchive.h.
|
protectedinherited |
Definition at line 303 of file InputArchive.h.
|
inherited |
Definition at line 218 of file InputArchive.h.
| agxStream::XMLInputArchive::XMLInputArchive | ( | std::istream & | inputStream | ) |
Constructor creating a XMLInputArchive for reading XML streams.
Data will be read from the inputStream during the constructor.
| agxStream::XMLInputArchive::XMLInputArchive | ( | std::istream & | inputStream, |
| IdToObjectVector & | idCache, | ||
| IdToClassNameVector & | nameCache | ||
| ) |
|
protectedvirtual |
Destructor.
|
inherited |
Add a listener that will be called for each restored Serializable object.
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
Reimplemented in agxStream::OutputArchive, and agxStream::XMLOutputArchive.
|
protectedinherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
|
inlineinherited |
Definition at line 357 of file InputArchive.h.
Referenced by agxStream::RestoreObjects< T >::RestoreObjects().
|
inlineprotectedinherited |
Definition at line 361 of file InputArchive.h.
|
inherited |
|
inherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
staticprotectedinherited |
|
protected |
|
inherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
|
inherited |
|
inherited |
|
inherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
Return a reference to the inputstream.
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
modifications is represented in the current archive
|
protected |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inlineinherited |
|
inlinevirtualinherited |
|
inherited |
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
|
virtual |
Reimplemented from agxStream::InputArchive.
This method will read raw data from the archive.
Notice that you should always have called beginSection() prior to calling this method. Otherwise it is not compatible with XML input
| buf | - Pointer to the buffer where data will be read |
| size | - Number of bytes to read |
Reimplemented from agxStream::InputArchive.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
inherited |
Read an array of data.
Only works for agx::VectorPOD<> types.
| name | - name of the vector data |
| val | - Target of the read vector data. |
|
protectedvirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedvirtualinherited |
|
inlineinherited |
Definition at line 178 of file InputArchive.h.
References agxThrow, agx::AgXString< std::string >::format(), agxStream::Serializable::getClassName(), and agxStream::STORE_BY_REF.
Referenced by agxStream::operator>>().
|
protectedvirtualinherited |
|
inherited |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
|
protectedinherited |
Remove the serialized object from list.
|
inherited |
Remove a RestoreListener.
|
inlineinherited |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inherited |
Must be called when archive is de-serialized successfully.
If not, all dynamically allocated objects will be deleted.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
protected |
Definition at line 139 of file XMLInputArchive.h.
|
protected |
Definition at line 138 of file XMLInputArchive.h.
|
protectedinherited |
Definition at line 295 of file InputArchive.h.
|
protectedinherited |
Definition at line 293 of file InputArchive.h.
|
protected |
Definition at line 121 of file XMLInputArchive.h.
|
protectedinherited |
Definition at line 296 of file InputArchive.h.
|
protectedinherited |
Definition at line 294 of file InputArchive.h.
|
protectedinherited |
Definition at line 297 of file InputArchive.h.
|
protectedinherited |
Definition at line 292 of file InputArchive.h.
|
protected |
Definition at line 140 of file XMLInputArchive.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protectedinherited |
Definition at line 304 of file InputArchive.h.
|
protected |
Definition at line 136 of file XMLInputArchive.h.
|
protected |
Definition at line 137 of file XMLInputArchive.h.
|
inherited |
Definition at line 56 of file InputArchive.h.