ArnLib  4.0.x
Active Registry Network
ArnDiscoverInfo Class Reference

Class for holding current discover info of one service. More...

#include <ArnDiscover.hpp>

Classes

struct  State
 State of Arn discover browse data. Can be tested by relative order. More...
 

Public Member Functions

 ArnDiscoverInfo ()
 
 ArnDiscoverInfo (const ArnDiscoverInfo &other)
 
ArnDiscoverInfooperator= (const ArnDiscoverInfo &other)
 
 ~ArnDiscoverInfo ()
 
bool inProgress () const
 Is discover in progress for this service. More...
 
bool isError () const
 Is in an error state for this service. More...
 
State state () const
 Return the state for this service. More...
 
State stopState () const
 Return the stop state for this service. More...
 
ArnDiscover::Type type () const
 Return the discover type for this service. More...
 
QStringList groups () const
 Return the groups for this service. More...
 
QString serviceName () const
 Return the service name for this service. More...
 
QString domain () const
 Return the domain for this service. More...
 
QString hostName () const
 Return the host name for this service. More...
 
quint16 hostPort () const
 Return the port for this service. More...
 
QHostAddress hostIp () const
 Return the host ip-address for this service. More...
 
Arn::XStringMap properties () const
 Return the properties for this service. More...
 
QString typeString () const
 Return the printable type for this service. More...
 
QString hostPortString () const
 Return the printable host port for this service. More...
 
QString hostIpString () const
 Return the printable host ip-address for this service. More...
 
QString hostWithInfo () const
 Get the the HostWithInfo string. More...
 
int resolvCode () const
 Return the latest resolv error code for this service. More...
 

Friends

class ArnDiscoverBrowserB
 

Detailed Description

Class for holding current discover info of one service.

About Arn Discover

This class holds the service info and its discover state.

Definition at line 72 of file ArnDiscover.hpp.

Constructor & Destructor Documentation

◆ ArnDiscoverInfo() [1/2]

ArnDiscoverInfo::ArnDiscoverInfo ( )

Definition at line 60 of file ArnDiscover.cpp.

◆ ArnDiscoverInfo() [2/2]

ArnDiscoverInfo::ArnDiscoverInfo ( const ArnDiscoverInfo other)

Definition at line 72 of file ArnDiscover.cpp.

◆ ~ArnDiscoverInfo()

ArnDiscoverInfo::~ArnDiscoverInfo ( )

Definition at line 86 of file ArnDiscover.cpp.

Member Function Documentation

◆ domain()

QString ArnDiscoverInfo::domain ( ) const

Return the domain for this service.

Returns
domain, e.g. "local."

Definition at line 149 of file ArnDiscover.cpp.

◆ groups()

QStringList ArnDiscoverInfo::groups ( ) const

Return the groups for this service.

Groups are used for filtering discovered services. They will also be availabe as properties with naming as "group0", "group1" ...

Returns
groups, e.g. ("mydomain.se", "mydomain.se/House", "Any Group ID")
See also
ArnDiscoverAdvertise::setGroups()

Definition at line 133 of file ArnDiscover.cpp.

◆ hostIp()

QHostAddress ArnDiscoverInfo::hostIp ( ) const

Return the host ip-address for this service.

Returns
host ip-address

Definition at line 173 of file ArnDiscover.cpp.

◆ hostIpString()

QString ArnDiscoverInfo::hostIpString ( ) const

Return the printable host ip-address for this service.

Will return empty string if no valid ip available

Returns
host ip-address, e.g. "192.168.1.1", "" etc

Definition at line 213 of file ArnDiscover.cpp.

◆ hostName()

QString ArnDiscoverInfo::hostName ( ) const

Return the host name for this service.

Returns
host name, e.g. "myHost.local"
See also
ArnDiscoverAdvertise::advertiseService()

Definition at line 157 of file ArnDiscover.cpp.

◆ hostPort()

quint16 ArnDiscoverInfo::hostPort ( ) const

Return the port for this service.

Returns
port
See also
ArnDiscoverAdvertise::advertiseService()

Definition at line 165 of file ArnDiscover.cpp.

◆ hostPortString()

QString ArnDiscoverInfo::hostPortString ( ) const

Return the printable host port for this service.

Will return empty string if no valid port available

Returns
host port, e.g. "2022", "" etc

Definition at line 205 of file ArnDiscover.cpp.

◆ hostWithInfo()

QString ArnDiscoverInfo::hostWithInfo ( ) const

Get the the HostWithInfo string.

ArnClient and alike accepts such HostWithInfo strings for connection.

Returns
The HostWithInfo string, e.g. "192.168.1.1 [myhost.local]"
See also
Arn::makeHostWithInfo()

Definition at line 221 of file ArnDiscover.cpp.

◆ inProgress()

bool ArnDiscoverInfo::inProgress ( ) const

Is discover in progress for this service.

Return values
trueif discover is in progress
See also
state()

Definition at line 93 of file ArnDiscover.cpp.

◆ isError()

bool ArnDiscoverInfo::isError ( ) const

Is in an error state for this service.

Return values
trueif in error state
See also
state()

Definition at line 101 of file ArnDiscover.cpp.

◆ operator=()

ArnDiscoverInfo & ArnDiscoverInfo::operator= ( const ArnDiscoverInfo other)

Definition at line 78 of file ArnDiscover.cpp.

◆ properties()

XStringMap ArnDiscoverInfo::properties ( ) const

Return the properties for this service.

Will return booth Arn system properties and custom (application) properties. System properties will always have a key starting with a lower case letter e.g. "protovers".

Returns
properties
See also
ArnDiscoverAdvertise::setCustomProperties()

Definition at line 181 of file ArnDiscover.cpp.

◆ resolvCode()

int ArnDiscoverInfo::resolvCode ( ) const

Return the latest resolv error code for this service.

This code can come from booth resolving a service and lookup ip-address.

Returns
error code
See also
ArnZeroConf::Error

Definition at line 227 of file ArnDiscover.cpp.

◆ serviceName()

QString ArnDiscoverInfo::serviceName ( ) const

Return the service name for this service.

Returns
service name, e.g. "My House Registry"
See also
ArnDiscoverAdvertise::advertiseService()
ArnDiscoverAdvertise::setService()

Definition at line 141 of file ArnDiscover.cpp.

◆ state()

ArnDiscoverInfo::State ArnDiscoverInfo::state ( ) const

Return the state for this service.

Returns
state
See also
State

Definition at line 109 of file ArnDiscover.cpp.

◆ stopState()

ArnDiscoverInfo::State ArnDiscoverInfo::stopState ( ) const

Return the stop state for this service.

The discover logic will stop when reaching the stop state for a service.

Returns
stop state
See also
ArnDiscoverBrowserB::setDefaultStopState()
ArnDiscoverBrowserB::goTowardState()
State

Definition at line 117 of file ArnDiscover.cpp.

◆ type()

ArnDiscover::Type ArnDiscoverInfo::type ( ) const

Return the discover type for this service.

Returns
discover type
See also
Type
ArnDiscoverAdvertise::advertiseService()

Definition at line 125 of file ArnDiscover.cpp.

◆ typeString()

QString ArnDiscoverInfo::typeString ( ) const

Return the printable type for this service.

Returns
type, e.g. "Client"

Definition at line 189 of file ArnDiscover.cpp.

Friends And Related Function Documentation

◆ ArnDiscoverBrowserB

friend class ArnDiscoverBrowserB
friend

Definition at line 75 of file ArnDiscover.hpp.


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