Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PVR::CPVRProviders Class Reference

#include <PVRProviders.h>

Inheritance diagram for PVR::CPVRProviders:
PVR::CPVRProvidersContainer

Public Member Functions

 CPVRProviders ()=default
 
 ~CPVRProviders ()=default
 
std::vector< std::shared_ptr< CPVRProvider > > GetProviders () const
 
std::size_t GetNumProviders () const
 
bool Update (const std::vector< std::shared_ptr< CPVRClient > > &clients)
 Update all providers from PVR database and from given clients.
 
void Unload ()
 unload all providers.
 
bool UpdateFromClients (const std::vector< std::shared_ptr< CPVRClient > > &clients)
 Update data with providers from the given clients, sync with local data.
 
bool LoadFromDatabase (const std::vector< std::shared_ptr< CPVRClient > > &clients)
 Load all local providers from PVR database.
 
std::shared_ptr< CPVRProviderCheckAndAddEntry (const std::shared_ptr< CPVRProvider > &newProvider, ProviderUpdateMode updateMode)
 Check if the entry exists in the container, if it does update it otherwise add it.
 
std::shared_ptr< CPVRProviderCheckAndPersistEntry (const std::shared_ptr< CPVRProvider > &newProvider, ProviderUpdateMode updateMode)
 Check if the entry exists in the container, if it does update it and persist it in the DB otherwise add it and persist it in the DB.
 
bool PersistUserChanges (const std::vector< std::shared_ptr< CPVRProvider > > &providers)
 Persist user changes to the current state of the providers in the DB.
 
std::shared_ptr< CPVRProviderGetById (int iProviderId) const
 Get a provider given it's database ID.
 
int CleanupCachedImages ()
 Erase stale texture db entries and image files.
 
- Public Member Functions inherited from PVR::CPVRProvidersContainer
bool UpdateFromClient (const std::shared_ptr< CPVRProvider > &provider)
 Add a provider to this container or update the provider if already present in this container.
 
std::shared_ptr< CPVRProviderGetByClient (int iClientId, int iUniqueId) const
 Get the provider denoted by given client id and unique client provider id.
 
std::vector< std::shared_ptr< CPVRProvider > > GetProvidersList () const
 

Additional Inherited Members

- Protected Member Functions inherited from PVR::CPVRProvidersContainer
void InsertEntry (const std::shared_ptr< CPVRProvider > &newProvider, ProviderUpdateMode updateMode)
 
- Protected Attributes inherited from PVR::CPVRProvidersContainer
CCriticalSection m_critSection
 
int m_iLastId = 0
 
std::vector< std::shared_ptr< CPVRProvider > > m_providers
 

Constructor & Destructor Documentation

◆ CPVRProviders()

PVR::CPVRProviders::CPVRProviders ( )
default

◆ ~CPVRProviders()

PVR::CPVRProviders::~CPVRProviders ( )
default

Member Function Documentation

◆ CheckAndAddEntry()

std::shared_ptr< CPVRProvider > CPVRProviders::CheckAndAddEntry ( const std::shared_ptr< CPVRProvider > & newProvider,
ProviderUpdateMode updateMode )

Check if the entry exists in the container, if it does update it otherwise add it.

Parameters
newProviderThe provider entry to update/add in/to the container
updateModeupdate as Client (respect User set values) or DB (update all values)
Returns
The provider if updated or added, otherwise an empty object (nullptr)

◆ CheckAndPersistEntry()

std::shared_ptr< CPVRProvider > CPVRProviders::CheckAndPersistEntry ( const std::shared_ptr< CPVRProvider > & newProvider,
ProviderUpdateMode updateMode )

Check if the entry exists in the container, if it does update it and persist it in the DB otherwise add it and persist it in the DB.

Parameters
newProviderThe provider entry to update/add in/to the container and DB
updateModeupdate as Client (respect User set values) or DB (update all values)
Returns
The provider if updated or added, otherwise an empty object (nullptr)

◆ CleanupCachedImages()

int CPVRProviders::CleanupCachedImages ( )

Erase stale texture db entries and image files.

Returns
number of cleaned up images.

◆ GetById()

std::shared_ptr< CPVRProvider > CPVRProviders::GetById ( int iProviderId) const

Get a provider given it's database ID.

Parameters
iProviderIdThe ID to find
Returns
The provider, or an empty one when not found

◆ GetNumProviders()

std::size_t CPVRProviders::GetNumProviders ( ) const

Get the number of enabled providers

Returns
The total number of enabled providers

◆ GetProviders()

std::vector< std::shared_ptr< CPVRProvider > > CPVRProviders::GetProviders ( ) const

Get all enabled providers

Returns
The list of all enabled providers
Todo
optimize; get rid of iteration.

◆ LoadFromDatabase()

bool CPVRProviders::LoadFromDatabase ( const std::vector< std::shared_ptr< CPVRClient > > & clients)

Load all local providers from PVR database.

Parameters
clientsThe PVR clients data should be loaded for. Leave empty for all clients.
Returns
True on success, false otherwise.

◆ PersistUserChanges()

bool CPVRProviders::PersistUserChanges ( const std::vector< std::shared_ptr< CPVRProvider > > & providers)

Persist user changes to the current state of the providers in the DB.

◆ Unload()

void CPVRProviders::Unload ( )

unload all providers.

◆ Update()

bool CPVRProviders::Update ( const std::vector< std::shared_ptr< CPVRClient > > & clients)

Update all providers from PVR database and from given clients.

Parameters
clientsThe PVR clients data should be loaded for. Leave empty for all clients.
Returns
True on success, false otherwise.

◆ UpdateFromClients()

bool CPVRProviders::UpdateFromClients ( const std::vector< std::shared_ptr< CPVRClient > > & clients)

Update data with providers from the given clients, sync with local data.

Parameters
clientsThe clients to fetch data from. Leave empty to fetch data from all created clients.
Returns
True on success, false otherwise.

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