Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ersa::services::NetworkHandle Class Reference

#include <network_manager.h>

Collaboration diagram for ersa::services::NetworkHandle:
Collaboration graph
[legend]

Public Member Functions

 NetworkHandle ()
 
 NetworkHandle (NetworkManager *mgr)
 
 ~NetworkHandle ()
 
 NetworkHandle (const NetworkHandle &)=delete
 
NetworkHandle & operator= (const NetworkHandle &)=delete
 
 NetworkHandle (NetworkHandle &&other) noexcept
 
NetworkHandle & operator= (NetworkHandle &&other) noexcept
 
bool isValid () const
 Return whether this handle currently owns a network lease.
 
void release ()
 Release this handle's network lease.
 

Private Attributes

NetworkManager * mgr_ {nullptr}
 
bool active_ {false}
 

Constructor & Destructor Documentation

◆ NetworkHandle() [1/4]

ersa::services::NetworkHandle::NetworkHandle ( )
default

Construct an empty handle that holds no radio lease.

◆ NetworkHandle() [2/4]

ersa::services::NetworkHandle::NetworkHandle ( NetworkManager *  mgr)
explicit

Acquire one manager lease; move semantics ensure exactly-once release.

◆ ~NetworkHandle()

ersa::services::NetworkHandle::~NetworkHandle ( )

Release the held lease during scope cleanup.

◆ NetworkHandle() [3/4]

ersa::services::NetworkHandle::NetworkHandle ( const NetworkHandle &  )
delete

◆ NetworkHandle() [4/4]

ersa::services::NetworkHandle::NetworkHandle ( NetworkHandle &&  other)
noexcept

Transfer a live lease without changing the manager's reference count.

Member Function Documentation

◆ isValid()

bool ersa::services::NetworkHandle::isValid ( ) const
inline

Return whether this handle currently owns a network lease.

◆ operator=() [1/2]

NetworkHandle & ersa::services::NetworkHandle::operator= ( const NetworkHandle &  )
delete

◆ operator=() [2/2]

NetworkHandle & ersa::services::NetworkHandle::operator= ( NetworkHandle &&  other)
noexcept

Release this lease, then take ownership of the source lease.

◆ release()

void ersa::services::NetworkHandle::release ( )

Release this handle's network lease.

Member Data Documentation

◆ active_

bool ersa::services::NetworkHandle::active_ {false}
private

◆ mgr_

NetworkManager* ersa::services::NetworkHandle::mgr_ {nullptr}
private

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