X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fpackage.hpp;h=3fb632b55636018f4094b811c15cc5f4f4ebb012;hb=d4568b825ff581eddc6ce212a859fef6004c4147;hp=1be3ed585a16c0a247d658e2a8295ba448f56875;hpb=1e61b0aa05e2351e33d909f7503eaf936a2d9bb0;p=metaproxy-moved-to-github.git diff --git a/src/package.hpp b/src/package.hpp index 1be3ed5..3fb632b 100644 --- a/src/package.hpp +++ b/src/package.hpp @@ -1,4 +1,4 @@ -/* $Id: package.hpp,v 1.17 2006-06-10 14:29:12 adam Exp $ +/* $Id: package.hpp,v 1.22 2006-08-30 10:48:52 adam Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -7,7 +7,7 @@ #ifndef YP2_PACKAGE_HPP #define YP2_PACKAGE_HPP -#include +#include #include #include @@ -15,18 +15,35 @@ #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 { @@ -35,7 +52,8 @@ namespace metaproxy_1 { ~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); @@ -88,6 +106,8 @@ namespace metaproxy_1 { }; } + + #endif /* * Local variables: