|
ACF $AcfVersion:0$
|
The component for automatic object persistence. More...
#include <CAutoPersistenceComp.h>
Public Types | |
| enum | ModelIds { MI_OBJECT , MI_FILEPATH , MI_RUNTIME_STATUS } |
| typedef ilog::CLoggerComponentBase | BaseClass |
| typedef imod::CMultiModelDispatcherBase | BaseClass2 |
Public Types inherited from ilog::TLoggerCompWrap< Base > | |
| typedef Base | BaseClass |
| Base class typedef for component functionality. | |
| typedef ilog::CLoggerBase | BaseClass2 |
| Base class typedef for logger functionality. | |
Public Member Functions | |
| CAutoPersistenceComp () | |
| Default constructor. | |
Public Member Functions inherited from ilog::CLoggerBase | |
| CLoggerBase () | |
| Default constructor. | |
| virtual void | SetLogPtr (ilog::IMessageConsumer *logPtr) override |
| Attach a message consumer for logging. | |
| virtual ilog::IMessageConsumer * | GetLogPtr () const override |
| Get the currently attached message consumer. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Protected Member Functions | |
| void | SaveObjectSnapshot () |
| Store object copy in a separate thread. | |
| virtual bool | LoadObject (const QString &filePath) |
| Load working object data from some file. | |
| virtual bool | StoreObject (const istd::IChangeable &object) |
| Store some object data to working file. | |
| virtual void | OnComponentCreated () override |
| Called when component is created. | |
| virtual void | OnComponentDestroyed () override |
| Called when component is destroyed. | |
| virtual void | OnModelChanged (int modelId, const istd::IChangeable::ChangeSet &changeSet) override |
| Called when some model observed by dispatcher will be changed. | |
Protected Member Functions inherited from ilog::TLoggerCompWrap< Base > | |
| bool | IsVerboseEnabled (int tracingLevel=0) const |
| Check if verbose messages are enabled for a given tracing level. | |
| void | SendVerboseMessage (const QString &message, const QString &messageSource=QString(), int tracingLevel=0) const |
| Send a verbose message if enabled. | |
| virtual void | DecorateMessage (istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override |
| Decorate message before sending. | |
Protected Member Functions inherited from ilog::CLoggerBase | |
| bool | SendInfoMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send info message to log. | |
| bool | SendWarningMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send warning message to log. | |
| bool | SendErrorMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send error message to log. | |
| bool | SendCriticalMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send critical message to log. | |
| bool | SendInfoMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once info message to log. | |
| bool | SendWarningMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once warning message to log. | |
| bool | SendErrorMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once error message to log. | |
| bool | SendCriticalMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const |
| Send once critical message to log. | |
| bool | SendUserMessage (const istd::IInformationProvider *messagePtr) const |
| Send message with user object. | |
| bool | AllowMessageOnceAgain (int id) |
| Reset message lock. | |
| virtual bool | IsLogConsumed (const istd::IInformationProvider::InformationCategory *categoryPtr=NULL, const int *flagsPtr=NULL) const override |
| Check if any log message is consumed. | |
| virtual bool | SendLogMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const override |
| Send any message to log. | |
| bool | RegisterModel (IModel *modelPtr, int modelId=0, const istd::IChangeable::ChangeSet &relevantFlags=istd::IChangeable::GetAllChanges()) |
| Register the data model to be observed. | |
| void | UnregisterModel (int modelId=0) |
| Unregister the data model object. | |
| void | UnregisterAllModels () |
| Unregister all observed data objects. | |
| template<class Object > | |
| Object * | GetObjectAt (int modelId) const |
| Get concrete object instance of the obsered model. | |
Additional Inherited Members | |
Protected Attributes inherited from ilog::CLoggerBase | |
| QSet< int > | m_onceMessageIds |
The component for automatic object persistence.
With the help of this component data objects can be backed up at specific time points and restored. The data object that should be restored or backed up, will be connected via component reference. The backup or restoring of data is done according to the component configuration, that is given by the component's attributes. Enable RestoreOnBegin attribute if you want to restore the object from the file during component initialization. Enable StoreOnEnd attribute if you want to save the object to the file during component de-initialization. Enable StoreOnChange attribute if you want to save the object to the file each time if the object data was changed. Also you can specify some time interval for permanently data storing. If this parameter is set, then the object will be stored to the file in the given time interval, but only if the object data was changed.
StoreOnChange attribute will be ignored. Definition at line 44 of file CAutoPersistenceComp.h.
Definition at line 52 of file CAutoPersistenceComp.h.
Definition at line 53 of file CAutoPersistenceComp.h.
| Enumerator | |
|---|---|
| MI_OBJECT | Object was changed. |
| MI_FILEPATH | File path was changed. |
| MI_RUNTIME_STATUS | Runtime status was changed. |
Definition at line 55 of file CAutoPersistenceComp.h.
| ifile::CAutoPersistenceComp::CAutoPersistenceComp | ( | ) |
Default constructor.
|
protectedvirtual |
Load working object data from some file.
|
overrideprotectedvirtual |
Called when component is created.
Automatically connects the log consumer from the "Log" reference.
Reimplemented from ilog::TLoggerCompWrap< Base >.
|
overrideprotectedvirtual |
Called when component is destroyed.
Automatically disconnects the log consumer for cleanup.
Reimplemented from ilog::TLoggerCompWrap< Base >.
|
overrideprotectedvirtual |
Called when some model observed by dispatcher will be changed.
Implements imod::CMultiModelDispatcherBase.
|
protected |
Store object copy in a separate thread.
|
protectedvirtual |
Store some object data to working file.