From: Marc Cromme Date: Wed, 30 Aug 2006 08:44:29 +0000 (+0000) Subject: added m_target member to keep track of target information. This is to X-Git-Tag: METAPROXY.1.0.7~93 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=20a0ee8ffcc06380daaad873d35a9a0c24783963;p=metaproxy-moved-to-github.git added m_target member to keep track of target information. This is to be used in filters and logging --- diff --git a/src/package.cpp b/src/package.cpp index fa9889d..d128f4f 100644 --- a/src/package.cpp +++ b/src/package.cpp @@ -1,4 +1,4 @@ -/* $Id: package.cpp,v 1.11 2006-08-30 08:35:03 marc Exp $ +/* $Id: package.cpp,v 1.12 2006-08-30 08:44:58 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -28,6 +28,13 @@ mp::Package::Package(mp::Session &session, const mp::Origin &origin) { } +mp::Package::Package(mp::Session &session, + const mp::Origin &origin, const mp::Origin &target) + : m_session(session), m_origin(origin), m_target(target), + m_route_pos(0), m_data(0) +{ +} + mp::Package & mp::Package::copy_filter(const Package &p) { delete m_route_pos; @@ -96,6 +103,22 @@ mp::Package & mp::Package::origin(const Origin & origin) return *this; } +mp::Origin mp::Package::target() const +{ + return m_target; +} + +mp::Origin & mp::Package::target() +{ + return m_target; +} + +mp::Package & mp::Package::target(const Origin & target) +{ + m_target = target; + return *this; +} + mp::Package & mp::Package::router(const mp::Router &router) { m_route_pos = router.createpos(); diff --git a/src/package.hpp b/src/package.hpp index 56565ed..d90cc76 100644 --- a/src/package.hpp +++ b/src/package.hpp @@ -1,4 +1,4 @@ -/* $Id: package.hpp,v 1.19 2006-08-30 08:35:03 marc Exp $ +/* $Id: package.hpp,v 1.20 2006-08-30 08:44:29 marc Exp $ Copyright (c) 2005-2006, Index Data. See the LICENSE file for details @@ -52,8 +52,12 @@ namespace metaproxy_1 { ~Package(); - Package(metaproxy_1::Session &session, const - metaproxy_1::Origin &origin); + Package(metaproxy_1::Session &session, + const metaproxy_1::Origin &origin); + + Package(metaproxy_1::Session &session, + const metaproxy_1::Origin &origin, + const metaproxy_1::Origin &target); Package & copy_filter(const Package &p); @@ -84,6 +88,15 @@ namespace metaproxy_1 { /// set function - can be chained Package & origin(const Origin & origin); + /// get function - right val in assignment + Origin target() const; + + /// set function - left val in assignment + Origin & target(); + + /// set function - can be chained + Package & target(const Origin & target); + Package & router(const Router &router); yazpp_1::GDU &request(); @@ -96,6 +109,7 @@ namespace metaproxy_1 { private: Session m_session; Origin m_origin; + Origin m_target; RoutePos *m_route_pos;