MIRA
Signals | Public Member Functions | Protected Slots | Protected Attributes | List of all members
ServiceSelectorBox Class Reference

This is a combobox with a method to populate it with names of services providing one of a set of specified interfaces. More...

#include <fw/ServiceSelectorBox.h>

Inheritance diagram for ServiceSelectorBox:
Inheritance graph
[legend]

Signals

void selected (std::string service)
 

Public Member Functions

 ServiceSelectorBox (QWidget *parent=nullptr)
 
void setInterface (const std::string &interface)
 Set an interface to find services for. More...
 
void setInterfaces (const std::vector< std::string > &interfaces)
 Set multiple interfaces to find (union of) services for. More...
 
void preferInitially (const std::string &service)
 Set a specific service to select automatically when it is discovered for the first time. More...
 
void updateServices ()
 Query available services for the selected interface and update the combobox. More...
 
std::string getSelectedService ()
 Get the name of the selected service. More...
 

Protected Slots

void selected (int index)
 

Protected Attributes

std::vector< std::string > mInterfaces
 
std::vector< std::string > mServices
 
std::string mPreferedService
 

Detailed Description

This is a combobox with a method to populate it with names of services providing one of a set of specified interfaces.

Frequently call updateServices() to keep the list of available services valid.

Constructor & Destructor Documentation

◆ ServiceSelectorBox()

ServiceSelectorBox ( QWidget *  parent = nullptr)

Member Function Documentation

◆ setInterface()

void setInterface ( const std::string &  interface)
inline

Set an interface to find services for.

◆ setInterfaces()

void setInterfaces ( const std::vector< std::string > &  interfaces)
inline

Set multiple interfaces to find (union of) services for.

◆ preferInitially()

void preferInitially ( const std::string &  service)
inline

Set a specific service to select automatically when it is discovered for the first time.

◆ updateServices()

void updateServices ( )

Query available services for the selected interface and update the combobox.

If the previously selected service is still available, it remains selected.

This should be called in the Qt thread (so it does not need locking against signal/slot selected()).

◆ getSelectedService()

std::string getSelectedService ( )

Get the name of the selected service.

Not protected against updateServices(). If this is to be called in a different thread, the caller must handle locking.

◆ selected [1/2]

void selected ( std::string  service)
signal

◆ selected [2/2]

void selected ( int  index)
inlineprotectedslot

Member Data Documentation

◆ mInterfaces

std::vector<std::string> mInterfaces
protected

◆ mServices

std::vector<std::string> mServices
protected

◆ mPreferedService

std::string mPreferedService
protected

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