|
Ubuntu TV Media Scanner
A centralized index for removable media content.
|
A CommitPolicy which delays commits slightly, trying to batch them. More...
#include <mediascanner/commitpolicy.h>
Inheritance diagram for mediascanner::DelayedCommitPolicy:Public Types | |
| typedef boost::posix_time::microsec_clock | Clock |
| typedef boost::posix_time::time_duration | Duration |
| typedef boost::posix_time::ptime | TimeStamp |
Public Member Functions | |
| DelayedCommitPolicy () | |
| ~DelayedCommitPolicy () | |
| void | set_maximum_batch_size (unsigned batch_size) |
| Changes the value of maximum_batch_size(). More... | |
| unsigned | maximum_batch_size () const |
| The current maximium batch size after which commits must be performed. More... | |
| void | set_maximum_delay (Duration delay) |
| Changes the value of maximium_delay(). More... | |
| Duration | maximium_delay () const |
| The current maximium timely delay after which commits must be performed. More... | |
| bool | OnCreate (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index) |
This method is called when data has been inserted into the specified media_index. More... | |
| bool | OnUpdate (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index) |
This method is called when data has been updated in the specified media_index. More... | |
| bool | OnRemove (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index) |
This method is called when data has been deleted from the specified media_index. More... | |
Public Member Functions inherited from mediascanner::CommitPolicy | |
| virtual | ~CommitPolicy () |
Static Public Member Functions | |
| static unsigned | default_maximum_batch_size () |
| The default value of maximum_batch_size() - currently 10. More... | |
| static Duration | default_maximum_delay () |
| The default value of maximum_delay() - currently 5 seconds. More... | |
Static Public Member Functions inherited from mediascanner::CommitPolicy | |
| static CommitPolicyPtr | default_policy () |
| The default policy - currently an instance of InstantCommitPolicy. More... | |
Protected Member Functions | |
| void | UpdateDelayedCommits () |
| bool | PushDelayedCommit (const std::vector< std::wstring > &media_urls, WritableMediaIndex *media_index) |
A CommitPolicy which delays commits slightly, trying to batch them.
This policy permits weighting reliability versus performance and wear.
| typedef boost::posix_time::microsec_clock mediascanner::DelayedCommitPolicy::Clock |
| typedef boost::posix_time::time_duration mediascanner::DelayedCommitPolicy::Duration |
| typedef boost::posix_time::ptime mediascanner::DelayedCommitPolicy::TimeStamp |
| mediascanner::DelayedCommitPolicy::DelayedCommitPolicy | ( | ) |
| mediascanner::DelayedCommitPolicy::~DelayedCommitPolicy | ( | ) |
|
static |
The default value of maximum_batch_size() - currently 10.
|
static |
The default value of maximum_delay() - currently 5 seconds.
| Duration mediascanner::DelayedCommitPolicy::maximium_delay | ( | ) | const |
The current maximium timely delay after which commits must be performed.
| unsigned mediascanner::DelayedCommitPolicy::maximum_batch_size | ( | ) | const |
The current maximium batch size after which commits must be performed.
|
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. |
Implements mediascanner::CommitPolicy.
|
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. |
Implements mediascanner::CommitPolicy.
|
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. |
Implements mediascanner::CommitPolicy.
|
protected |
| void mediascanner::DelayedCommitPolicy::set_maximum_batch_size | ( | unsigned | batch_size) |
Changes the value of maximum_batch_size().
| void mediascanner::DelayedCommitPolicy::set_maximum_delay | ( | Duration | delay) |
Changes the value of maximium_delay().
|
protected |
1.8.4