61 bool isFinished()
const;
85 void setEnableSerialization(
bool flag );
90 bool getEnableSerialization( )
const;
96 virtual StorageAgent* getStorageAgent()
const = 0;
99 virtual const char* getClassName()
const;
103 static void setEnableUuidGeneration(
bool flag );
106 bool getEnableUuidGeneration( );
143 void setDynamicallyAllocated();
145 bool isDynamicallyAllocated()
const;
165 static StorageAgent* s_storageAgent;
169 DYNAMICALLY_ALLOCATED = 2
185 bool m_serializationEnabled;
186 static bool s_uuidGeneration_enabled;
189 #define AGXSTREAM_CLASS_NAME(T) \
191 inline const char* getClassName() const override { return #T; } \
194 #define AGXSTREAM_DECLARE_SERIALIZABLE_BASE( T ) \
195 inline agxStream::StorageAgent* getStorageAgent() const override { return agxStream::StorageManager::instance()->find( #T ); } \
196 inline static const char* getConstructClassId() { return #T; } \
197 friend class agxStream::DefStorageAgent<T>; \
198 AGXSTREAM_CLASS_NAME(T) \
199 static agxStream::Serializable *create() { return new T(); } \
200 virtual void store( agxStream::OutputArchive& out ) const override;\
201 virtual void restore( agxStream::InputArchive& in ) override
206 #define AGXSTREAM_DECLARE_SERIALIZABLE( T ) \
207 AGXSTREAM_DECLARE_SERIALIZABLE_BASE(T); \
208 static agxStream::Serializable *create(agxStream::InputArchive& ) { return new T(); }
213 #define AGXSTREAM_DECLARE_SERIALIZABLE_CUSTOM_CREATE( T ) \
214 AGXSTREAM_DECLARE_SERIALIZABLE_BASE(T); \
215 static agxStream::Serializable *create(agxStream::InputArchive& in)
220 #define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE( T ) \
221 inline agxStream::StorageAgent* getStorageAgent() const override { return agxStream::StorageManager::instance()->find(#T); } \
222 inline static const char* getConstructClassId() { return #T; } \
223 AGXSTREAM_CLASS_NAME(T)
226 #define AGXSTREAM_INSTANTIATE_STORAGE( C ) \
227 static agxStream::Storage<C> storage ## C;
230 #define AGXSTREAM_INSTANTIATE_STORAGE_VARIABLE( V,C ) \
231 static agxStream::Storage<C> storage ## V;
234 #define AGXARCHIVE_MODIFICATIONS(...) {__VA_ARGS__}
243 #define AGXSTREAM_INSTANTIATE_STORAGE_DEPRECATION_CHECK_VARIABLE( V, DEFAULT_CLASS, DEPRECATED_CLASS, MODIFICATION_LIST ) \
244 static agxStream::DeprecatedStorage<DEFAULT_CLASS, DEPRECATED_CLASS> V(MODIFICATION_LIST);
254 return (m_flags & FINISHED) != 0;
259 return (m_flags & DYNAMICALLY_ALLOCATED) != 0;
275 return m_serializationEnabled;
281 #define AGXSTREAM_DECLARE_SERIALIZABLE( T )
282 #define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE( T )
283 #define AGXSTREAM_DECLARE_SERIALIZABLE_CUSTOM_CREATE( T )
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...
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...
agx::UInt32 getIndex() const
This index is given at creation of this object.
Abstract base class for storing/restoring a line/drums with version control.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
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.
agx::Uuid getUuid() const
bool getEnableSerialization() const
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()