简体   繁体   English

OMNeT ++缓冲区设计

[英]OMNeT++ buffer design

I'm trying to implement a FIFO buffer as a OMNeT++ node. 我正在尝试将FIFO缓冲区实现为OMNeT ++节点。 However I'm stuck deciding the best way to model it. 但是,我一直在决定最好的建模方法。

The buffer has basically one input gate and one output gate. 缓冲器基本上具有一个输入门和一个输出门。 What I want to obtain is that the sender is not allowed to send() messages to the buffer when it is full. 我要获得的是,发送器已满时,不允许发送器将消息发送到缓冲区。 How can I get this information without having the buffer's pointer? 如何在没有缓冲区指针的情况下获取此信息? I identified some workarounds for it, however I would like to know if there is a best practice for this kind of problems. 我确定了一些解决方法,但是我想知道是否存在针对此类问题的最佳实践。

Thanks in advance. 提前致谢。

Peeking into the other module is fine as that's the easiest way to implement this out of band communication. 探究其他模块很好,因为这是实现此带外通信的最简单方法。 The queueinglib example in OMNeT++ does this also with the Server , PassiveQueue module pair. OMNeT ++中的queueinglib示例也使用ServerPassiveQueue模块对进行此操作。 They are tightly coupled and communicate this information through predefined interfaces (IServer, IPassiveQueue). 它们紧密耦合,并通过预定义的接口(IServer,IPassiveQueue)传达此信息。

Tips: you should look up the other module through the connection and not through the actual module name and you should also check whether the module has the type you expect. 提示:您应该通过连接而不是实际的模块名称来查找另一个模块,还应该检查该模块是否具有所需的类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM