/*

Copyright (c) 2002-2005, Yauheni Akhotnikau
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

- The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

*/

/*!
	\file
	\brief Реализация интерфейса %abstract_connector_t,
	осуществляющая работу непосредственно с объектом
	localhost.
*/

#if !defined( _OESS_1__DB__SITE__IMPL__LOCALHOST_CONNECTOR_HPP_ )
#define _OESS_1__DB__SITE__IMPL__LOCALHOST_CONNECTOR_HPP_

#include <oess_1/db/site/h/localhost.hpp>
#include <oess_1/db/site/h/abstract_connector.hpp>

namespace oess_1 {

namespace db {

namespace site {

namespace impl {

//
// localhost_connector_t
//

/*!
	\brief Реализация интерфейса %abstract_connector_t,
	осуществляющая работу непосредственно с объектом
	localhost.

	Данная реализация предназначена для случаев, когда сервер
	базы данных встроен в само приложение, работающее
	с базой данных.
*/
class	localhost_connector_t :
	public abstract_connector_t
{
	public :
		localhost_connector_t(
			localhost_t & localhost );
		virtual ~localhost_connector_t();

		virtual const std::string &
		query_client_id() const;

		virtual void
		transmit(
			const impl::req_wrapper_t & req,
			impl::resp_wrapper_t & resp_wrapper,
			oess_1::uint_t awaiting_resp_id );

	private :
		//! Сервер, с которым производится работа.
		localhost_t &	m_localhost;
		//! Идентификатор клиента, назначенный этому объекту.
		std::string	m_client_id;
};

} /* namespace impl */

} /* namespace site */

} /* namespace db */

} /* namespace oess_1 */

#endif
