16 #ifndef AGXSTREAM_INPUT_ARCHIVE_H 17 #define AGXSTREAM_INPUT_ARCHIVE_H 20 # pragma warning(push) 21 # pragma warning( disable : 4290 ) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) 65 InputArchive(std::istream& inputStream, IdToObjectVector& objectCache, IdToClassNameVector& nameCache);
82 std::istream& getStream();
116 const BuildConfigurationTable& getBuildFlags()
const;
119 size_t getVersion()
const;
121 virtual void read(
char& val);
122 virtual void read(
bool& val);
131 virtual void read(std::string& val);
134 virtual void read(
float& val);
135 virtual void read(
double& val);
138 virtual void read(
size_t& val );
170 virtual void read(
void* buf,
size_t len);
184 sObj = readObjectByRef();
186 *obj =
dynamic_cast<T*
>(sObj);
187 if (sObj != 0 && *obj == 0) {
190 T::getConstructClassId());
213 int getNumObjectsRead()
const;
216 bool getEndianMatch()
const;
222 DEFAULT = TRY_BY_REFERENCE
228 virtual void beginSection(
const char* title)
override;
229 virtual void endSection(
const char* title)
override;
231 virtual void getAttribute(
const char *name,
double& value);
232 virtual void getAttribute(
const char *name,
float& value);
233 virtual void getAttribute(
const char *name,
bool& value);
234 virtual void getAttribute(
const char *name, std::string& value);
235 virtual void getAttribute(
const char *name,
char& value);
236 virtual void getAttribute(
const char *name,
agx::UInt16& value);
237 virtual void getAttribute(
const char *name,
agx::UInt64& value);
238 virtual void getAttribute(
const char *name,
agx::UInt32& value);
239 virtual void getAttribute(
const char *name,
agx::Int32& value);
240 virtual void getAttribute(
const char *name,
agx::Int8& value);
241 virtual void getAttribute(
const char *name,
agx::UInt8& value);
242 virtual void getAttribute(
const char *name,
agx::Uuid& value);
245 virtual void getAttribute(
const char *name,
size_t& value);
251 bool hasModification(
const char *str)
const;
267 template<
typename VECTOR_TYPE>
275 void readCompareBitSize();
277 virtual void readArchiveHeader();
278 virtual void readObjectHeader(
StorageMode& storageMode, StorageAgent*& agent);
279 virtual void readTypeHeader(StorageAgent*& agent);
282 virtual size_t getNumBytesRead()
const;
286 friend class StorageAgent;
315 agx::String getSerializationVersionStringMessage()
const;
317 void readHeaderData();
322 void readCorrectNumBytes(T& val);
330 BuildConfigurationTable m_buildFlags;
334 agx::UInt8 m_generationVersion, m_majorVersion, m_minorVersion, m_patchVersion;
338 size_t m_numBytesRead;
339 int m_numObjectsRead;
350 void readModificationData();
366 template <
typename T>
379 template <
typename T>
399 template <
typename T>
410 template <
typename T>
414 #define DECLARE_INPUT_BASIC_TYPE(TYPE) \ 415 AGXCORE_EXPORT inline agxStream::InputArchive& operator>>( InputArchive& in, InputVal<TYPE> val ) \ 417 in.beginSection(val.m_name); \ 418 in.read( val.m_obj ); \ 419 in.endSection(val.m_name); \ 422 inline InputVal<TYPE> in(const char *name, TYPE& obj) { return InputVal<TYPE>(name, obj); } 461 template <
typename T>
469 template <
typename T>
493 observerPtr = object;
499 # pragma warning(pop)
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
bool AGXPHYSICS_EXPORT read(const std::string &filename, agxStream::SerializablePtrVector &readObjects)
Open and read serializable objects from a file on disk with previously stored objects.
Inheritance with partial specialization due to bug with ref_ptr containers.
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
A class holding 4 dimensional vectors and providing basic arithmetic.
void restoreRefPtr(agxStream::InputArchive &in, const char *name, agx::ref_ptr< T > &refPtr)
Representation of a name string.
void restoreObserverPtr(agxStream::InputArchive &in, const char *name, agx::observer_ptr< T > &observerPtr)
agx::ref_ptr< InputArchive > InputArchiveRef
Matrix class for rigid transformations (translation, rotation).
Specialized type of matrices for holding symmetric positive definite matrices.
Abstract base class for input/output storage of Serializable classes.
InputVal< T > in_val(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored.
virtual const char * getClassName() const
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Class for listening to the restore of Serializable objects.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
Inheritance with partial specialization due to bug with ref_ptr containers.
InputArchive & operator>>(InputArchive &in, InputVal< T > val)
static AgXString format(const char *format,...)
C printf formatting of a string.