-/* $Id: package.cpp,v 1.10 2006-08-01 13:03:41 adam Exp $
+/* $Id: package.cpp,v 1.11 2006-08-30 08:35:03 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
*/
-#include "config.hpp"
+#include "config.hpp"
#include "package.hpp"
+#include <iostream>
+
namespace mp = metaproxy_1;
mp::Package::Package()
{
return m_session;
}
+
+std::ostream& std::operator<<(std::ostream& os, mp::Package& p)
+{
+ os << p.session().id() << " ";
+ os << p.origin();
+ return os;
+}
+
+std::ostream& std::operator<<(std::ostream& os, mp::Origin& o)
+{
+ if (o.address != "")
+ os << o.address;
+ else
+ os << "0";
+ os << ":" << o.port;
+ return os;
+}
+
/*
* Local variables:
-/* $Id: package.hpp,v 1.18 2006-06-19 23:54:02 adam Exp $
+/* $Id: package.hpp,v 1.19 2006-08-30 08:35:03 marc Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
#ifndef YP2_PACKAGE_HPP
#define YP2_PACKAGE_HPP
-#include <iostream>
+#include <iosfwd>
#include <stdexcept>
#include <yazpp/gdu.h>
#include "filter.hpp"
#include "session.hpp"
+namespace metaproxy_1
+{
+ class Origin;
+ class Package;
+}
+
+
+namespace std
+{
+ std::ostream& operator<<(std::ostream& os, metaproxy_1::Origin& o);
+ std::ostream& operator<<(std::ostream& os, metaproxy_1::Package& p);
+}
+
namespace metaproxy_1 {
class Origin {
+ friend std::ostream&
+ std::operator<<(std::ostream& os, metaproxy_1::Origin& o);
+
enum origin_t {
API,
UNIX,
int port; // TCPIP only
public:
Origin() : type(API) {};
+
};
class Package {
};
}
+
+
#endif
/*
* Local variables: