X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fpackage.hpp;h=12dc911c6db172af0fc11b3b0a35b8f6c9532dd6;hb=263db488835e22820d79a4ffa46fb892b7837fd4;hp=1be3ed585a16c0a247d658e2a8295ba448f56875;hpb=1e61b0aa05e2351e33d909f7503eaf936a2d9bb0;p=metaproxy-moved-to-github.git diff --git a/src/package.hpp b/src/package.hpp index 1be3ed5..12dc911 100644 --- a/src/package.hpp +++ b/src/package.hpp @@ -1,33 +1,47 @@ -/* $Id: package.hpp,v 1.17 2006-06-10 14:29:12 adam Exp $ - Copyright (c) 2005-2006, Index Data. +/* $Id: package.hpp,v 1.27 2007-05-09 21:23:09 adam Exp $ + Copyright (c) 2005-2007, Index Data. - See the LICENSE file for details +This file is part of Metaproxy. + +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Metaproxy; see the file LICENSE. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ #ifndef YP2_PACKAGE_HPP #define YP2_PACKAGE_HPP -#include -#include +#include + #include #include "router.hpp" #include "filter.hpp" #include "session.hpp" +#include "origin.hpp" + +namespace metaproxy_1 { + class Package; +} + + +namespace std +{ + std::ostream& operator<<(std::ostream& os, metaproxy_1::Package& p); +} namespace metaproxy_1 { - - class Origin { - enum origin_t { - API, - UNIX, - TCPIP - } type; - std::string address; // UNIX+TCPIP - int port; // TCPIP only - public: - Origin() : type(API) {}; - }; class Package { public: @@ -35,8 +49,10 @@ namespace metaproxy_1 { ~Package(); - Package(metaproxy_1::Session &session, metaproxy_1::Origin &origin); + 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 @@ -49,15 +65,6 @@ namespace metaproxy_1 { metaproxy_1::Session & session(); /// get function - right val in assignment - int data() const; - - /// set function - left val in assignment - int & data(); - - /// set function - can be chained - Package & data(const int & data); - - /// get function - right val in assignment Origin origin() const; /// set function - left val in assignment @@ -66,6 +73,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(); @@ -81,13 +89,15 @@ namespace metaproxy_1 { RoutePos *m_route_pos; - int m_data; + //int m_data; yazpp_1::GDU m_request_gdu; yazpp_1::GDU m_response_gdu; }; } + + #endif /* * Local variables: