Ubuntu TV Media Scanner
A centralized index for removable media content.
|
A commit policy decides when changes to the media index are written back to the disk. More...
#include <mediascanner/commitpolicy.h>
Public Member Functions | |
virtual | ~CommitPolicy () |
virtual bool | OnCreate (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index)=0 |
This method is called when data has been inserted into the specified media_index . More... | |
virtual bool | OnUpdate (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index)=0 |
This method is called when data has been updated in the specified media_index . More... | |
virtual bool | OnRemove (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index)=0 |
This method is called when data has been deleted from the specified media_index . More... | |
Static Public Member Functions | |
static CommitPolicyPtr | default_policy () |
The default policy - currently an instance of InstantCommitPolicy. More... | |
A commit policy decides when changes to the media index are written back to the disk.
Choosing the proper policy has great impact on reliability and performance, but also on hardware wear (for instance, flash disk wear).
|
virtual |
|
static |
The default policy - currently an instance of InstantCommitPolicy.
|
pure virtual |
This method is called when data has been inserted into the specified media_index
.
Policy implementations can now decide when to call CommitPendingChanges().
media_urls | The URLs of the affected media. |
media_index | The affected media index. |
Implemented in mediascanner::DelayedCommitPolicy, and mediascanner::InstantCommitPolicy.
|
pure virtual |
This method is called when data has been deleted from the specified media_index
.
Policy implementations can now decide when to call CommitPendingChanges().
media_urls | The URLs of the affected media. |
media_index | The affected media index. |
Implemented in mediascanner::DelayedCommitPolicy, and mediascanner::InstantCommitPolicy.
|
pure virtual |
This method is called when data has been updated in the specified media_index
.
Policy implementations can now decide when to call CommitPendingChanges().
media_urls | The URLs of the affected media. |
media_index | The affected media index. |
Implemented in mediascanner::DelayedCommitPolicy, and mediascanner::InstantCommitPolicy.