Пример #1
0
  monitor * monitor_factory::create_monitor_by_name(const std::string& name,
                                                    std::vector<std::string> paths,
                                                    FSW_EVENT_CALLBACK * callback,
                                                    void * context)
  {
    auto i = type_by_string().find(name);

    if (i == type_by_string().end())
      return nullptr;
    else
      return monitor::create_monitor(i->second, paths, callback, context);
  }
Пример #2
0
  vector<string> monitor_factory::get_types()
  {
    vector<string> types;

    for (auto & i : type_by_string())
    {
      types.push_back(i.first);
    }

    return types;
  }
Пример #3
0
static const gsl_cqpminimizer_type* get_type(VALUE t)
{

  switch (TYPE(t)) {
  case T_STRING:
    return type_by_string(t);
    break;
  default:
    rb_raise(rb_eTypeError, "Wrong argument type %s.", rb_class2name(CLASS_OF(t)));
  }
}
Пример #4
0
 void monitor_factory::register_type(const std::string& name, fsw_monitor_type type)
 {
   type_by_string()[name] = type;
 }
Пример #5
0
  bool monitor_factory::exists_type(const std::string& name)
  {
    auto i = type_by_string().find(name);

    return (i != type_by_string().end());
  }