18 #ifndef AGXDATA_HDF5JOURNAL_H 19 #define AGXDATA_HDF5JOURNAL_H 22 #include <agx/config/AGX_USE_HDF5.h> 23 #include <agx/config.h> 32 class Hdf5FrameReader;
33 class Hdf5FrameWriter;
54 Hdf5Journal(
const agx::String& diskPath,
bool readOnlyIfExists=
false);
70 Hdf5Journal::Session* createNewHdf5Session(
const agx::Name& name );
73 agxData::Hdf5Journal::Session* getHdf5Session(
const agx::Name& name );
82 virtual agx::String getCustomFilesPath(
bool create =
true)
const override;
85 virtual agx::String getCustomFilesPath(
const agx::Name& sessionName,
bool create =
true )
const override;
94 virtual ~Hdf5Journal();
100 void readJournalContent();
105 friend class Session;
106 void unlinkSessionData(
const agx::Name& name );
108 H5::Group& getSessionsGroup();
109 H5::H5File* getFile();
113 H5::Group m_sessions;
152 virtual agx::String getScenePath(
bool create =
true)
const override;
162 virtual bool unpackSceneFile()
override;
169 virtual bool packSceneData(std::stringstream& sceneData)
override;
174 virtual bool unpackSceneData(std::stringstream& sceneData)
override;
180 virtual bool packSceneData(std::istream& sceneData)
override;
185 virtual bool unpackSceneData(std::ostream& sceneData)
override;
192 virtual agx::String getCustomFilesPath(
bool create =
true)
const override;
197 virtual bool truncate(
agx::UInt firstFrameToRemove )
override;
202 virtual agxData::Frame::Header getFrameHeader(
agx::UInt frameIndex )
const override;
205 Hdf5Journal* getHdf5Journal();
207 const Hdf5Journal* getHdf5Journal()
const;
212 virtual void savePlot(
const PlotData* plot)
override;
213 virtual void removePlot(
const agx::String& plotName )
override;
214 virtual PlotData* getPlot(
const agx::String& plotName )
override;
215 virtual void getAllPlots( PlotDataRefVector& result )
override;
220 virtual void writeHeader()
override;
221 virtual void finalizeHeader()
override;
225 static agxData::Hdf5Journal::Session* create(
const agx::Name& name, H5::Group& sessions );
228 static agxData::Hdf5Journal::Session* load(
const agx::Name& name, H5::Group& sessionRoot );
231 friend class agxData::Hdf5Journal;
234 bool renameDiskData(
const agx::Name& newName );
236 bool copySessionFolder(
agx::String targetFolderPath,
bool deleteSource =
false );
242 bool copyDiskData( agxData::Hdf5Journal* target );
246 Session(
const agx::Name& name, H5::Group& session );
249 void fixHeader(H5::Group& sessionRoot, H5::Group& header);
254 friend class agxData::Hdf5FrameReader;
255 friend class agxData::Hdf5FrameWriter;
257 H5::Group& getHdf5Node();
258 H5::H5File* getHdf5File();
270 bool unpackSceneDataToStream(std::ostream& sceneData);
275 H5::Group openExtraData(
bool create);
278 struct FrameInfo :
public agxData::Frame::Header
284 void createFrameTable();
286 static herr_t iterateSession(hid_t group_id,
const char * member_name,
const H5L_info_t *,
void* operator_data);
287 static bool compareFrames(
const FrameInfo& lhs,
const FrameInfo& rhs);
296 FrameTable m_frameTable;
Session(const agx::Name &name)
The JournalArchive provides an abstract class for inspecting and manipulating the contents of a creat...
#define AGX_DECLARE_POINTER_TYPES(type)
Representation of a name string.
Contains classes for low level data storage for AGX.