|
AGXDynamics
2.31.1.0
|
The FileJournal provides a way to inspect and manipulate a journal created by the FileFrameWriter and stored on disk. More...
#include <FileJournal.h>
Inheritance diagram for agxData::FileJournal:Public Types | |
| typedef agxNet::StructuredMessage | PlotData |
| typedef agx::ref_ptr< PlotData > | PlotDataRef |
| typedef agx::Vector< PlotDataRef > | PlotDataRefVector |
| typedef agx::observer_ptr < const Session > | SessionConstObserver |
| typedef agx::ref_ptr< const Session > | SessionConstRef |
| typedef agx::observer_ptr < Session > | SessionObserver |
| typedef agx::ref_ptr< Session > | SessionRef |
| typedef agx::HashTable < agx::Name, agxData::JournalArchive::SessionRef > | SessionTable |
Public Member Functions | |
| FileJournal (const agx::String &diskPath) | |
| Open a journal on disk. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| bool | copySession (agxData::JournalArchive::Session *session, agxData::JournalArchive *target) |
| Copy the given session from this journal into the given target journal. More... | |
| bool | copyTo (agxData::JournalArchive *target) |
| Copy the session to another JournalArchive. More... | |
| virtual DiskFrameReader * | createFrameReader (JournalArchive::Session *session) override |
| virtual DiskFrameReader * | createFrameReader (agxData::JournalArchive::Session *session)=0 |
| virtual DiskFrameWriter * | createFrameWriter (JournalArchive::Session *session) override |
| virtual DiskFrameWriter * | createFrameWriter (agxData::JournalArchive::Session *session)=0 |
| virtual JournalArchive::Session * | createNewSession (const agx::Name &name) override |
| Create a new session within the journal. More... | |
| virtual void | finalizeHeader ()=0 |
| agx::UInt32 | getAgxVersionNumber () const |
| const agx::String & | getAgxVersionString () const |
| virtual void | getAllPlots (PlotDataRefVector &result)=0 |
| agx::Real64 | getComputationTime () const |
| virtual agx::String | getCustomFilesPath (bool create=true) const override |
| virtual agx::String | getCustomFilesPath (const agx::Name &sessionName, bool create=true) const override |
| const agx::Date * | getDate () const |
| agxData::FileJournal::Session * | getFileSession (const agx::Name &name) |
| agx::UInt64 | getFirstFrameIndex () const |
| agx::Real64 | getFirstFrameTimeStamp () const |
| virtual agxData::Frame::Header | getFrameHeader (agx::UInt frameIndex) const =0 |
| Load the header data for a particular frame. More... | |
| agxData::FrameIO * | getFrameIO () |
| agx::UInt64 | getFrameStride () const |
| SerializedFrame::HeaderFormat | getHeaderFormat () const |
| agxData::JournalArchive * | getJournal () |
| const agxData::JournalArchive * | getJournal () const |
| agx::UInt64 | getLastFrameIndex () const |
| agx::Real64 | getLastFrameTimeStamp () const |
| const agx::Name & | getName () const |
| const agx::Name & | getName () const |
| virtual agx::UInt | getNextFrameIndex (agx::UInt currentFrameIndex, agx::Int offset) const =0 |
| agx::UInt64 | getNumFrames () const |
| size_t | getNumSessions () const |
| const agx::String & | getPath () const |
| virtual agx::String | getPath () const =0 |
| Returns a format specific string that identifies the location of this session within a journal. More... | |
| virtual PlotData * | getPlot (const agx::String &plotName)=0 |
| virtual void | getPlotList (agx::StringVector &result)=0 |
| int | getReferenceCount () const |
| 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 simulation may be stored. More... | |
| agxData::JournalArchive::Session * | getSession (const agx::Name &name) |
| const agxData::JournalArchive::Session * | getSession (const agx::Name &name) const |
| const SessionTable & | getSessions () const |
| agx::Component * | getSimulationHeader () |
| agx::Real64 | getTimeStep () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | is64BitArchitecture () const |
| bool | is64BitReal () const |
| bool | isLittleEndian () const |
| bool | isOwnerOf (const agxData::JournalArchive::Session *session) const |
| 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. More... | |
| virtual bool | packSceneData (std::stringstream &sceneData)=0 |
| Copy the scene data found in the given stringstream into the journal in some format specific way. More... | |
| virtual bool | packSceneData (std::istream &sceneData)=0 |
| Copy the scene data found in the given stringstream into the journal in some format specific way. More... | |
| virtual bool | recordExtraData (const agx::String &key, const agx::String &value)=0 |
| Store a string key-value pair to the session on disk. More... | |
| bool | recordExtraDataAsJSon (const agx::String &key, const agx::String &value) |
| Store a string key-value pair to the session on disk, without ruining the . More... | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| virtual void | removePlot (const agx::String &plotName)=0 |
| virtual bool | removeSession (agxData::JournalArchive::Session *session) override |
| Remove the given session from the journal. More... | |
| bool | removeSession (const agx::Name &name) |
| Remove the session with the given name from the journal. More... | |
| virtual bool | renameSession (agxData::JournalArchive::Session *session, const agx::Name &newName) override |
| Rename the given session, including data movement on disk. More... | |
| virtual bool | retrieveExtraData (const agx::String &key, agx::String &value)=0 |
| Read back the value associated with the key from disk. More... | |
| agx::String | retrieveExtraData (const agx::String &key) |
| bool | retrieveExtraDataAsJSon (const agx::String &key, agx::String &value) |
| Read back the value associated with the key from disk. More... | |
| agx::String | retrieveExtraDataAsJSon (const agx::String &key) |
| virtual void | savePlot (const PlotData *plot)=0 |
| void | set64BitArchitecture (bool flag) |
| void | set64BitReal (bool flag) |
| void | setAgxVersionNumber (const agx::UInt32 version) |
| void | setAgxVersionString (const agx::String &version) |
| void | setComputationTime (agx::Real64 computationTime) |
| void | setDate (agx::Date *date) |
| void | setFirstFrameIndex (agx::UInt64 startFrame) |
| void | setFirstFrameTimeStamp (agx::Real64 startTime) |
| void | setFrameIO (agxData::FrameIO *frameIO) |
| void | setFrameStride (agx::UInt64 stride) |
| void | setHeaderFormat (SerializedFrame::HeaderFormat format) |
| Some journal formats support more than one format for frame metadata. More... | |
| void | setLastFrameIndex (agx::UInt64 endFrame) |
| void | setLastFrameTimeStamp (agx::Real64 endTime) |
| void | setLittleEndian (bool flag) |
| void | setNumFrames (agx::UInt64 numFrames) |
| void | setSimulationHeader (agx::Component *header) |
| void | setTimeStep (agx::Real64 timeStep) |
| bool | transferSession (agxData::JournalArchive::Session *session, agxData::JournalArchive *target) |
| Transfer the given session from this journal into the given target. More... | |
| bool | transferTo (agxData::JournalArchive *target) |
| Transfer the session to another JournalArchive. The target JournalArchive must be of the same correct type. More... | |
| virtual bool | truncate (agx::UInt firstFrameToRemove)=0 |
| Remove all frames from the given index and forward. More... | |
| virtual bool | unpackSceneData (std::stringstream &sceneData)=0 |
| Copy scene data from the archive, stored in some format specific way, into the given stringstream. More... | |
| virtual bool | unpackSceneData (std::ostream &sceneData)=0 |
| Copy scene data from the archive, stored in some format specific way, into the given stringstream. More... | |
| virtual bool | unpackSceneFile ()=0 |
| Ensure that the scene file for the session is available at the location returned by getScenePath. More... | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| virtual void | writeHeader ()=0 |
Static Public Member Functions | |
| static agx::String | generateNameFromCurrentDate () |
| static bool | isFileJournal (const agx::String &path) |
| static bool | parseSessionPath (const agx::String &fullPath, agx::String &journalPath, agx::String &sessionName) |
| Split the given session path into the path to the path to the journal and the name of the session. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~FileJournal () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| virtual agxData::JournalArchive::Session * | makeCopy (agxData::JournalArchive::Session *session) override |
| Create a copy of the given session. The copy will have its disk data stored in the current JournalArchive. More... | |
| bool | registerSession (agxData::JournalArchive::Session *newSession) |
| Create the Journal <-> Session coupling. More... | |
| bool | rename (const agx::Name &name) |
| Session (const agx::Name &name) | |
| void | setName (const agx::Name &name) |
| void | setPath (const agx::String &path) |
| bool | unregisterSession (agxData::JournalArchive::Session *removedSession) |
| Remove the Journal <-> Session coupling. More... | |
| 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. More... | |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
The FileJournal provides a way to inspect and manipulate a journal created by the FileFrameWriter and stored on disk.
Definition at line 39 of file FileJournal.h.
|
inherited |
Definition at line 316 of file JournalArchive.h.
|
inherited |
Definition at line 317 of file JournalArchive.h.
|
inherited |
Definition at line 318 of file JournalArchive.h.
| typedef agx::observer_ptr< const Session > agxData::FileJournal::SessionConstObserver |
Definition at line 46 of file FileJournal.h.
| typedef agx::ref_ptr< const Session > agxData::FileJournal::SessionConstRef |
Definition at line 46 of file FileJournal.h.
Definition at line 46 of file FileJournal.h.
| typedef agx::ref_ptr< Session > agxData::FileJournal::SessionRef |
Definition at line 46 of file FileJournal.h.
|
inherited |
Definition at line 47 of file JournalArchive.h.
| agxData::FileJournal::FileJournal | ( | const agx::String & | diskPath | ) |
Open a journal on disk.
| diskPath | The disk path to a directory which is a journal. |
|
protectedvirtual |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
inherited |
Copy the given session from this journal into the given target journal.
The session must be owned by the current JournalArchive and the target must be of the same journal type, i.e, use the same disk format.
| session | The session to copy. |
| target | The journal that should receive the copy. |
|
inherited |
Copy the session to another JournalArchive.
The target JournalArchive must be of the same correct type. The result is the same as if "session->getJournal()->copySession(session, target)" had been called.
|
overridevirtual |
|
pure virtualinherited |
|
overridevirtual |
|
pure virtualinherited |
|
overridevirtual |
Create a new session within the journal.
Will return nullptr if a session with the given name already exists.
| name | The name of the new session. |
Implements agxData::JournalArchive.
|
protectedinherited |
|
pure virtualinherited |
|
staticinherited |
|
inherited |
|
inherited |
|
pure virtualinherited |
|
inherited |
|
overridevirtual |
Implements agxData::JournalArchive.
|
overridevirtual |
Implements agxData::JournalArchive.
|
inherited |
|
staticprotectedinherited |
| agxData::FileJournal::Session* agxData::FileJournal::getFileSession | ( | const agx::Name & | name | ) |
|
inherited |
|
inherited |
|
pure virtualinherited |
Load the header data for a particular frame.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
pure virtualinherited |
|
inherited |
|
inherited |
|
inherited |
|
pure virtualinherited |
Returns a format specific string that identifies the location of this session within a journal.
This may be, for example, a disk or HDF5 path.
|
pure virtualinherited |
|
pure virtualinherited |
|
inherited |
|
pure virtualinherited |
Get the path on disk where the .agx file, called the scene file, containing the initial state of the simulation may be stored.
Actual presence of the .agx file depends on if it has been written yet.
If the journal stores the scene data in some internal format, then the unpackSceneFile may be used to copy the initial state from the internal format into a .agx file located at the path returned by this function.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inherited |
|
inherited |
|
static |
|
inherited |
|
inherited |
|
inherited |
Add to the end of the given Vector the names of all the sessions in the Journal.
|
overrideprotectedvirtual |
Create a copy of the given session. The copy will have its disk data stored in the current JournalArchive.
Implements agxData::JournalArchive.
|
pure virtualinherited |
Copy the scene data found in the given stringstream into the journal in some format specific way.
The method is intended to be used with a stringstream filled using the agxSDK::Simulation::write method.
|
pure virtualinherited |
Copy the scene data found in the given stringstream into the journal in some format specific way.
The method is intended to be used with a stringstream filled using the agxSDK::Simulation::write method.
|
static |
Split the given session path into the path to the path to the journal and the name of the session.
| fullPath | Disk path to a session. | |
| [out] | journalPath | Will be filled with the path of the journal, or the empty string on error. |
| [out] | sessionName | Will be filled with the name of the session, or the empty string on error. |
|
pure virtualinherited |
Store a string key-value pair to the session on disk.
|
inherited |
Store a string key-value pair to the session on disk, without ruining the .
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
|
protectedinherited |
Create the Journal <-> Session coupling.
Will fail if there already is a session with the given name in the session table.
|
pure virtualinherited |
|
overridevirtual |
Remove the given session from the journal.
Implements agxData::JournalArchive.
|
inherited |
Remove the session with the given name from the journal.
|
protectedinherited |
|
overridevirtual |
Rename the given session, including data movement on disk.
Implements agxData::JournalArchive.
|
pure virtualinherited |
Read back the value associated with the key from disk.
The value, if found, is stored in 'value'
|
inherited |
|
inherited |
Read back the value associated with the key from disk.
The value, if found, is stored in 'value'
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Some journal formats support more than one format for frame metadata.
It is the responsibility of the agxData::Track reading or writing from/to the session to ensure that the set header format matches the actual format used on disk. In particular, setHeaderFormat cannot be used to change the header format of a session.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
Transfer the given session from this journal into the given target.
The session must be owned by the current JournalArchive and the target must be of the same journal type, i.e., use the same disk format. It is safe to continue using pointers to the transfered session, then in-memory object is updated rather than recreated.
| session | The session to transfer. |
| target | The journal that should take over ownership of the session. |
|
inherited |
Transfer the session to another JournalArchive. The target JournalArchive must be of the same correct type.
|
pure virtualinherited |
Remove all frames from the given index and forward.
|
pure virtualinherited |
Copy scene data from the archive, stored in some format specific way, into the given stringstream.
The stringstream can then be passed on to the agxSDK::Simulation::read method.
|
pure virtualinherited |
Copy scene data from the archive, stored in some format specific way, into the given stringstream.
The stringstream can then be passed on to the agxSDK::Simulation::read method.
|
pure virtualinherited |
Ensure that the scene file for the session is available at the location returned by getScenePath.
Will overwrite the scene file with the packed version if a file is already present at the path returned by getScenePath.
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
protectedinherited |
Remove the Journal <-> Session coupling.
Note that this will do an unreference of the session and may therefore delete the session.
|
protectedinherited |
Change the name of the given session. Will ensure that the session table is kept consistent.
|
staticinherited |
|
pure virtualinherited |
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.