-/* $Id: package.hpp,v 1.15 2006-03-16 10:40:59 adam Exp $
+/* $Id: package.hpp,v 1.22 2006-08-30 10:48:52 adam Exp $
Copyright (c) 2005-2006, Index Data.
-%LICENSE%
+ See the LICENSE file for details
*/
#ifndef YP2_PACKAGE_HPP
#define YP2_PACKAGE_HPP
-#include <iostream>
+#include <iosfwd>
#include <stdexcept>
-#include <yaz++/gdu.h>
+#include <yazpp/gdu.h>
#include "router.hpp"
#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,
TCPIP
} type;
std::string address; // UNIX+TCPIP
- int port; // TCPIP only
+ unsigned long origin_id;
public:
- Origin() : type(API) {};
+ Origin();
+ void set_tcpip_address(std::string addr, unsigned long id);
};
class Package {
~Package();
- Package(metaproxy_1::Session &session, metaproxy_1::Origin &origin);
+ Package(metaproxy_1::Session &session,
+ const metaproxy_1::Origin &origin);
Package & copy_filter(const Package &p);
};
}
+
+
#endif
/*
* Local variables: