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
Z39.50 init handler can generate SRU diagnostics.
[metaproxy-moved-to-github.git]
/
src
/
package.cpp
diff --git
a/src/package.cpp
b/src/package.cpp
index
2e3276b
..
2b2c84c
100644
(file)
--- a/
src/package.cpp
+++ b/
src/package.cpp
@@
-1,37
+1,43
@@
-/* $Id: package.cpp,v 1.6 2006-01-11 11:51:50 adam Exp $
- Copyright (c) 2005, Index Data.
+/* $Id: package.cpp,v 1.17 2006-09-14 19:53:57 marc Exp $
+ Copyright (c) 2005-2006, Index Data.
-%LICENSE%
+ See the LICENSE file for details
*/
*/
-#include "config.hpp"
+#include "config.hpp"
#include "package.hpp"
#include "package.hpp"
-yp2::Package::Package()
- : m_route_pos(0), m_data(0)
+#include <iostream>
+
+namespace mp = metaproxy_1;
+
+mp::Package::Package()
+ : m_route_pos(0)
{
}
{
}
-yp2::Package::~Package()
+mp::Package::~Package()
{
delete m_route_pos;
}
{
delete m_route_pos;
}
-yp2::Package::Package(yp2::Session &session, yp2::Origin &origin)
+mp::Package::Package(mp::Session &session, const mp::Origin &origin)
: m_session(session), m_origin(origin),
: m_session(session), m_origin(origin),
- m_route_pos(0), m_data(0)
+ m_route_pos(0)
{
}
{
}
-yp2::Package & yp2::Package::copy_filter(const Package &p)
+
+mp::Package & mp::Package::copy_filter(const Package &p)
{
{
+ delete m_route_pos;
m_route_pos = p.m_route_pos->clone();
return *this;
}
m_route_pos = p.m_route_pos->clone();
return *this;
}
-void yp2::Package::move()
+void mp::Package::move()
{
if (m_route_pos)
{
{
if (m_route_pos)
{
@@
-41,7
+47,7
@@
void yp2::Package::move()
}
}
}
}
-void yp2::Package::move(std::string route)
+void mp::Package::move(std::string route)
{
if (m_route_pos)
{
{
if (m_route_pos)
{
@@
-53,65
+59,56
@@
void yp2::Package::move(std::string route)
}
}
-yp2::Session & yp2::Package::session()
+mp::Session & mp::Package::session()
{
return m_session;
}
{
return m_session;
}
-
-int yp2::Package::data() const
-{
- return m_data;
-}
-
-int & yp2::Package::data()
-{
- return m_data;
-}
-
-yp2::Package & yp2::Package::data(const int & data)
-{
- m_data = data;
- return *this;
-}
-
-yp2::Origin yp2::Package::origin() const
+mp::Origin mp::Package::origin() const
{
return m_origin;
}
{
return m_origin;
}
-yp2::Origin & yp2::Package::origin()
+mp::Origin & mp::Package::origin()
{
return m_origin;
}
{
return m_origin;
}
-yp2::Package & yp2::Package::origin(const Origin & origin)
+mp::Package & mp::Package::origin(const Origin & origin)
{
m_origin = origin;
return *this;
}
{
m_origin = origin;
return *this;
}
-yp2::Package & yp2::Package::router(const yp2::Router &router)
+mp::Package & mp::Package::router(const mp::Router &router)
{
m_route_pos = router.createpos();
return *this;
}
{
m_route_pos = router.createpos();
return *this;
}
-yazpp_1::GDU &yp2::Package::request()
+yazpp_1::GDU &mp::Package::request()
{
return m_request_gdu;
}
{
return m_request_gdu;
}
-yazpp_1::GDU &yp2::Package::response()
+yazpp_1::GDU &mp::Package::response()
{
return m_response_gdu;
}
{
return m_response_gdu;
}
-yp2::Session yp2::Package::session() const
+mp::Session mp::Package::session() const
{
return m_session;
}
{
return m_session;
}
+
+std::ostream& std::operator<<(std::ostream& os, mp::Package& p)
+{
+ os << p.origin() << " ";
+ os << p.session().id();
+ return os;
+}
+
/*
* Local variables:
/*
* Local variables: