projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
started access logging of Z39.50 packages, partially done init, search
[metaproxy-moved-to-github.git]
/
src
/
package.hpp
diff --git
a/src/package.hpp
b/src/package.hpp
index
f756511
..
987a3c8
100644
(file)
--- a/
src/package.hpp
+++ b/
src/package.hpp
@@
-1,16
+1,21
@@
+/* $Id: package.hpp,v 1.18 2006-06-19 23:54:02 adam Exp $
+ Copyright (c) 2005-2006, Index Data.
-#ifndef PACKAGE_HPP
-#define PACKAGE_HPP
+ See the LICENSE file for details
+ */
+
+#ifndef YP2_PACKAGE_HPP
+#define YP2_PACKAGE_HPP
#include <iostream>
#include <stdexcept>
#include <iostream>
#include <stdexcept>
-#include <yaz++/gdu.h>
+#include <yazpp/gdu.h>
#include "router.hpp"
#include "filter.hpp"
#include "session.hpp"
#include "router.hpp"
#include "filter.hpp"
#include "session.hpp"
-namespace yp2 {
+namespace metaproxy_1 {
class Origin {
enum origin_t {
class Origin {
enum origin_t {
@@
-23,93
+28,61
@@
namespace yp2 {
public:
Origin() : type(API) {};
};
public:
Origin() : type(API) {};
};
-
+
class Package {
public:
class Package {
public:
- Package()
- : m_filter(0), m_router(0), m_data(0) {}
+ Package();
+
+ ~Package();
- Package(yp2::Session &session, yp2::Origin &origin)
- : m_session(session), m_origin(origin),
- m_filter(0), m_router(0), m_data(0) {}
+ Package(metaproxy_1::Session &session, const
+ metaproxy_1::Origin &origin);
- Package & copy_filter(const Package &p) {
- m_router = p.m_router;
- m_filter = p.m_filter;
- return *this;
- }
+ Package & copy_filter(const Package &p);
/// send Package to it's next Filter defined in Router
/// send Package to it's next Filter defined in Router
- void move() {
- m_filter = m_router->move(m_filter, this);
- if (m_filter)
- m_filter->process(*this);
- }
+ void move();
+
+ /// send Package to other route
+ void move(std::string route);
/// access session - left val in assignment
/// access session - left val in assignment
- yp2::Session & session() {
- return m_session;
- }
+ metaproxy_1::Session & session();
/// get function - right val in assignment
/// get function - right val in assignment
- unsigned int data() const {
- return m_data;
- }
-
+ int data() const;
+
/// set function - left val in assignment
/// set function - left val in assignment
- unsigned int & data() {
- return m_data;
- }
+ int & data();
/// set function - can be chained
/// set function - can be chained
- Package & data(const unsigned int & data){
- m_data = data;
- return *this;
- }
-
+ Package & data(const int & data);
/// get function - right val in assignment
/// get function - right val in assignment
- Origin origin() const {
- return m_origin;
- }
+ Origin origin() const;
/// set function - left val in assignment
/// set function - left val in assignment
- Origin & origin() {
- return m_origin;
- }
+ Origin & origin();
/// set function - can be chained
/// set function - can be chained
- Package & origin(const Origin & origin){
- m_origin = origin;
- return *this;
- }
-
- Package & router(const Router &router){
- m_filter = 0;
- m_router = &router;
- return *this;
- }
-
- yazpp_1::GDU &request() {
- return m_request_gdu;
- }
-
- yazpp_1::GDU &response() {
- return m_response_gdu;
- }
+ Package & origin(const Origin & origin);
+
+ Package & router(const Router &router);
+
+ yazpp_1::GDU &request();
+
+ yazpp_1::GDU &response();
/// get function - right val in assignment
/// get function - right val in assignment
- Session session() const {
- return m_session;
- }
+ Session session() const;
private:
Session m_session;
Origin m_origin;
private:
Session m_session;
Origin m_origin;
-
- const filter::Base *m_filter;
- const Router *m_router;
- unsigned int m_data;
+
+ RoutePos *m_route_pos;
+
+ int m_data;
yazpp_1::GDU m_request_gdu;
yazpp_1::GDU m_response_gdu;
yazpp_1::GDU m_request_gdu;
yazpp_1::GDU m_response_gdu;
@@
-121,6
+94,7
@@
namespace yp2 {
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
+ * c-file-style: "stroustrup"
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/