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

virtual ~SSDPCache ()
 
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, long 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 80 of file ssdpcache.h.

Constructor & Destructor Documentation

◆ SSDPCache()

SSDPCache::SSDPCache ( )
private

Definition at line 250 of file ssdpcache.cpp.

Referenced by Instance().

◆ ~SSDPCache()

SSDPCache::~SSDPCache ( )
virtual

Definition at line 267 of file ssdpcache.cpp.

Member Function Documentation

◆ NotifyAdd()

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

Definition at line 519 of file ssdpcache.cpp.

Referenced by Add().

◆ NotifyRemove()

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

Definition at line 538 of file ssdpcache.cpp.

Referenced by Remove().

◆ Instance()

SSDPCache * SSDPCache::Instance ( )
static

◆ Lock()

void SSDPCache::Lock ( void  )
inline

Definition at line 116 of file ssdpcache.h.

Referenced by Remove(), and RemoveStale().

◆ Unlock()

void SSDPCache::Unlock ( void  )
inline

Definition at line 117 of file ssdpcache.h.

Referenced by Remove(), and RemoveStale().

◆ Begin()

SSDPCacheEntriesMap::Iterator SSDPCache::Begin ( void  )
inline

Definition at line 119 of file ssdpcache.h.

◆ End()

SSDPCacheEntriesMap::Iterator SSDPCache::End ( void  )
inline

Definition at line 120 of file ssdpcache.h.

◆ Count()

int SSDPCache::Count ( void  )
inline

Definition at line 122 of file ssdpcache.h.

◆ Clear()

void SSDPCache::Clear ( void  )

Definition at line 281 of file ssdpcache.cpp.

Referenced by ~SSDPCache().

◆ Add()

void SSDPCache::Add ( const QString &  sURI,
const QString &  sUSN,
const QString &  sLocation,
long  sExpiresInSecs 
)

Definition at line 328 of file ssdpcache.cpp.

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

◆ Remove()

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

Definition at line 413 of file ssdpcache.cpp.

Referenced by SSDP::ProcessNotify().

◆ RemoveStale()

int SSDPCache::RemoveStale ( )

Definition at line 455 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 587 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 551 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 297 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 310 of file ssdpcache.cpp.

Member Data Documentation

◆ g_pSSDPCache

SSDPCache * SSDPCache::g_pSSDPCache = nullptr
staticprivate

Definition at line 87 of file ssdpcache.h.

Referenced by Instance().

◆ m_badUrlList

QStringList SSDPCache::m_badUrlList
private

Definition at line 88 of file ssdpcache.h.

Referenced by Add().

◆ m_goodUrlList

QStringList SSDPCache::m_goodUrlList
private

Definition at line 89 of file ssdpcache.h.

Referenced by Add().

◆ m_mutex

QMutex SSDPCache::m_mutex
mutableprotected

Definition at line 93 of file ssdpcache.h.

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

◆ m_cache

SSDPCacheEntriesMap SSDPCache::m_cache
protected

Definition at line 94 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: