?? packet.h
字號:
/************************************************************************
* file name: packet.h
* description: test file.
* modification history
* --------------------
* 2003-5-2 16:40:21, created by zhuwei
*/
#ifndef _PACKET_H
#define _PACKET_H
/* includes----------------------------------------------------------- */
#include "systemc.h"
/* defines------------------------------------------------------------ */
/* typedefs----------------------------------------------------------- */
struct packet_type
{
long info;
int seq;
int retry;
inline bool operator == (const packet_type& rhs) const
{
return (rhs.info == info && rhs.seq == seq &&
rhs.retry == retry);
}
/*-------------------zhuwei add(2003-5-3 10:20:34)--------------------*/
/* Remember to provide all the operators when you defined your packet_type,
* or you will get an error: "error C2679: binary '<<' : no operator defined
* which takes a right-hand operand of type 'const struct packet_type' (or
* there is no acceptable conversion) "
*/
inline packet_type& operator = (const packet_type& rhs)
{
info = rhs.info;
seq = rhs.seq;
retry = rhs.retry;
return *this;
}
/*
inline friend void sc_trace(sc_trace_file *tf, const packet_type & v,
const sc_string& NAME )
{
sc_trace(tf,v.info, NAME + ".info");
sc_trace(tf,v.seq, NAME + ".seq");
sc_trace(tf,v.retry, NAME + ".retry");
}
*/
inline friend ostream& operator << ( ostream& os, packet_type const & v )
{
os << v.info << "." << v.seq << "." << v.retry;
return os;
}
/*----------------------end(2003-5-3 10:20:34)------------------------*/
};
/* externs------------------------------------------------------------ */
extern void sc_trace(sc_trace_file *tf, const packet_type& v,const sc_string& NAME);
/* globals------------------------------------------------------------ */
/* forward declarations----------------------------------------------- */
#endif /* _PACKET_H */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -