当前位置: 首页>>代码示例>>C++>>正文


C++ Trigger::SetQuery方法代码示例

本文整理汇总了C++中Trigger::SetQuery方法的典型用法代码示例。如果您正苦于以下问题:C++ Trigger::SetQuery方法的具体用法?C++ Trigger::SetQuery怎么用?C++ Trigger::SetQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trigger的用法示例。


在下文中一共展示了Trigger::SetQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dprintf

Manageable::status_t
Triggerd::AddTriggerToCollection(uint32_t key, ClassAd* ad, std::string& text)
{
   Trigger* trig;
   char* value;
   Manageable::status_t ret_val;

   dprintf(D_FULLDEBUG, "Triggerd::AddTriggerToCollection called\n");
   if (triggers.end() != triggers.find(key))
   {
      text = "Failed to create new trigger.  A trigger already exists with id ";
      text += key;
      ret_val = STATUS_USER + 1;
   }
   else
   {
      trig = new Trigger(singleton->getInstance(), key);
      if (NULL == trig)
      {
         text = "Failed to create new trigger.  Out of memory";
         ret_val = STATUS_USER + 2;
      }
      else
      {
         if (0 != ad->LookupString(ATTR_TRIGGER_NAME, &value))
         {
            ret_val = trig->SetName(value, text);
         }
         else
         {
            dprintf(D_ALWAYS, "Triggerd Error: '%s' not found in classad.  Failed to create new trigger.\n", ATTR_TRIGGER_NAME);
            text = "Failed to create new trigger.  Unable to find ";
            text += ATTR_TRIGGER_NAME;
            text += " in classad";
            ret_val = STATUS_USER + 3;
            delete trig;
         }
         if (STATUS_OK == ret_val)
         {
            if (0 != ad->LookupString(ATTR_TRIGGER_QUERY, &value))
            {
               ret_val = trig->SetQuery(value, text);
            }
            else
            {
               dprintf(D_ALWAYS, "Triggerd Error: '%s' not found in classad.  Failed to create new trigger.\n", ATTR_TRIGGER_QUERY);
               text = "Failed to create new trigger.  Unable to find ";
               text += ATTR_TRIGGER_QUERY;
               text += " in classad";
               ret_val = STATUS_USER + 3;
               delete trig;
            }
         }
         if (STATUS_OK == ret_val)
         {
            if (0 != ad->LookupString(ATTR_TRIGGER_TEXT, &value))
            {
               ret_val = trig->SetText(value, text);
            }
            else
            {
               dprintf(D_ALWAYS, "Triggerd Error: '%s' not found in classad.  Failed to create new trigger.\n", ATTR_TRIGGER_TEXT);
               text = "Failed to create new trigger.  Unable to find ";
               text += ATTR_TRIGGER_TEXT;
               text += " in classad";
               ret_val = STATUS_USER + 3;
               delete trig;
            }
         }

         if (STATUS_OK == ret_val)
         {
            triggers.insert(std::pair<uint32_t, Trigger*>(key, trig));
         }
      }
   }
   dprintf(D_FULLDEBUG, "Triggerd::AddTriggerToCollection exited with return value %d\n", ret_val);
   return ret_val;
}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:79,代码来源:Triggerd.cpp


注:本文中的Trigger::SetQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。