本文整理汇总了C++中NetIO::container方法的典型用法代码示例。如果您正苦于以下问题:C++ NetIO::container方法的具体用法?C++ NetIO::container怎么用?C++ NetIO::container使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetIO
的用法示例。
在下文中一共展示了NetIO::container方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSlotNetworks
//------------------------------------------------------------------------------
// setSlotNetworks() -- Set our list of networks
//------------------------------------------------------------------------------
bool Station::setSlotNetworks(Basic::PairStream* const a)
{
bool ok = true;
// Remove the old networks list
if (networks != 0) {
// we are no longer the container for these networks
for (Basic::List::Item* item = networks->getFirstItem(); item != 0; item = item->getNext()) {
Basic::Pair* pair = (Basic::Pair*)(item->getValue());
NetIO* p = (NetIO*)( pair->object() );
p->container(0);
}
}
// Set our network list pointer
networks = a;
// Make sure the new network list is setup correctly
if (networks != 0) {
for (Basic::List::Item* item = networks->getFirstItem(); item != 0; item = item->getNext()) {
Basic::Pair* pair = (Basic::Pair*)(item->getValue());
NetIO* p = dynamic_cast<NetIO*>( pair->object() );
if (p != 0) {
// We are this network's container
p->container(this);
}
else {
// Not of the proper type
std::cerr << "Player::setSlotNetworks: network at slot \"" << pair->slot() << "\" is not of class type NetIO" << std::endl;
ok = false;
}
}
}
return ok;
}