ArnLib  4.0.x
Active Registry Network
ArnDepend Class Reference

Class for setting up dependencis to needed services. More...

#include <ArnDepend.hpp>

Inheritance diagram for ArnDepend:
Collaboration diagram for ArnDepend:

Public Types

typedef ArnDependSlot DepSlot
 

Signals

void completed ()
 Signal emitted when all dependent services are available. More...
 

Public Member Functions

 ArnDepend (QObject *parent=arnNullptr)
 
 ~ArnDepend ()
 
void add (const QString &serviceName, int stateId=-1)
 Add a dependency for a service More...
 
void add (const QString &serviceName, const QString &stateName)
 Add a dependency for a service More...
 
void setMonitorName (const QString &name)
 Set an optional monitor name for debugging. More...
 
void startMonitor ()
 Starting the dependency monitor. More...
 

Detailed Description

Class for setting up dependencis to needed services.

The services can be both system types available by internal Arn, and custom application types. The system types have a service name starting with "$".

This is typically used when an application needs a service to continue. When using persistent values, a client will need to know when they have been synced from the server. Then it's convenient to setup a dependency for the system service "$Persist".

When all dependent services are available, the completed() signal is emitted.

Example usage

// In class declare
ArnDepend* _arnDepend;
// In class code
_arnDepend = new ArnDepend( this);
_arnDepend->setMonitorName("MyApp_Monitor"); // Optional for debug
_arnDepend->add("$Persist");
_arnDepend->add("MyService");
_arnDepend->startMonitor();
connect( _arnDepend, SIGNAL(completed()), this, SLOT(arnDependOk()));

Definition at line 132 of file ArnDepend.hpp.

Member Typedef Documentation

◆ DepSlot

typedef ArnDependSlot ArnDepend::DepSlot

Definition at line 138 of file ArnDepend.hpp.

Constructor & Destructor Documentation

◆ ArnDepend()

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

Definition at line 170 of file ArnDepend.cpp.

◆ ~ArnDepend()

ArnDepend::~ArnDepend ( )

Definition at line 186 of file ArnDepend.cpp.

Member Function Documentation

◆ add() [1/2]

void ArnDepend::add ( const QString &  serviceName,
int  stateId = -1 
)

Add a dependency for a service

Parameters
[in]serviceNameis the name of the needed service.
[in]stateIdis the needed state id number. -1 is don't care.

Definition at line 221 of file ArnDepend.cpp.

◆ add() [2/2]

void ArnDepend::add ( const QString &  serviceName,
const QString &  stateName 
)

Add a dependency for a service

Parameters
[in]serviceNameis the name of the needed service.
[in]stateNameis the needed state name.

Definition at line 213 of file ArnDepend.cpp.

◆ completed

void ArnDepend::completed ( )
signal

Signal emitted when all dependent services are available.

◆ setMonitorName()

void ArnDepend::setMonitorName ( const QString &  name)

Set an optional monitor name for debugging.

Parameters
[in]nameis the monitor name.

Definition at line 229 of file ArnDepend.cpp.

◆ startMonitor()

void ArnDepend::startMonitor ( )

Starting the dependency monitor.

Definition at line 237 of file ArnDepend.cpp.


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