From 600478aa63e4a999a27294d985283e25a6173581 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 17 Dec 2004 01:39:10 +0000 Subject: [PATCH] debug output --- panda/src/express/datagram.cxx | 28 ++++++++++++++++++++++++++++ panda/src/express/datagram.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/panda/src/express/datagram.cxx b/panda/src/express/datagram.cxx index e9a342575b..014c4f74be 100644 --- a/panda/src/express/datagram.cxx +++ b/panda/src/express/datagram.cxx @@ -154,3 +154,31 @@ append_data(const void *data, size_t size) { _data.v().push_back(source[i]); } } + +//////////////////////////////////////////////////////////////////// +// Function : output +// Access : Public +// Description : Write a string representation of this instance to +// . +//////////////////////////////////////////////////////////////////// +void Datagram:: +output(ostream &out) const { + #ifndef NDEBUG //[ + out<<""<<"Datagram"; + #endif //] NDEBUG +} + +//////////////////////////////////////////////////////////////////// +// Function : write +// Access : Public +// Description : Write a string representation of this instance to +// . +//////////////////////////////////////////////////////////////////// +void Datagram:: +write(ostream &out, unsigned int indent) const { + #ifndef NDEBUG //[ + out.width(indent); + out<<""<<"Datagram:\n"; + dump_hex(out); + #endif //] NDEBUG +} diff --git a/panda/src/express/datagram.h b/panda/src/express/datagram.h index c43dc512d6..3ae866afa7 100644 --- a/panda/src/express/datagram.h +++ b/panda/src/express/datagram.h @@ -98,6 +98,9 @@ PUBLISHED: INLINE bool operator != (const Datagram &other) const; INLINE bool operator < (const Datagram &other) const; + void output(ostream &out) const; + void write(ostream &out, unsigned int indent=0) const; + private: PTA_uchar _data;