Supose I register two service instances for the same service:
string service = "Sardana";
string inst1 = "XAS";
string inst2 = "NCD";
string d1 = "my/first/device";
string d2 = "my/second/device";
db.register_service(service, inst1, d1);
db.register_service(service, inst2, d2);
Later in time I would like to know the service providers for all "Sardana" service:
I can do:
DbDatum result = db.get_services(service,"*")
vector<string> providers;
result >> providers;
As a result I get a list of devices that provide the service but I do not know which device provides the service for which instance.
I propose adding another method to extract service instances:
DbDatum get_service_instances(string &servicename);
(up to here it would be the minimum)
and to avoid multiple calls to the database, another get_services:
DbData get_services(string &service, vector<string> &serviceinstances );
In fact, ideally I think the get_propety API should be replicated by having:
DbData get_services(string &servicename, string &serviceinstance);
void get_services(string &servicename, DbData &inst);
DbData get_service_instances(string &servicename);
but this would break compatibility with older versions (although I think nobody is using the "Service" feature yet)
Fixed in release 8.1.2