MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SSDPCache Class Reference

#include <ssdpcache.h>

Inheritance diagram for SSDPCache:
Inheritance graph
[legend]
Collaboration diagram for SSDPCache:
Collaboration graph
[legend]

Public Member Functions

 ~SSDPCache () override
 
void Lock ()
 
void Unlock ()
 
SSDPCacheEntriesMap::Iterator Begin ()
 
SSDPCacheEntriesMap::Iterator End ()
 
int Count ()
 
void Clear ()
 
void Add (const QString &sURI, const QString &sUSN, const QString &sLocation, std::chrono::seconds sExpiresInSecs)
 
void Remove (const QString &sURI, const QString &sUSN)
 
int RemoveStale ()
 
void Dump (void)
 Prints this device to the console in a human readable form. More...
 
QTextStream & OutputXML (QTextStream &os, uint *pnDevCount=nullptr, uint *pnEntryCount=nullptr) const
 Outputs the XML for this device. More...
 
SSDPCacheEntriesFind (const QString &sURI)
 Finds the SSDPCacheEntries in the cache, returns nullptr when absent. More...
 
DeviceLocationFind (const QString &sURI, const QString &sUSN)
 Finds the Device in the cache, returns nullptr when absent. More...
 
- Public Member Functions inherited from MythObservable
 MythObservable ()
 
virtual ~MythObservable ()
 
void addListener (QObject *listener)
 Add a listener to the observable. More...
 
void removeListener (QObject *listener)
 Remove a listener to the observable. More...
 
void dispatch (const MythEvent &event)
 Dispatch an event to all listeners. More...
 
bool hasListeners (void)
 

Static Public Member Functions

static SSDPCacheInstance ()
 

Protected Member Functions

void NotifyAdd (const QString &sURI, const QString &sUSN, const QString &sLocation)
 
void NotifyRemove (const QString &sURI, const QString &sUSN)
 

Protected Attributes

QMutex m_mutex
 
SSDPCacheEntriesMap m_cache
 
- Protected Attributes inherited from MythObservable
QMutex * m_lock {nullptr}
 
QSet< QObject * > m_listeners
 

Private Member Functions

 SSDPCache ()
 

Private Attributes

QStringList m_badUrlList
 
QStringList m_goodUrlList
 

Static Private Attributes

static SSDPCacheg_pSSDPCache = nullptr
 

Detailed Description

Definition at line 81 of file ssdpcache.h.

Constructor & Destructor Documentation

◆ SSDPCache()

SSDPCache::SSDPCache ( )
private

Definition at line 247 of file ssdpcache.cpp.

Referenced by Instance().

◆ ~SSDPCache()

SSDPCache::~SSDPCache ( )
override

Definition at line 264 of file ssdpcache.cpp.

Member Function Documentation

◆ NotifyAdd()

void SSDPCache::NotifyAdd ( const QString &  sURI,
const QString &  sUSN,
const QString &  sLocation 
)
protected

Definition at line 508 of file ssdpcache.cpp.

Referenced by Add().

◆ NotifyRemove()

void SSDPCache::NotifyRemove ( const QString &  sURI,
const QString &  sUSN 
)
protected

Definition at line 527 of file ssdpcache.cpp.

Referenced by Remove().

◆ Instance()

SSDPCache * SSDPCache::Instance ( )
static

◆ Lock()

void SSDPCache::Lock ( )
inline

Definition at line 117 of file ssdpcache.h.

Referenced by Remove(), and RemoveStale().

◆ Unlock()

void SSDPCache::Unlock ( )
inline

Definition at line 118 of file ssdpcache.h.

Referenced by Remove(), and RemoveStale().

◆ Begin()

SSDPCacheEntriesMap::Iterator SSDPCache::Begin ( )
inline

Definition at line 120 of file ssdpcache.h.

◆ End()

SSDPCacheEntriesMap::Iterator SSDPCache::End ( )
inline

Definition at line 121 of file ssdpcache.h.

◆ Count()

int SSDPCache::Count ( )
inline

Definition at line 123 of file ssdpcache.h.

◆ Clear()

void SSDPCache::Clear ( )

Definition at line 278 of file ssdpcache.cpp.

Referenced by ~SSDPCache().

◆ Add()

void SSDPCache::Add ( const QString &  sURI,
const QString &  sUSN,
const QString &  sLocation,
std::chrono::seconds  sExpiresInSecs 
)

Definition at line 324 of file ssdpcache.cpp.

Referenced by SSDP::ProcessNotify(), and SSDP::ProcessSearchResponse().

◆ Remove()

void SSDPCache::Remove ( const QString &  sURI,
const QString &  sUSN 
)

Definition at line 407 of file ssdpcache.cpp.

Referenced by SSDP::ProcessNotify().

◆ RemoveStale()

int SSDPCache::RemoveStale ( )

Definition at line 449 of file ssdpcache.cpp.

Referenced by SSDPCacheTask::Execute().

◆ Dump()

void SSDPCache::Dump ( void  )

Prints this device to the console in a human readable form.

Definition at line 575 of file ssdpcache.cpp.

Referenced by SSDPCacheTask::Execute().

◆ OutputXML()

QTextStream & SSDPCache::OutputXML ( QTextStream &  os,
uint pnDevCount = nullptr,
uint pnEntryCount = nullptr 
) const

Outputs the XML for this device.

Definition at line 540 of file ssdpcache.cpp.

Referenced by SSDPExtension::GetDeviceList().

◆ Find() [1/2]

SSDPCacheEntries * SSDPCache::Find ( const QString &  sURI)

Finds the SSDPCacheEntries in the cache, returns nullptr when absent.

Note
Caller must call DecrRef on non-nullptr when done with it.

Definition at line 293 of file ssdpcache.cpp.

Referenced by SSDP::Find(), Find(), and BackendSelection::Init().

◆ Find() [2/2]

DeviceLocation * SSDPCache::Find ( const QString &  sURI,
const QString &  sUSN 
)

Finds the Device in the cache, returns nullptr when absent.

Note
Caller must call DecrRef on non-nullptr when done with it.

Definition at line 306 of file ssdpcache.cpp.

Member Data Documentation

◆ g_pSSDPCache

SSDPCache * SSDPCache::g_pSSDPCache = nullptr
staticprivate

Definition at line 88 of file ssdpcache.h.

Referenced by Instance().

◆ m_badUrlList

QStringList SSDPCache::m_badUrlList
private

Definition at line 89 of file ssdpcache.h.

Referenced by Add().

◆ m_goodUrlList

QStringList SSDPCache::m_goodUrlList
private

Definition at line 90 of file ssdpcache.h.

Referenced by Add().

◆ m_mutex

QMutex SSDPCache::m_mutex
mutableprotected

Definition at line 94 of file ssdpcache.h.

Referenced by Add(), Clear(), Dump(), Find(), and OutputXML().

◆ m_cache

SSDPCacheEntriesMap SSDPCache::m_cache
protected

Definition at line 95 of file ssdpcache.h.

Referenced by Add(), Clear(), Dump(), Find(), OutputXML(), Remove(), and RemoveStale().


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