24 #include "MSSessionStorageInterface.hpp" 26 #include <MCDataContainer.hpp> 27 #include <MCDataStorage.hpp> 33 #include <qstringlist.h> 37 #include <boost/scoped_ptr.hpp> 211 const QString& base_path,
212 const QString& output_name,
269 QString
ExecuteSqlQuery(
const QSqlDatabase& database,
const QString& query_str)
const;
372 QMap<int, int> RemappedIDs;
void CreateNewDataItemsForAClass(MSElement &object)
Create data container for an element class.
int GetPlayedHeartBeats() const
Get the number of the played heart beats.
MSSessionStorageInterface * GetStorage(const QString &type_name) const
Get the appropriate storage for a type.
Load or store the source elements' output of a session.
QString ExecuteSqlQuery(const QSqlDatabase &database, const QString &query_str) const
Execute an SQL query.
void PreparePlay()
Prepare the play of a recorded session.
void CreateRecordDatabase()
Create an empty record database.
void OpenPlaybackDatabase()
Open a database.
void CreateTableForAClass(MSElement &object)
Create table for an element class.
void EndOfDatabase()
End of the data in the database.
Interface class to handle new types in the storage.
void ResetTimers()
Reset the internal timers.
MSSessionStorage()
Class constructor.
void SetPlaybackPath(const QString &path)
Set the playback path.
boost::scoped_ptr< MCDataStorage > PlaybackStorage
Play data storage.
static MSSessionStorage * GetInstance()
Get a static instance of the class.
Basic ancestor class of the elements.
QString PlaybackPath
Playback path.
QMap< QString, QStringList > TableColumns
Cached class outputs.
boost::scoped_ptr< QSqlDatabase > RecordDatabase
Record database.
QStringList ElementClassNames
Registered class names with an instance.
void RemoveStorages()
Remove the session storages.
boost::scoped_ptr< QSqlDatabase > PlaybackDatabase
Playback database.
int PlayedHeartBeats
Played heart beats.
QList< QPointer< MSSessionStorageInterface > > SessionStorages
Storage implementations.
void CloseRecordStorage()
Close record storage.
void ClosePlaybackDatabase()
Close the database being played.
bool IsStorageAvailable() const
Check if any storage is available.
void LoadStatesFromDatabase()
Load the element states from the database.
QList< MSElement * > RegElements
Registered elements.
QString GetPlaybackPath() const
Get the playback path.
void CloseRecordDatabase()
Close the record database.
void OpenPlaybackStorage()
Open playback storage.
QString ConstructFileName(int object_id, int beat_id, const QString &base_path, const QString &output_name, const MSSessionStorageInterface::StorageDataType &storage_type) const
Construct a file name in the storage without extension.
QString RecordPath
Path where the recording goes.
boost::scoped_ptr< MCDataStorage > RecordStorage
Record data storage.
void Finalize()
Finalize the storage operations.
void RegisterStorage(MSSessionStorageInterface &storage)
Register a session storage.
void CreateRecordStorage()
Create a new record storage.
const int RecordStoragePeriod
Record storage period.
void RecordStatesToDatabase()
Record the element states to the database.
QString GetRecordPath() const
Get the record path.
void RecordStatesToStorage()
Record element states to storage.
void RegisterElement(MSElement &object)
Register an element.
void SetRecordPath(const QString &record_path)
Set the record path.
void LoadStatesFromStorage()
Load element states from storage.
void PrepareRecord()
Prepare the record of a new session.
void BeatEnd(int beat_id)
This slot is being called by the end of a heart beat.
void ClosePlaybackStorage()
Close playback storage.