1 /* $Id: package.hpp,v 1.9 2005-10-15 14:09:09 adam Exp $
2 Copyright (c) 2005, Index Data.
12 #include <yaz++/gdu.h>
16 #include "session.hpp"
26 std::string address; // UNIX+TCPIP
27 int port; // TCPIP only
29 Origin() : type(API) {};
35 : m_filter(0), m_router(0), m_data(0) {}
37 Package(yp2::Session &session, yp2::Origin &origin)
38 : m_session(session), m_origin(origin),
39 m_filter(0), m_router(0), m_data(0) {}
41 Package & copy_filter(const Package &p) {
42 m_router = p.m_router;
43 m_filter = p.m_filter;
47 /// send Package to it's next Filter defined in Router
49 m_filter = m_router->move(m_filter, this);
51 m_filter->process(*this);
54 /// access session - left val in assignment
55 yp2::Session & session() {
59 /// get function - right val in assignment
60 unsigned int data() const {
64 /// set function - left val in assignment
65 unsigned int & data() {
69 /// set function - can be chained
70 Package & data(const unsigned int & data){
76 /// get function - right val in assignment
77 Origin origin() const {
81 /// set function - left val in assignment
86 /// set function - can be chained
87 Package & origin(const Origin & origin){
92 Package & router(const Router &router){
98 yazpp_1::GDU &request() {
102 yazpp_1::GDU &response() {
103 return m_response_gdu;
106 /// get function - right val in assignment
107 Session session() const {
115 const filter::Base *m_filter;
116 const Router *m_router;
119 yazpp_1::GDU m_request_gdu;
120 yazpp_1::GDU m_response_gdu;
128 * indent-tabs-mode: nil
129 * c-file-style: "stroustrup"
131 * vim: shiftwidth=4 tabstop=8 expandtab