ArnLib  4.0.x
Active Registry Network
ArnDependOffer Class Reference

Class for advertising that a service is available. More...

#include <ArnDepend.hpp>

Inheritance diagram for ArnDependOffer:
Collaboration diagram for ArnDependOffer:

Public Member Functions

 ArnDependOffer (QObject *parent=arnNullptr)
 
 ~ArnDependOffer ()
 
void advertise (const QString &serviceName)
 Advertise an available service More...
 
void setStateName (const QString &name)
 Set the state of the service by a logic name. More...
 
QString stateName () const
 
void setStateId (int id)
 Set the state of the service by an id number. More...
 
int stateId () const
 

Detailed Description

Class for advertising that a service is available.

Additionally it's possible to indicate the state of the service. The state can either be indicated by a logic name or by an id number whichever is prefered.

Example usage

// In class declare
ArnDependOffer* _depOffer;
// In class code
_depOffer = new ArnDependOffer( this);
_depOffer->advertise("MyService"); // Service now available

Definition at line 59 of file ArnDepend.hpp.

Constructor & Destructor Documentation

◆ ArnDependOffer()

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

Definition at line 56 of file ArnDepend.cpp.

◆ ~ArnDependOffer()

ArnDependOffer::~ArnDependOffer ( )

Definition at line 70 of file ArnDepend.cpp.

Member Function Documentation

◆ advertise()

void ArnDependOffer::advertise ( const QString &  serviceName)

Advertise an available service

Parameters
[in]serviceNameis the name of the service.

Definition at line 76 of file ArnDepend.cpp.

◆ setStateId()

void ArnDependOffer::setStateId ( int  id)

Set the state of the service by an id number.

The state starts of by 0 as default.

Parameters
[in]idis the state id number.

Definition at line 114 of file ArnDepend.cpp.

◆ setStateName()

void ArnDependOffer::setStateName ( const QString &  name)

Set the state of the service by a logic name.

The state starts of by "Start" as default.

Parameters
[in]nameis the state name.

Definition at line 98 of file ArnDepend.cpp.

◆ stateId()

int ArnDependOffer::stateId ( ) const
Returns
The state id number.
See also
setStateId()

Definition at line 122 of file ArnDepend.cpp.

◆ stateName()

QString ArnDependOffer::stateName ( ) const
Returns
The logic state name, e.g. the default "Start"
See also
setStateName()

Definition at line 106 of file ArnDepend.cpp.


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