📄 closure_stats.pr.c
字号:
/* Process model C form file: closure_stats.pr.c */
/* Portions of this file copyright 1992-2002 by OPNET Technologies, Inc. */
/* This variable carries the header into the object file */
static const char closure_stats_pr_c [] = "MIL_3_Tfile_Hdr_ 90A 30A op_runsim 7 44427600 44427600 1 dick Yangguang 0 0 none none 0 0 none 0 0 0 0 0 0 ";
#include <string.h>
/* OPNET system definitions */
#include <opnet.h>
#if defined (__cplusplus)
extern "C" {
#endif
FSM_EXT_DECS
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif
#if !defined (VOSD_NO_FIN)
#undef BIN
#undef BOUT
#define BIN FIN_LOCAL_FIELD(last_line_passed) = __LINE__ - _block_origin;
#define BOUT BIN
#define BINIT FIN_LOCAL_FIELD(last_line_passed) = 0; _block_origin = __LINE__;
#else
#define BINIT
#endif /* #if !defined (VOSD_NO_FIN) */
/* State variable definitions */
typedef struct
{
/* Internal state tracking for FSM */
FSM_SYS_STATE
/* State Variables */
Stathandle link_failure_lshandle;
} closure_stats_state;
#define pr_state_ptr ((closure_stats_state*) SimI_Mod_State_Ptr)
#define link_failure_lshandle pr_state_ptr->link_failure_lshandle
/* This macro definition will define a local variable called */
/* "op_sv_ptr" in each function containing a FIN statement. */
/* This variable points to the state variable data structure, */
/* and can be used from a C debugger to display their values. */
#undef FIN_PREAMBLE
#define FIN_PREAMBLE closure_stats_state *op_sv_ptr = pr_state_ptr;
/* No Function Block */
enum { _block_origin = __LINE__ };
/* Undefine optional tracing in FIN/FOUT/FRET */
/* The FSM has its own tracing code and the other */
/* functions should not have any tracing. */
#undef FIN_TRACING
#define FIN_TRACING
#undef FOUTRET_TRACING
#define FOUTRET_TRACING
#if defined (__cplusplus)
extern "C" {
#endif
void closure_stats (void);
Compcode closure_stats_init (void **);
void closure_stats_diag (void);
void closure_stats_terminate (void);
void closure_stats_svar (void *, const char *, char **);
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif
/* Process model interrupt handling procedure */
void
closure_stats (void)
{
int _block_origin = 0;
FIN (closure_stats ());
if (1)
{
FSM_ENTER (closure_stats)
FSM_BLOCK_SWITCH
{
/*---------------------------------------------------------*/
/** state (init) enter executives **/
FSM_STATE_ENTER_UNFORCED_NOLABEL (0, "init", "closure_stats [init enter execs]")
FSM_PROFILE_SECTION_IN ("closure_stats [init enter execs]", state0_enter_exec)
{
/* Register the link closure failure statistic. */
link_failure_lshandle = op_stat_reg ("Link Closure Failure (failures/sec)", OPC_STAT_INDEX_NONE, OPC_STAT_LOCAL);
}
FSM_PROFILE_SECTION_OUT ("closure_stats [init enter execs]", state0_enter_exec)
/** blocking after enter executives of unforced state. **/
FSM_EXIT (1,closure_stats)
/** state (init) exit executives **/
FSM_STATE_EXIT_UNFORCED (0, "init", "closure_stats [init exit execs]")
FSM_PROFILE_SECTION_IN ("closure_stats [init exit execs]", state0_exit_exec)
{
}
FSM_PROFILE_SECTION_OUT ("closure_stats [init exit execs]", state0_exit_exec)
/** state (init) transition processing **/
FSM_TRANSIT_MISSING ("init")
/*---------------------------------------------------------*/
}
FSM_EXIT (0,closure_stats)
}
}
#if defined (__cplusplus)
extern "C" {
#endif
extern VosT_Fun_Status Vos_Catmem_Register (const char * , int , VosT_Void_Null_Proc, VosT_Address *);
extern VosT_Address Vos_Catmem_Alloc (VosT_Address, size_t);
extern VosT_Fun_Status Vos_Catmem_Dealloc (VosT_Address);
#if defined (__cplusplus)
}
#endif
Compcode
closure_stats_init (void ** gen_state_pptr)
{
int _block_origin = 0;
static VosT_Address obtype = OPC_NIL;
FIN (closure_stats_init (gen_state_pptr))
if (obtype == OPC_NIL)
{
/* Initialize memory management */
if (Vos_Catmem_Register ("proc state vars (closure_stats)",
sizeof (closure_stats_state), Vos_Vnop, &obtype) == VOSC_FAILURE)
{
FRET (OPC_COMPCODE_FAILURE)
}
}
*gen_state_pptr = Vos_Catmem_Alloc (obtype, 1);
if (*gen_state_pptr == OPC_NIL)
{
FRET (OPC_COMPCODE_FAILURE)
}
else
{
/* Initialize FSM handling */
((closure_stats_state *)(*gen_state_pptr))->current_block = 0;
FRET (OPC_COMPCODE_SUCCESS)
}
}
void
closure_stats_diag (void)
{
/* No Diagnostic Block */
}
void
closure_stats_terminate (void)
{
int _block_origin = __LINE__;
FIN (closure_stats_terminate (void))
Vos_Catmem_Dealloc (pr_state_ptr);
FOUT
}
/* Undefine shortcuts to state variables to avoid */
/* syntax error in direct access to fields of */
/* local variable prs_ptr in closure_stats_svar function. */
#undef link_failure_lshandle
void
closure_stats_svar (void * gen_ptr, const char * var_name, char ** var_p_ptr)
{
closure_stats_state *prs_ptr;
FIN (closure_stats_svar (gen_ptr, var_name, var_p_ptr))
if (var_name == OPC_NIL)
{
*var_p_ptr = (char *)OPC_NIL;
FOUT
}
prs_ptr = (closure_stats_state *)gen_ptr;
if (strcmp ("link_failure_lshandle" , var_name) == 0)
{
*var_p_ptr = (char *) (&prs_ptr->link_failure_lshandle);
FOUT
}
*var_p_ptr = (char *)OPC_NIL;
FOUT
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -