Ejemplo n.º 1
0
void ServiceRegistry::Get(const std::string& clazz,
                          const std::string& filter,
                          BundlePrivate* bundle,
                          std::vector<ServiceReferenceBase>& res) const
{
  this->Lock(), Get_unlocked(clazz, filter, bundle, res);
}
Ejemplo n.º 2
0
ServiceReference ServiceRegistry::Get(ModulePrivate* module, const std::string& clazz) const
{
  MutexLocker lock(mutex);
  try
  {
    std::list<ServiceReference> srs;
    Get_unlocked(clazz, "", module, srs);
    MITK_INFO << "get service ref " << clazz << " for module "
             << module->info.name << " = " << srs.size() << " refs";

    if (!srs.empty())
    {
      return srs.front();
    }
  }
  catch (const std::invalid_argument& )
  { }

  return ServiceReference();
}
Ejemplo n.º 3
0
ServiceReferenceBase ServiceRegistry::Get(BundlePrivate* bundle,
                                          const std::string& clazz) const
{
  auto l = this->Lock();
  US_UNUSED(l);
  try {
    std::vector<ServiceReferenceBase> srs;
    Get_unlocked(clazz, "", bundle, srs);
    DIAG_LOG(*core->sink) << "get service ref " << clazz << " for bundle "
                          << bundle->symbolicName << " = " << srs.size()
                          << " refs";

    if (!srs.empty()) {
      return srs.back();
    }
  } catch (const std::invalid_argument&) {
  }

  return ServiceReferenceBase();
}
Ejemplo n.º 4
0
void ServiceRegistry::Get(const std::string& clazz, const std::string& filter,
                          ModulePrivate* module, std::list<ServiceReference>& res) const
{
  MutexLocker lock(mutex);
  Get_unlocked(clazz, filter, module, res);
}
Ejemplo n.º 5
0
void ServiceRegistry::Get(
  const std::string& clazz,
  std::vector<ServiceRegistrationBase>& serviceRegs) const
{
  this->Lock(), Get_unlocked(clazz, serviceRegs);
}