本文整理汇总了C++中Link::GetSenderNext方法的典型用法代码示例。如果您正苦于以下问题:C++ Link::GetSenderNext方法的具体用法?C++ Link::GetSenderNext怎么用?C++ Link::GetSenderNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::GetSenderNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestCreate
void TestCreate() {
ScopedPass pass("Link::Create()");
OrNeuron neuron1;
OrNeuron neuron2;
Link * link = Link::Create(neuron1, neuron2);
assert(neuron1.GetOutputCount() == 1);
assert(neuron1.GetInputCount() == 0);
assert(neuron2.GetOutputCount() == 0);
assert(neuron2.GetInputCount() == 1);
assert(&link->GetSender() == &neuron1);
assert(&link->GetReceiver() == &neuron2);
assert(link->GetSenderNext() == nullptr);
assert(link->GetReceiverNext() == nullptr);
Link * link1 = Link::Create(neuron1, neuron2);
assert(neuron1.GetOutputCount() == 2);
assert(neuron1.GetInputCount() == 0);
assert(neuron2.GetOutputCount() == 0);
assert(neuron2.GetInputCount() == 2);
assert(&link1->GetSender() == &neuron1);
assert(&link1->GetReceiver() == &neuron2);
assert(link1->GetSenderNext() == link);
assert(link1->GetReceiverNext() == link);
assert(link->GetSenderNext() == nullptr);
assert(link->GetReceiverNext() == nullptr);
link->Remove();
link1->Remove();
}