Virgil IoT KIT
Public Types | Public Member Functions
VSQDeviceRoles Class Reference

Device roles. More...

#include <VSQDeviceRoles.h>

Public Types

using TRolesList = std::initializer_list< VirgilIoTKit::vs_snap_device_role_e >
 Device roles list. More...
 

Public Member Functions

 VSQDeviceRoles ()=default
 
 VSQDeviceRoles (uint32_t roles)
 Assign device roles as bits mask. More...
 
VSQDeviceRolesoperator<< (VirgilIoTKit::vs_snap_device_role_e role)
 Add device role. More...
 
QString description (const QString &divider=QString(", ")) const
 Describe device roles. More...
 
 operator QString () const
 Describe device roles. More...
 
 operator uint32_t () const
 Get vs_snap_device_role_e bits mask. More...
 
bool equal (const VSQDeviceRoles &deviceRole) const
 Compare device roles. More...
 
bool hasRole (VirgilIoTKit::vs_snap_device_role_e role) const
 Check device role. More...
 
bool hasRoles (TRolesList roles) const
 Check device roles. More...
 

Detailed Description

Device roles.

Member Typedef Documentation

◆ TRolesList

Device roles list.

Constructor & Destructor Documentation

◆ VSQDeviceRoles() [1/2]

VSQDeviceRoles::VSQDeviceRoles ( )
default

◆ VSQDeviceRoles() [2/2]

VSQDeviceRoles::VSQDeviceRoles ( uint32_t  roles)

Assign device roles as bits mask.

Parameters
rolesDevice roles vs_snap_device_role_e bits mask

Member Function Documentation

◆ description()

QString VSQDeviceRoles::description ( const QString &  divider = QString(", ")) const

Describe device roles.

Call this function to receive text description. You can set any divider divider, for example '
' to obtain multiline description

Parameters
dividerDivider string
Returns
Device roles text description
Here is the caller graph for this function:

◆ equal()

bool VSQDeviceRoles::equal ( const VSQDeviceRoles deviceRole) const
inline

Compare device roles.

Parameters
deviceRoleDevice role to be compared with the current one
Returns
true if both device roles are equal

◆ hasRole()

bool VSQDeviceRoles::hasRole ( VirgilIoTKit::vs_snap_device_role_e  role) const
inline

Check device role.

This function returns true if role is present in the device roles list

Parameters
roleDevice role to check
Returns
true if role is present

◆ hasRoles()

bool VSQDeviceRoles::hasRoles ( TRolesList  roles) const

Check device roles.

This function returns true if all roles from the roles list are present in the device roles list

Parameters
rolesDevice roles list to check
Returns
true if all roles are present

◆ operator QString()

VSQDeviceRoles::operator QString ( ) const
inline

Describe device roles.

description function call

Here is the call graph for this function:

◆ operator uint32_t()

VSQDeviceRoles::operator uint32_t ( ) const

Get vs_snap_device_role_e bits mask.

◆ operator<<()

VSQDeviceRoles& VSQDeviceRoles::operator<< ( VirgilIoTKit::vs_snap_device_role_e  role)
inline

Add device role.

Parameters
roleDevice role
Returns
Reference to the VSQDeviceRoles instance

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