本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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;
}
示例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,
¶m_data, sizeof(param_data));
widget->SendRDMRequest(request, NULL);
}