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


C++ UIDSet::Size方法代码示例

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


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

示例1: DiscoverySuccessful

/**
 * Called when discovery completes
 */
void DiscoveryAgentTest::DiscoverySuccessful(const UIDSet *expected,
                                             bool successful,
                                             const UIDSet &received) {
  OLA_INFO << "in discovery callback, size is " << received.Size() <<
      ", state: " << successful;
  CPPUNIT_ASSERT(successful);
  CPPUNIT_ASSERT_EQUAL(*expected, received);
  m_callback_run = true;
}
开发者ID:Siliconsoul,项目名称:ola,代码行数:12,代码来源:DiscoveryAgentTest.cpp

示例2: DiscoveryFailed

/**
 * Called when discovery completes and fails for some reason.
 */
void DiscoveryAgentTest::DiscoveryFailed(const UIDSet *expected,
                                         bool successful,
                                         const UIDSet &received) {
  OLA_INFO << "in discovery callback, size is " << received.Size() <<
      ", state: " << successful;
  OLA_ASSERT_FALSE(successful);
  OLA_ASSERT_EQ(*expected, received);
  m_callback_run = true;
}
开发者ID:DouglasHeriot,项目名称:ola,代码行数:12,代码来源:DiscoveryAgentTest.cpp

示例3: testUIDSet

/*
 * Test the UIDSet
 */
void UIDTest::testUIDSet() {
  UIDSet set1;
  OLA_ASSERT_EQ(0u, set1.Size());

  UID uid(1, 2);
  UID uid2(2, 10);
  set1.AddUID(uid);
  OLA_ASSERT_EQ(1u, set1.Size());
  OLA_ASSERT_EQ(string("0001:00000002"), set1.ToString());
  OLA_ASSERT_TRUE(set1.Contains(uid));
  OLA_ASSERT_FALSE(set1.Contains(uid2));
  set1.AddUID(uid);
  OLA_ASSERT_EQ(1u, set1.Size());

  set1.AddUID(uid2);
  OLA_ASSERT_EQ(2u, set1.Size());
  OLA_ASSERT_EQ(string("0001:00000002,0002:0000000a"), set1.ToString());
  OLA_ASSERT_TRUE(set1.Contains(uid));
  OLA_ASSERT_TRUE(set1.Contains(uid2));

  UIDSet set2(set1);
  OLA_ASSERT_EQ(set1, set2);
  UIDSet set3;
  OLA_ASSERT_EQ(0u, set3.Size());
  set3 = set2;
  OLA_ASSERT_EQ(set1, set2);

  set3.RemoveUID(uid2);
  OLA_ASSERT_EQ(1u, set3.Size());
  OLA_ASSERT_EQ(string("0001:00000002"), set3.ToString());

  UIDSet difference = set1.SetDifference(set3);
  OLA_ASSERT_EQ(1u, difference.Size());
  OLA_ASSERT_TRUE(set1.Contains(uid));
  OLA_ASSERT_TRUE(set1.Contains(uid2));

  difference = set3.SetDifference(set1);
  OLA_ASSERT_EQ(0u, difference.Size());
}
开发者ID:basileus,项目名称:ola,代码行数:42,代码来源:UIDTest.cpp

示例4: ShowUIDs

 void ShowUIDs() {
   UIDSet::Iterator iter = m_uids.Begin();
   cout << "---------- " << m_uids.Size() << " UIDs -------" << endl;
   char c = 'A';
   for (; iter != m_uids.End(); ++iter) {
     if (c <= 'Z') {
       cout << *iter << " (" << c++ << ")" << endl;
     } else {
       cout << *iter << endl;
     }
   }
   cout << "-------------------------" << endl;
 }
开发者ID:DanielAeolusLaude,项目名称:ola,代码行数:13,代码来源:ja-rule-controller.cpp

示例5: SetIdentify

  void SetIdentify(bool identify_on) {
    JaRuleWidget *widget = m_widget_manager->GetWidget();
    if (!widget) {
      return;
    }

    if (m_uids.Size() == 0) {
      OLA_WARN << "No UIDs";
      return;
    }

    uint8_t param_data = identify_on;
    RDMSetRequest *request = new RDMSetRequest(
        m_widget_uid, m_selected_uid, 0, 0, 0, ola::rdm::PID_IDENTIFY_DEVICE,
        &param_data, sizeof(param_data));
    widget->SendRDMRequest(request, NULL);
  }
开发者ID:DanielAeolusLaude,项目名称:ola,代码行数:17,代码来源:ja-rule-controller.cpp


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