Ubuntu TV Media Scanner
A centralized index for removable media content.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
mediascanner::InstantCommitPolicy Class Reference

A CommitPolicy which askes for instant commit of any change. More...

#include <mediascanner/commitpolicy.h>

+ Inheritance diagram for mediascanner::InstantCommitPolicy:

Public Member Functions

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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from mediascanner::CommitPolicy
static CommitPolicyPtr default_policy ()
 The default policy - currently an instance of InstantCommitPolicy. More...
 

Detailed Description

A CommitPolicy which askes for instant commit of any change.

This policy gives the most reliable behavior, at the cost of reduced performance and increased hardware wear.

Member Function Documentation

bool mediascanner::InstantCommitPolicy::OnCreate ( const std::vector< std::wstring > &  media_urls,
WritableMediaIndex media_index 
)
virtual

This method is called when data has been inserted into the specified media_index.

Policy implementations can now decide when to call CommitPendingChanges().

Parameters
media_urlsThe URLs of the affected media.
media_indexThe affected media index.
Returns
If the change got committed.

Implements mediascanner::CommitPolicy.

bool mediascanner::InstantCommitPolicy::OnRemove ( const std::vector< std::wstring > &  media_urls,
WritableMediaIndex media_index 
)
virtual

This method is called when data has been deleted from the specified media_index.

Policy implementations can now decide when to call CommitPendingChanges().

Parameters
media_urlsThe URLs of the affected media.
media_indexThe affected media index.
Returns
If the change got committed.

Implements mediascanner::CommitPolicy.

bool mediascanner::InstantCommitPolicy::OnUpdate ( const std::vector< std::wstring > &  media_urls,
WritableMediaIndex media_index 
)
virtual

This method is called when data has been updated in the specified media_index.

Policy implementations can now decide when to call CommitPendingChanges().

Parameters
media_urlsThe URLs of the affected media.
media_indexThe affected media index.
Returns
If the change got committed.

Implements mediascanner::CommitPolicy.