X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fpackage.hpp;h=466d7a0beb298aa1125698503936ed79530c2ced;hb=a715926f3a2dc33f605b119561ccac38322f1c7b;hp=b00ebeb197d0c3f5aed532053252a7ab5f737ce4;hpb=48cfd383e1e94fa9d34d8a783b7c0137ae598a9d;p=metaproxy-moved-to-github.git diff --git a/src/package.hpp b/src/package.hpp index b00ebeb..466d7a0 100644 --- a/src/package.hpp +++ b/src/package.hpp @@ -1,5 +1,5 @@ -/* $Id: package.hpp,v 1.23 2006-09-14 19:53:57 marc Exp $ - Copyright (c) 2005-2006, Index Data. +/* $Id: package.hpp,v 1.26 2007-01-25 14:05:54 adam Exp $ + Copyright (c) 2005-2007, Index Data. See the LICENSE file for details */ @@ -8,43 +8,25 @@ #define YP2_PACKAGE_HPP #include -#include + #include #include "router.hpp" #include "filter.hpp" #include "session.hpp" +#include "origin.hpp" -namespace metaproxy_1 -{ - class Origin; +namespace metaproxy_1 { 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 - unsigned long origin_id; - public: - Origin(); - void set_tcpip_address(std::string addr, unsigned long id); - }; class Package { public: @@ -55,6 +37,7 @@ namespace metaproxy_1 { Package(metaproxy_1::Session &session, const metaproxy_1::Origin &origin); + /// shallow copy constructor which only copies the filter chain info Package & copy_filter(const Package &p); /// send Package to it's next Filter defined in Router @@ -75,6 +58,7 @@ namespace metaproxy_1 { /// set function - can be chained Package & origin(const Origin & origin); + /// set function - can be chained Package & router(const Router &router); yazpp_1::GDU &request();