X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fpackage.hpp;h=de006bb48ebdaccff307f337077aa8c7ae4cd63c;hb=d0123337d70b0fb97b578cc57467bb94980f1014;hp=d1cc671a0795c7942e2da32497712372d84dfbdd;hpb=6bae168228128b1c87b5c531f559050b7e5603cf;p=metaproxy-moved-to-github.git diff --git a/src/package.hpp b/src/package.hpp index d1cc671..de006bb 100644 --- a/src/package.hpp +++ b/src/package.hpp @@ -1,50 +1,44 @@ -/* $Id: package.hpp,v 1.21 2006-08-30 09:56:41 marc Exp $ - Copyright (c) 2005-2006, Index Data. +/* This file is part of Metaproxy. + Copyright (C) 2005-2009 Index Data - See the LICENSE file for details - */ +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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef YP2_PACKAGE_HPP #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 - int port; // TCPIP only - public: - Origin() : type(API) {}; - - }; class Package { public: @@ -55,6 +49,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 @@ -67,15 +62,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 @@ -84,6 +70,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(); @@ -99,7 +86,7 @@ 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; @@ -112,8 +99,9 @@ namespace metaproxy_1 { /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil - * c-file-style: "stroustrup" * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +