ArnLib  4.0.x
Active Registry Network
ArnDiscoverBrowserB Class Reference

Browse() and resolve() together, may never be used to the same instance. More...

#include <ArnDiscover.hpp>

Inheritance diagram for ArnDiscoverBrowserB:
Collaboration diagram for ArnDiscoverBrowserB:

Signals

void serviceAdded (int index, const QString &name)
 Indicate service has been added (discovered) More...
 
void serviceRemoved (int index)
 Indicate service has been removed. More...
 
void infoUpdated (int index, ArnDiscoverInfo::State state)
 Indicate service has been updated. More...
 

Public Member Functions

 ArnDiscoverBrowserB (QObject *parent=arnNullptr)
 
 ~ArnDiscoverBrowserB ()
 
int serviceCount () const
 Return the number of active discover services. More...
 
const ArnDiscoverInfoinfoByIndex (int index)
 Return the discover service info by its index. More...
 
const ArnDiscoverInfoinfoById (int id)
 Return the discover service info by its id. More...
 
const ArnDiscoverInfoinfoByName (const QString &serviceName)
 Return the discover service info by its name. More...
 
int indexToId (int index)
 Return the discover service id by its index. More...
 
int IdToIndex (int id)
 Return the discover service index by its id. More...
 
int serviceNameToId (const QString &name)
 Return the discover service id by its name. More...
 
ArnDiscoverInfo::State defaultStopState () const
 Return the default stop state for this service discover browser. More...
 
void setDefaultStopState (ArnDiscoverInfo::State defaultStopState)
 Set the default stop state for this service discover browser. More...
 
bool goTowardState (int index, ArnDiscoverInfo::State state)
 Command a service to go towards a stop state. More...
 

Detailed Description

Browse() and resolve() together, may never be used to the same instance.

Definition at line 224 of file ArnDiscover.hpp.

Constructor & Destructor Documentation

◆ ArnDiscoverBrowserB()

ArnDiscoverBrowserB::ArnDiscoverBrowserB ( QObject *  parent = arnNullptr)
explicit

Definition at line 346 of file ArnDiscover.cpp.

◆ ~ArnDiscoverBrowserB()

ArnDiscoverBrowserB::~ArnDiscoverBrowserB ( )

Definition at line 354 of file ArnDiscover.cpp.

Member Function Documentation

◆ defaultStopState()

ArnDiscoverInfo::State ArnDiscoverBrowserB::defaultStopState ( ) const

Return the default stop state for this service discover browser.

This default stop state will be used for all services discovered by this browser.

Returns
default stop state
See also
setDefaultStopState()
goTowardState()
ArnDiscoverInfo::stopState()
State

Definition at line 463 of file ArnDiscover.cpp.

◆ goTowardState()

bool ArnDiscoverBrowserB::goTowardState ( int  index,
ArnDiscoverInfo::State  state 
)

Command a service to go towards a stop state.

The service is specified by its index. The wanted final state must be forward, otherwise it is ignored.

Parameters
[in]indexfor the service
[in]stateis the wanted final state
See also
defaultStopState()
infoUpdated()
ArnDiscoverInfo::stopState()
State

Definition at line 479 of file ArnDiscover.cpp.

◆ IdToIndex()

int ArnDiscoverBrowserB::IdToIndex ( int  id)

Return the discover service index by its id.

The index for a service info is only valid valid for a given moment, it can change as services are added and removed. If given a non existent id, -1 will be returned.

Parameters
[in]id
Returns
selected service discover index
See also
indexToId()
infoByIndex()

Definition at line 413 of file ArnDiscover.cpp.

◆ indexToId()

int ArnDiscoverBrowserB::indexToId ( int  index)

Return the discover service id by its index.

The index for a service info is only valid valid for a given moment, it can change as services are added and removed. If given an invalid index, -1 will be returned.

Parameters
[in]index
Returns
selected service discover id
See also
IdToIndex()
infoById()

Definition at line 403 of file ArnDiscover.cpp.

◆ infoById()

const ArnDiscoverInfo & ArnDiscoverBrowserB::infoById ( int  id)

Return the discover service info by its id.

The id for a service info is unique and stays same over time, but the service can have been removed. If given a non existent service id, a Null discover info will be returned.

Parameters
[in]id
Returns
selected service discover info
See also
infoByIndex()

Definition at line 388 of file ArnDiscover.cpp.

◆ infoByIndex()

const ArnDiscoverInfo & ArnDiscoverBrowserB::infoByIndex ( int  index)

Return the discover service info by its index.

The index for a service info is only valid valid for a given moment, it can change as services are added and removed. If given an invalid index, a Null discover info will be returned.

Parameters
[in]index
Returns
selected service discover info
See also
infoById()
infoByName()
indexToId()

Definition at line 376 of file ArnDiscover.cpp.

◆ infoByName()

const ArnDiscoverInfo & ArnDiscoverBrowserB::infoByName ( const QString &  serviceName)

Return the discover service info by its name.

The service name is unique for a given moment, but the service can be removed and then reappear with a different service name. Also non used service names can be reused for a different service. If given a non existent service name, a Null discover info will be returned.

Parameters
[in]serviceName
Returns
selected service discover info
See also
serviceNameToId()

Definition at line 397 of file ArnDiscover.cpp.

◆ infoUpdated

void ArnDiscoverBrowserB::infoUpdated ( int  index,
ArnDiscoverInfo::State  state 
)
signal

Indicate service has been updated.

Parameters
[in]indexfor the service
[in]stateis the current state of the service info
See also
goTowardState()
serviceAdded()

◆ serviceAdded

void ArnDiscoverBrowserB::serviceAdded ( int  index,
const QString &  name 
)
signal

Indicate service has been added (discovered)

The service has been added to a list sorted by ascending service names. The index is a reference to this sorted list.

Parameters
[in]indexfor the service
[in]nameis the service name e.g. "My House Registry"
See also
serviceRemoved()
infoUpdated()

◆ serviceCount()

int ArnDiscoverBrowserB::serviceCount ( ) const

Return the number of active discover services.

Returns
number of services

Definition at line 368 of file ArnDiscover.cpp.

◆ serviceNameToId()

int ArnDiscoverBrowserB::serviceNameToId ( const QString &  name)

Return the discover service id by its name.

The service name is unique for a given moment. If given a non existent service name, -1 will be returned.

Parameters
[in]name
Returns
selected service discover id
See also
IdToIndex()
infoByName()

Definition at line 421 of file ArnDiscover.cpp.

◆ serviceRemoved

void ArnDiscoverBrowserB::serviceRemoved ( int  index)
signal

Indicate service has been removed.

Parameters
[in]indexfor the service
See also
serviceAdded()

◆ setDefaultStopState()

void ArnDiscoverBrowserB::setDefaultStopState ( ArnDiscoverInfo::State  defaultStopState)

Set the default stop state for this service discover browser.

This default stop state will be used for all services discovered by this browser.

Parameters
[in]defaultStopState
See also
defaultStopState()
goTowardState()
ArnDiscoverInfo::stopState()
State

Definition at line 471 of file ArnDiscover.cpp.


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