we shouldn't ever pass around references to PacketPtrs,

const references are ok, or pass by value.

--HG--
extra : convert_revision : 7280a1c7d22b9294fddbe50f02f6f4c6ca9b2e5b
This commit is contained in:
Nathan Binkert
2004-11-13 16:33:16 -05:00
parent bd3e3c0230
commit acb98fb0f6
7 changed files with 22 additions and 22 deletions

View File

@@ -31,8 +31,8 @@
* components.
*/
#ifndef __ETHERINT_HH__
#define __ETHERINT_HH__
#ifndef __DEV_ETHERINT_HH__
#define __DEV_ETHERINT_HH__
#include <string>
@@ -54,13 +54,13 @@ class EtherInt : public SimObject
virtual ~EtherInt() {}
void setPeer(EtherInt *p);
virtual bool recvPacket(PacketPtr &packet) = 0;
void recvDone() { peer->sendDone(); }
bool sendPacket(PacketPtr &packet)
{
return peer ? peer->recvPacket(packet) : true;
}
virtual void sendDone() = 0;
bool sendPacket(PacketPtr packet)
{ return peer ? peer->recvPacket(packet) : true; }
virtual bool recvPacket(PacketPtr packet) = 0;
};
#endif // __ETHERINT_HH__
#endif // __DEV_ETHERINT_HH__