92 std::ostream&
getStream() {
return m_outputStream; }
97 void open(
const std::string& appName);
103 return m_numObjectsWritten;
110 return m_numObjectsSkipped;
117 static void setUseCurrentDate(
bool flag);
123 bool getUseCurrentDate();
125 virtual void write(
char val);
126 virtual void write(
bool val);
143 virtual void write(
float val);
144 virtual void write(
double val);
146 virtual void write(
const std::string& val);
179 virtual void addAttribute(
const char *name,
bool value);
180 virtual void addAttribute(
const char *name,
const char* value);
181 virtual void addAttribute(
const char *name,
char value);
182 virtual void addAttribute(
const char *name,
agx::Int8 value);
183 virtual void addAttribute(
const char *name,
agx::UInt8 value);
184 virtual void addAttribute(
const char *name,
agx::UInt16 value);
185 virtual void addAttribute(
const char *name,
agx::Int32 value);
186 virtual void addAttribute(
const char *name,
agx::UInt32 value);
187 virtual void addAttribute(
const char *name,
agx::UInt64 value);
188 virtual void addAttribute(
const char *name,
float value);
189 virtual void addAttribute(
const char *name,
double value);
190 virtual void addAttribute(
const char *name,
const agx::Uuid& value);
193 virtual void addAttribute(
const char *name,
size_t value) { addAttribute(name, (
agx::UInt64)value); }
197 return m_endianMatch == 1;
214 virtual void write(
const void* buf,
size_t len);
220 void close()
override;
236 bool addModification(
const char *str);
241 bool hasModification(
const agx::String& modification)
const;
248 template<
typename VECTOR_TYPE>
263 const std::string& appName,
268 const std::string& revision,
271 virtual void writeArchiveHeader(
const std::string& appName,
276 const std::string& revision,
279 virtual void writeObjectHeader(
StorageMode mode, StorageAgent* agent);
280 virtual void writeTypeHeader(StorageAgent* agent);
304 void addModifications();
305 void writeModificationData();
306 bool m_hasAddedModifications;
307 static bool s_useCurrentDate;
314 template <
typename T>
347 template <
typename T>
359 #define DECLARE_OUTPUT_BASIC_TYPE(TYPE) \ 360 AGXCORE_EXPORT inline agxStream::OutputArchive& operator<<( OutputArchive& out, OutputVal<TYPE> val ) \ 362 out.beginSection(val.m_name); \ 363 out.write( val.m_obj ); \ 364 out.endSection(val.m_name); \ 367 AGXCORE_EXPORT inline OutputVal<TYPE> out(const char *name, TYPE obj) { return OutputVal<TYPE>(name, obj); } 423 template <
typename T>
427 template <
typename T>
430 out.beginSection(val.m_name);
431 out.write(val.m_obj, val.m_mode);
432 out.endSection(val.m_name);
436 template <
typename T>
439 out.beginSection(val.m_name);
440 out.write(val.m_obj);
441 out.endSection(val.m_name);
Inheritance with partial specialization due to bug with ref_ptr containers.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
A class holding 4 dimensional vectors and providing basic arithmetic.
ObjectToIdMapContext & m_objectToIdMap
OutputRef(const char *name, const T &obj, StorageMode mode)
StorageAgentToIdMap m_storageAgentToIdMap
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
OutputRef< T > out_val(const char *name, const T &obj)
Return an object that contain the name and the object that should be serialized to an archive...
Representation of a name string.
agx::Event2< const Serializable *, agx::UInt32 > StoreEvent
This struct is used to handle id-collisions when using incremental journal.
#define DECLARE_OUTPUT_BASIC_TYPE(TYPE)
agx::HashTable< StorageAgent *, agx::UInt32 > StorageAgentToIdMap
OutputVal & operator=(const OutputVal &other)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
virtual void write(const agx::Name &val)
Matrix class for rigid transformations (translation, rotation).
Specialized type of matrices for holding symmetric positive definite matrices.
int getNumObjectsSkipped() const
Abstract base class for input/output storage of Serializable classes.
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
std::ostream & getStream()
Return a reference to the output stream.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
bool getEndianMatch() const
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
IdEntry(agx::UInt32 _id=agx::InvalidIndex)
OutputRef & operator=(const OutputRef &other)
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
OutputRef(const char *name, const T *obj, StorageMode mode)
Inheritance with partial specialization due to bug with ref_ptr containers.
ObjectToIdMapContext m_defaultCache
virtual void beginSection(const char *) override
agx::ref_ptr< OutputArchive > OutputArchiveRef
virtual void endSection(const char *) override
int getNumObjectsWritten() const
std::ostream & m_outputStream
OutputVal(const char *name, const T obj)
agx::HashTable< const Serializable *, IdEntry > ObjectToIdMap