X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Forigin.cpp;h=758134d0314cf29bfea7684cfc2ba14f5dc78e49;hb=bb050094eaf8f0a8223a3bd2e9973d8d2e993154;hp=0def0143e43683cbb94b3e6a4b1e318172b2988d;hpb=daae7f857790a8826c1db2f0452c0a7d0ebb15e5;p=metaproxy-moved-to-github.git diff --git a/src/origin.cpp b/src/origin.cpp index 0def014..758134d 100644 --- a/src/origin.cpp +++ b/src/origin.cpp @@ -1,36 +1,60 @@ -/* $Id: origin.cpp,v 1.1 2006-08-30 10:48:52 adam Exp $ - Copyright (c) 2005-2006, Index Data. +/* $Id: origin.cpp,v 1.5 2007-01-25 14:05:54 adam Exp $ + Copyright (c) 2005-2007, Index Data. See the LICENSE file for details */ -#include "config.hpp" -#include "package.hpp" +//#include "config.hpp" +#include "origin.hpp" #include namespace mp = metaproxy_1; -mp::Origin::Origin() : type(API) -{ - origin_id = 0; +mp::Origin::Origin(std::string listen_host, + unsigned int listen_port) + : m_type(API), m_address(""), m_origin_id(0), + m_listen_host(listen_host), m_listen_port(listen_port) +{ } +std::string mp::Origin::listen_host() const +{ + return m_listen_host; +}; + +std::string & mp::Origin::listen_host() +{ + return m_listen_host; +}; + +unsigned int mp::Origin::listen_port() const +{ + return m_listen_port; +}; + +unsigned int & mp::Origin::listen_port() +{ + return m_listen_port; +}; + + + void mp::Origin::set_tcpip_address(std::string addr, unsigned long s) { - address = addr; - origin_id = s; - type = TCPIP; + m_type = TCPIP; + m_address = addr; + m_origin_id = s; } std::ostream& std::operator<<(std::ostream& os, mp::Origin& o) { - if (o.address != "") - os << o.address; + if (o.m_address != "") + os << o.m_address; else os << "0"; - os << ":" << o.origin_id; + os << ":" << o.m_origin_id; return os; }