17#ifndef AGXDATA_JOURNALARCHIVE_H
18#define AGXDATA_JOURNALARCHIVE_H
31 class DiskFrameReader;
32 class DiskFrameWriter;
385 void setName(
const agx::Name& newName );
397 bool m_is64BitArchitecture;
398 bool m_isLittleEndian;
422 AGX_FORCE_INLINE bool JournalArchive::Session::is64BitArchitecture()
const {
return m_is64BitArchitecture; }
423 AGX_FORCE_INLINE bool JournalArchive::Session::isLittleEndian()
const {
return m_isLittleEndian; }
#define AGX_DECLARE_POINTER_TYPES(type)
Helper class for the FrameReaders that are backed by a file on disk.
Base class for the FrameReaders that are backed by a file on disk.
The JournalArchive provides an abstract class for inspecting and manipulating the contents of a creat...
bool updateSessionAndTableWithNewName(agxData::JournalArchive::Session *session, const agx::Name &newName)
Change the name of the given session. Will ensure that the session table is kept consistent.
agxData::JournalArchive * getJournal()
virtual bool renameSession(agxData::JournalArchive::Session *session, const agx::Name &newName)=0
Rename the given session to the given new name.
void set64BitArchitecture(bool flag)
void setSimulationHeader(agx::Component *header)
agx::UInt64 getNumFrames() const
virtual DiskFrameWriter * createFrameWriter(agxData::JournalArchive::Session *session)=0
virtual agx::String getCustomFilesPath(const agx::Name &sessionName, bool create=true) const =0
Returns the path to a disk directory where custom files related to the given session may be stored.
void setName(const agx::Name &name)
bool registerSession(agxData::JournalArchive::Session *newSession)
Create the Journal <-> Session coupling.
void setComputationTime(agx::Real64 computationTime)
size_t getNumSessions() const
const agxData::JournalArchive::Session * getSession(const agx::Name &name) const
agx::Real64 getLastFrameTimeStamp() const
void setDate(agx::Date *date)
void set64BitReal(bool flag)
virtual bool unpackSceneFile()=0
Ensure that the scene file for the session is available at the location returned by getScenePath.
virtual agx::String getCustomFilesPath(bool create=true) const =0
Returns the path to a disk directory where custom files related to the journal may be stored.
void setHeaderFormat(SerializedFrame::HeaderFormat format)
Some journal formats support more than one format for frame metadata.
virtual void removePlot(const agx::String &plotName)=0
virtual agx::String getScenePath(bool create=true) const =0
Get the path on disk where the .agx file, called the scene file, containing the initial state of the ...
void setFrameStride(agx::UInt64 stride)
virtual agx::UInt getNextFrameIndex(agx::UInt currentFrameIndex, agx::Int offset) const =0
virtual void finalizeHeader()=0
bool transferSession(agxData::JournalArchive::Session *session, agxData::JournalArchive *target)
Transfer the given session from this journal into the given target.
const agxData::JournalArchive * getJournal() const
virtual bool packSceneData(std::istream &sceneData)=0
Copy the scene data found in the given stringstream into the journal in some format specific way.
void setAgxVersionString(const agx::String &version)
virtual bool unpackSceneData(std::stringstream &sceneData)=0
Copy scene data from the archive, stored in some format specific way, into the given stringstream.
void setFirstFrameTimeStamp(agx::Real64 startTime)
agx::ref_ptr< PlotData > PlotDataRef
bool recordExtraDataAsJSon(const agx::String &key, const agx::String &value)
Store a string key-value pair to the session on disk, without ruining the .
bool retrieveExtraDataAsJSon(const agx::String &key, agx::String &value)
Read back the value associated with the key from disk.
agxNet::StructuredMessage PlotData
agx::Component * getSimulationHeader()
virtual DiskFrameReader * createFrameReader(agxData::JournalArchive::Session *session)=0
virtual agx::String getPath() const =0
Returns a format specific string that identifies the location of this session within a journal.
virtual void getAllPlots(PlotDataRefVector &result)=0
agx::UInt32 getAgxVersionNumber() const
static agx::String generateNameFromCurrentDate()
virtual void getPlotList(agx::StringVector &result)=0
bool isOwnerOf(const agxData::JournalArchive::Session *session) const
agx::Real64 getFirstFrameTimeStamp() const
virtual bool recordExtraData(const agx::String &key, const agx::String &value)=0
Store a string key-value pair to the session on disk.
void setAgxVersionNumber(const agx::UInt32 version)
void setTimeStep(agx::Real64 timeStep)
agxData::JournalArchive::Session * getSession(const agx::Name &name)
agx::String retrieveExtraData(const agx::String &key)
virtual bool packSceneData(std::stringstream &sceneData)=0
Copy the scene data found in the given stringstream into the journal in some format specific way.
void listSessionNames(agx::Vector< agx::Name > &result) const
Add to the end of the given Vector the names of all the sessions in the Journal.
agx::UInt64 getFrameStride() const
bool isLittleEndian() const
const agx::String & getPath() const
void setLastFrameIndex(agx::UInt64 endFrame)
void setFirstFrameIndex(agx::UInt64 startFrame)
const agx::Date * getDate() const
void setLittleEndian(bool flag)
void setPath(const agx::String &path)
const agx::Name & getName() const
agxData::FrameIO * getFrameIO()
virtual bool unpackSceneData(std::ostream &sceneData)=0
Copy scene data from the archive, stored in some format specific way, into the given stringstream.
virtual agxData::Frame::Header getFrameHeader(agx::UInt frameIndex) const =0
Load the header data for a particular frame.
bool copyTo(agxData::JournalArchive *target)
Copy the session to another JournalArchive.
virtual void savePlot(const PlotData *plot)=0
const agx::String & getAgxVersionString() const
bool is64BitArchitecture() const
virtual bool retrieveExtraData(const agx::String &key, agx::String &value)=0
Read back the value associated with the key from disk.
agx::Vector< PlotDataRef > PlotDataRefVector
virtual PlotData * getPlot(const agx::String &plotName)=0
void setFrameIO(agxData::FrameIO *frameIO)
agx::Real64 getComputationTime() const
bool removeSession(const agx::Name &name)
Remove the session with the given name from the journal.
agx::Real64 getTimeStep() const
agx::UInt64 getFirstFrameIndex() const
SerializedFrame::HeaderFormat getHeaderFormat() const
bool transferTo(agxData::JournalArchive *target)
Transfer the session to another JournalArchive. The target JournalArchive must be of the same correct...
virtual void writeHeader()=0
virtual agxData::JournalArchive::Session * makeCopy(agxData::JournalArchive::Session *session)=0
Create a copy of the given session. The copy will have its disk data stored in the current JournalArc...
void setNumFrames(agx::UInt64 numFrames)
virtual agxData::JournalArchive::Session * createNewSession(const agx::Name &name)=0
Create a new session with the given name.
virtual bool truncate(agx::UInt firstFrameToRemove)=0
Remove all frames from the given index and forward.
const SessionTable & getSessions() const
agx::String retrieveExtraDataAsJSon(const agx::String &key)
void setLastFrameTimeStamp(agx::Real64 endTime)
virtual bool removeSession(agxData::JournalArchive::Session *session)=0
Remove the given session from the journal.
bool rename(const agx::Name &name)
bool unregisterSession(agxData::JournalArchive::Session *removedSession)
Remove the Journal <-> Session coupling.
Session(const agx::Name &name)
bool copySession(agxData::JournalArchive::Session *session, agxData::JournalArchive *target)
Copy the given session from this journal into the given target journal.
agx::UInt64 getLastFrameIndex() const
virtual ~JournalArchive()
agx::HashTable< agx::Name, agxData::JournalArchive::SessionRef > SessionTable
JournalArchive(const agx::Name &name, const agx::String &path)
A component is an object containing other objects, enabling hierarchical structuring.
Inheritance with partial specialization due to bug with ref_ptr containers.
Representation of a name string.
Base class providing referencing counted objects.
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.