Oment++3.3源码分析1

本文档详细介绍了Oment++3.3中处理节点(Node)、通道(Channel)和数据结构(Datum)的实现,包括Node类的工作原理、Port类的功能以及Channel类在生产者-消费者问题中的应用。节点通过Port和Channel建立数据流网络,用于数据的缓冲和传输。
摘要由CSDN通过智能技术生成
    从今天开始分析OMNET的原代码结构,首先分析一些预定的文件。
1. def.h
 
Def.h代码分析
// OPP_DLLIMPORT/EXPORT are empty if not needed
#if defined(__WIN32__)
# define OPP_DLLEXPORT __declspec(dllexport)
# if defined(WIN32_DLL)
#    define OPP_DLLIMPORT __declspec(dllimport)
# else
#     define OPP_DLLIMPORT
# endif
#else
# define OPP_DLLIMPORT
# define OPP_DLLEXPORT
#endif
 
// SIM_API, ENVIR_API etc are also empty if not needed
#ifdef BUILDING_SIM
# define SIM_API OPP_DLLEXPORT
#else
# define SIM_API OPP_DLLIMPORT
#endif
 
// we need this because cenvir.h is in our directory
#ifdef BUILDING_ENVIR
# define ENVIR_API OPP_DLLEXPORT
#else
# define ENVIR_API OPP_DLLIMPORT
#endif
 
//=== NULL的定义
#ifndef NULL
#define NULL ((void*)0)
#endif
 
// maximum lengths for className(), fullPath() and old info(buf) strings
#define MAX_CLASSNAME        100
#define MAX_OBJECTFULLPATH 1024
#define MAX_OBJECTINFO       500
 
// in case someone still needs the old name
#define FULLPATHBUF_SIZE MAX_OBJECTFULLPATH
#ifndef NDEBUG
#define ASSERT(expr) /
 ((void) ((expr) ? 0 : /
           (opp_error("ASSERT: condition %s false, %s line %d", /
                             #expr, __FILE__, __LINE__), 0)))
#else
#define ASSERT(expr) ((void)0)
#endif
/**
 * Modelled time.
 */
typedef double       simtime_t;
#define MAXTIME   HUGE_VAL
/*HUGE_VAL是double类型所能代表的最大值,当数学函数在运行的时候发生错误的时候返回此值,有些函数返回的是-HUGE_VAL
*/
/*
这个函数的原型是用来清除用户定义的数据结构,通过调用一些对象,比如( cPar,cLinkedList
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值