Update of /cvsroot/zephyrchat/zchat/ZephyrLib
In directory sc8-pr-cvs1:/tmp/cvs-serv4116
Modified Files:
ZGram.cpp ZGram.h
Log Message:
Add ZQuad::reverse() and operator<< for ZTriple and ZQuad.
These are for debugging/future purposes; not currently used by ZephyrLib.
Index: ZGram.cpp
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZGram.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ZGram.cpp 28 Feb 2003 22:16:34 -0000 1.6
+++ ZGram.cpp 30 Apr 2003 19:24:00 -0000 1.7
@@ -4,6 +4,8 @@
#include "ZGram.h"
#include "ZephyrMgr.h"
+using namespace zephyrlib;
+
const zephyrlib::ZQuad zephyrlib::ZQuad::Everything("*", "*", "*", "*");
@@ -89,6 +91,19 @@
return ZTriple(klass, instance, recipient);
}
+
+ZQuad zephyrlib::ZQuad::reverse() const {
+ return ZQuad(dest.klass, dest.instance, sender, dest.recipient);
+}
+
+std::ostream& operator<<(std::ostream &ostr, const ZTriple &triple) {
+ return (ostr << triple.klass << "/" << triple.instance << "/" << triple.recipient);
+}
+
+std::ostream& operator<<(std::ostream &ostr, const ZQuad &quad) {
+ return (ostr << "destination: " << quad.dest << " sender: " << quad.sender);
+}
+
/* ZWrite::GetSignature
* ZWrite::GetMessage
Index: ZGram.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZGram.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ZGram.h 28 Feb 2003 22:16:34 -0000 1.12
+++ ZGram.h 30 Apr 2003 19:24:01 -0000 1.13
@@ -112,11 +112,9 @@
return false;
return dest.containsExactRecipient(b.dest);
};
-};
-
-
-
+ ZQuad reverse() const;
+};
// Outside world's interface to ZephyrPacket
// Externally, ZGram never uses the realm.
@@ -190,5 +188,8 @@
// A helper function or two
} // namespace zephyrlib
+
+std::ostream& operator<<(std::ostream &ostr, const zephyrlib::ZTriple &triple);
+std::ostream& operator<<(std::ostream &ostr, const zephyrlib::ZQuad &quad);
#endif
|