QWlanManager
Loading...
Searching...
No Matches
qwm::CachePolicy Class Reference

Class allowing to determine the cache policy to adopt. More...

Public Member Functions

 CachePolicy ()
 Set a default cache policy.
 
 CachePolicy (int maxScans, qint64 maxDelay)
 Set a custom cache policy.
 
 CachePolicy (const CachePolicy &other)
 
 CachePolicy (CachePolicy &&other)
 
int getMaxScans () const
 Retrieve maximum number of scans to miss to consider a network as unavailable.
 
qint64 getMaxDelay () const
 Retrieve maximum delay in milliseconds to consider a network as unavailable.
 
void setMaxScans (int maxScans)
 Set maximum scans to miss to consider a network as unavailable.
 
void setMaxDelay (qint64 maxDelay)
 Set maximum delay to consider a network as unavailable.
 
bool operator== (const CachePolicy &other) const
 
bool operator!= (const CachePolicy &other) const
 
CachePolicyoperator= (const CachePolicy &other)
 
CachePolicyoperator= (CachePolicy &&other) noexcept
 

Properties

int maxScans
 
qint64 maxDelay
 

Detailed Description

Class allowing to determine the cache policy to adopt.

Cache policy feature allow to workaround some "weird" behaviour from the native API.
For example, we can perform a scan and retrieve 20 networks, later performing the same scan (all networks are still available) but due to some internal behaviour, scan can returns [0-4] networks over the 20 available.
The cache policy allow to set a network cache, allowing to remove a network from our available list only if cache has expired.
This class is also compatible with QML.

See also
Interface::setCachePolicy()

Constructor & Destructor Documentation

◆ CachePolicy() [1/2]

qwm::CachePolicy::CachePolicy ( )

Set a default cache policy.

This is the default cache policy, keeping the native behaviour.

◆ CachePolicy() [2/2]

qwm::CachePolicy::CachePolicy ( int maxScans,
qint64 maxDelay )

Set a custom cache policy.

Parameters
[in]maxScansMaximum number of scan to miss to consider a network unavailable.
[in]maxDelayMaximum delay in milliseconds to consider a network unavailable.
See also
setMaxScans(), setMaxDelay()

Member Function Documentation

◆ getMaxScans()

int qwm::CachePolicy::getMaxScans ( ) const

Retrieve maximum number of scans to miss to consider a network as unavailable.

Returns
Returns maximum number of scans.
See also
setMaxScans()
getMaxDelay()

◆ getMaxDelay()

qint64 qwm::CachePolicy::getMaxDelay ( ) const

Retrieve maximum delay in milliseconds to consider a network as unavailable.

Returns
Returns maximum delay in milliseconds.
See also
setMaxDelay()
getMaxScans()

◆ setMaxScans()

void qwm::CachePolicy::setMaxScans ( int maxScans)

Set maximum scans to miss to consider a network as unavailable.

Parameters
[in]maxScansMaximum number of scan to miss to consider a network unavailable.
See also
setMaxDelay()
getMaxScans()

◆ setMaxDelay()

void qwm::CachePolicy::setMaxDelay ( qint64 maxDelay)

Set maximum delay to consider a network as unavailable.

Parameters
[in]maxDelayMaximum delay in milliseconds to consider a network unavailable.
See also
getMaxDelay()
setMaxScans()

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