MPD: UpdateService Class Reference

MPD 0.20.15

Public Member Functions
UpdateService Class Referencefinal

This class manages the update queue and runs the update thread. More...

`#include <Service.hxx>`

Inheritance diagram for UpdateService:
[legend]
Collaboration diagram for UpdateService:
[legend]

## Public Member Functions
| UpdateService (EventLoop &_loop, SimpleDatabase &_db, CompositeStorage &_storage, DatabaseListener &_listener)
| ~UpdateService ()
unsigned | GetId () const
| Returns a non-zero job id when we are currently updating the database. More...
gcc_nonnull_all unsigned | Enqueue (const char *path, bool discard)
| Add this path to the database update queue. More...
void | CancelAllAsync ()
| Clear the queue and cancel the current update. More...
void | CancelMount (const char *uri)
| Cancel all updates for the given mount point. More...

## Detailed Description

This class manages the update queue and runs the update thread.

Definition at line 37 of file Service.hxx.

## Constructor & Destructor Documentation

## ◆ UpdateService()

UpdateService::UpdateService | ( | EventLoop & | _loop,
|  | SimpleDatabase & | _db,
|  | CompositeStorage & | _storage,
|  | DatabaseListener & | _listener
| ) |  |

## ◆ ~UpdateService()

UpdateService::~UpdateService | ( |  | ) |

## Member Function Documentation

## ◆ CancelAllAsync()

void UpdateService::CancelAllAsync | ( |  | ) |

Clear the queue and cancel the current update.

Does not wait for the thread to exit.

## ◆ CancelMount()

void UpdateService::CancelMount | ( | const char * | uri | ) |

Cancel all updates for the given mount point.

If an update is already running for it, the method will wait for cancellation to complete.

## ◆ Enqueue()

gcc_nonnull_all unsigned UpdateService::Enqueue | ( | const char * | path,
|  | bool | discard
| ) |  |

Add this path to the database update queue.

Parameters

  path | a path to update; if an empty string, the whole music directory is updated

Returns
  the job id, or 0 on error

## ◆ GetId()

unsigned UpdateService::GetId | ( |  | ) | const
| inline

Returns a non-zero job id when we are currently updating the database.

Definition at line 68 of file Service.hxx.

The documentation for this class was generated from the following file:

- db/update/Service.hxx