Esempio n. 1
0
AbridgedTopics dev::shh::abridge(Topics const& _topics)
{
	AbridgedTopics ret;
	ret.reserve(_topics.size());
	for (auto const& t: _topics)
		ret.push_back(abridge(t));
	return ret;
}
Esempio n. 2
0
static bool isTopicsEqual(const Topics& actualTopics, const Topics& expectedTopics)
{
    if (actualTopics.size() != expectedTopics.size()) {
        return false;
    }

    for (const auto& actualTopic : actualTopics) {
        bool found = false;
        for (const auto& expectedTopic : expectedTopics) {
            if (actualTopic.id == expectedTopic.id && actualTopic.name == expectedTopic.name &&
                    actualTopic.subscriptionType == expectedTopic.subscriptionType)
            {
                found = true;
                break;
            }
        }
        if (!found) {
            return false;
        }
    }

   return true;
}