pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Pandora::StationDefinitionDetails< InfoType > Class Template Reference

#include <pandorastation.h>

Collaboration diagram for Pandora::StationDefinitionDetails< InfoType >:
Collaboration graph
[legend]

Public Member Functions

void storeDetail (const MusicThingie *primary, InfoType *rating)
 Add a single new detail item. More...
 
InfoType * getDetail (const MusicThingie *primary) const
 Retrieve details for an item. More...
 
void erase (InfoType *item)
 Remove a detail record from the list and cache. More...
 

Private Types

using ListType = RetainedList< InfoType * >
 

Private Member Functions

InfoType * find (const MusicThingie *primary) const
 Search the authoritative list for a matching item. More...
 
 StationDefinitionDetails (MusicThingie::Type ty)
 
const ListTypelist () const
 
void operator= (ListType &&list)
 Replace the details stored and clear cache. More...
 
bool isSeedPresent (const MusicThingie *seed) const
 See if details originated from this list. More...
 

Private Attributes

ListType info_list
 The authoritative list of details. More...
 
MusicThingie::Type type
 The primary type stored herein. More...
 
std::unordered_map< std::string, Retainer< InfoType * > > cache
 Faster access to info. More...
 

Friends

class Station
 

Member Typedef Documentation

◆ ListType

template<typename InfoType >
using Pandora::StationDefinitionDetails< InfoType >::ListType = RetainedList <InfoType *>
private

Constructor & Destructor Documentation

◆ StationDefinitionDetails()

template<typename InfoType >
Pandora::StationDefinitionDetails< InfoType >::StationDefinitionDetails ( MusicThingie::Type  ty)
inlineprivate

Member Function Documentation

◆ erase()

template<typename InfoType >
void Pandora::StationDefinitionDetails< InfoType >::erase ( InfoType *  item)

Remove a detail record from the list and cache.

Parameters
itemThe detail record to remove.

◆ find()

template<typename InfoType >
InfoType * Pandora::StationDefinitionDetails< InfoType >::find ( const MusicThingie search_item) const
private

Search the authoritative list for a matching item.

Parameters
search_itemThe item to search for.
Returns
The detail record found, or a nullptr.
Here is the call graph for this function:

◆ getDetail()

template<typename InfoType >
InfoType * Pandora::StationDefinitionDetails< InfoType >::getDetail ( const MusicThingie primary) const

Retrieve details for an item.

If a cache entry is found, uses that; if not, searches and updates cache.

Parameters
primaryThe item for which details are being requested.
Returns
The detail record, or nullptr if no applicable details are found.
Here is the call graph for this function:

◆ isSeedPresent()

template<typename InfoType >
bool Pandora::StationDefinitionDetails< InfoType >::isSeedPresent ( const MusicThingie detail) const
private

See if details originated from this list.

This compares pointers only.

Parameters
detailThe detail to search for.
Returns
True if the detail is from this list, false otherwise.

◆ list()

template<typename InfoType >
const ListType& Pandora::StationDefinitionDetails< InfoType >::list ( ) const
inlineprivate

◆ operator=()

template<typename InfoType >
void Pandora::StationDefinitionDetails< InfoType >::operator= ( ListType &&  list)
private

Replace the details stored and clear cache.

Parameters
listA new set of details.

◆ storeDetail()

template<typename InfoType >
void Pandora::StationDefinitionDetails< InfoType >::storeDetail ( const MusicThingie primary,
InfoType *  detail 
)

Add a single new detail item.

Parameters
primaryAn item for which details are added, for priming the cache.
detailA detail record.
Here is the call graph for this function:

Friends And Related Function Documentation

◆ Station

template<typename InfoType >
friend class Station
friend

Member Data Documentation

◆ cache

template<typename InfoType >
std::unordered_map<std::string, Retainer<InfoType *> > Pandora::StationDefinitionDetails< InfoType >::cache
mutableprivate

Faster access to info.

◆ info_list

template<typename InfoType >
ListType Pandora::StationDefinitionDetails< InfoType >::info_list
private

The authoritative list of details.

◆ type

template<typename InfoType >
MusicThingie::Type Pandora::StationDefinitionDetails< InfoType >::type
private

The primary type stored herein.


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