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

#include <ssdpcache.h>

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

Public Member Functions

 SSDPCacheEntries ()
 
void Clear (void)
 Clears the cache of all entries. More...
 
uint Count (void) const
 
void Insert (const QString &sUSN, DeviceLocation *pEntry)
 Inserts a device location into the cache. More...
 
void Remove (const QString &sUSN)
 Removes a specific entry from the cache. More...
 
uint RemoveStale (TaskTime ttNow)
 Removes expired cache entries, returning the number removed. More...
 
DeviceLocationFind (const QString &sUSN)
 Finds the Device in the cache, returns nullptr when absent. More...
 
DeviceLocationGetFirst (void)
 Returns random entry in cache, returns nullptr when list is empty. More...
 
void GetEntryMap (EntryMap &map)
 Returns a copy of the EntryMap. More...
 
QTextStream & OutputXML (QTextStream &os, uint *pnEntryCount=nullptr) const
 Outputs the XML for this service. More...
 
void Dump (uint &nEntryCount) const
 Prints this service to the console in human readable form. More...
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Static Public Member Functions

static QString GetNormalizedUSN (const QString &sUSN)
 Returns a normalized USN, so that capitalization of the uuid is not an issue. More...
 
- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 

Static Public Attributes

static int g_nAllocated = 0
 

Protected Member Functions

 ~SSDPCacheEntries () override
 Destructor protected to enforce Release method usage. More...
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

Protected Attributes

QMutex m_mutex
 
EntryMap m_mapEntries
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Detailed Description

Definition at line 35 of file ssdpcache.h.

Constructor & Destructor Documentation

◆ ~SSDPCacheEntries()

SSDPCacheEntries::~SSDPCacheEntries ( )
overrideprotected

Destructor protected to enforce Release method usage.

Definition at line 37 of file ssdpcache.cpp.

◆ SSDPCacheEntries()

SSDPCacheEntries::SSDPCacheEntries ( )

Definition at line 32 of file ssdpcache.cpp.

Member Function Documentation

◆ Clear()

void SSDPCacheEntries::Clear ( void  )

Clears the cache of all entries.

Definition at line 44 of file ssdpcache.cpp.

Referenced by ~SSDPCacheEntries().

◆ Count()

uint SSDPCacheEntries::Count ( void  ) const
inline

◆ Insert()

void SSDPCacheEntries::Insert ( const QString &  sUSN,
DeviceLocation pEntry 
)

Inserts a device location into the cache.

Definition at line 97 of file ssdpcache.cpp.

Referenced by SSDPCache::Add().

◆ Remove()

void SSDPCacheEntries::Remove ( const QString &  sUSN)

Removes a specific entry from the cache.

Definition at line 120 of file ssdpcache.cpp.

Referenced by SSDPCache::Remove().

◆ RemoveStale()

uint SSDPCacheEntries::RemoveStale ( TaskTime  ttNow)

Removes expired cache entries, returning the number removed.

Definition at line 143 of file ssdpcache.cpp.

Referenced by SSDPCache::RemoveStale().

◆ Find()

DeviceLocation * SSDPCacheEntries::Find ( const QString &  sUSN)

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

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

Definition at line 59 of file ssdpcache.cpp.

Referenced by SSDPCache::Add(), and SSDPCache::Find().

◆ GetFirst()

DeviceLocation * SSDPCacheEntries::GetFirst ( void  )

Returns random entry in cache, returns nullptr when list is empty.

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

Definition at line 73 of file ssdpcache.cpp.

Referenced by MythContextPrivate::UPnPautoconf().

◆ GetEntryMap()

void SSDPCacheEntries::GetEntryMap ( EntryMap map)

Returns a copy of the EntryMap.

Note
Caller must call DecrRef() on each entry in the map.

Definition at line 85 of file ssdpcache.cpp.

Referenced by SatIP::doUPNPsearch(), VBox::doUPNPSearch(), HttpStatus::FillStatusXML(), V2Status::FillStatusXML(), and BackendSelection::Init().

◆ OutputXML()

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

Outputs the XML for this service.

Definition at line 176 of file ssdpcache.cpp.

◆ Dump()

void SSDPCacheEntries::Dump ( uint nEntryCount) const

Prints this service to the console in human readable form.

Definition at line 200 of file ssdpcache.cpp.

◆ GetNormalizedUSN()

QString SSDPCacheEntries::GetNormalizedUSN ( const QString &  sUSN)
static

Returns a normalized USN, so that capitalization of the uuid is not an issue.

Definition at line 221 of file ssdpcache.cpp.

Referenced by Find(), Insert(), and Remove().

Member Data Documentation

◆ g_nAllocated

int SSDPCacheEntries::g_nAllocated = 0
static

◆ m_mutex

QMutex SSDPCacheEntries::m_mutex
mutableprotected

Definition at line 66 of file ssdpcache.h.

Referenced by Clear(), Dump(), Find(), GetEntryMap(), GetFirst(), Insert(), OutputXML(), Remove(), and RemoveStale().

◆ m_mapEntries

EntryMap SSDPCacheEntries::m_mapEntries
protected

Definition at line 67 of file ssdpcache.h.

Referenced by Clear(), Dump(), Find(), GetEntryMap(), GetFirst(), Insert(), OutputXML(), Remove(), and RemoveStale().


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