1 /* $Id: package.hpp,v 1.27 2007-05-09 21:23:09 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef YP2_PACKAGE_HPP
23 #define YP2_PACKAGE_HPP
27 #include <yazpp/gdu.h>
31 #include "session.hpp"
34 namespace metaproxy_1 {
41 std::ostream& operator<<(std::ostream& os, metaproxy_1::Package& p);
44 namespace metaproxy_1 {
52 Package(metaproxy_1::Session &session,
53 const metaproxy_1::Origin &origin);
55 /// shallow copy constructor which only copies the filter chain info
56 Package & copy_filter(const Package &p);
58 /// send Package to it's next Filter defined in Router
61 /// send Package to other route
62 void move(std::string route);
64 /// access session - left val in assignment
65 metaproxy_1::Session & session();
67 /// get function - right val in assignment
68 Origin origin() const;
70 /// set function - left val in assignment
73 /// set function - can be chained
74 Package & origin(const Origin & origin);
76 /// set function - can be chained
77 Package & router(const Router &router);
79 yazpp_1::GDU &request();
81 yazpp_1::GDU &response();
83 /// get function - right val in assignment
84 Session session() const;
90 RoutePos *m_route_pos;
94 yazpp_1::GDU m_request_gdu;
95 yazpp_1::GDU m_response_gdu;
105 * indent-tabs-mode: nil
106 * c-file-style: "stroustrup"
108 * vim: shiftwidth=4 tabstop=8 expandtab