/*

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.

*/

#include <oess_1/defs/h/ex.hpp>

#include <oess_1/scheme/h/errno.hpp>
#include <oess_1/scheme/h/types.hpp>

namespace oess_1 {

namespace scheme {

//
// base_t
//

base_t::~base_t()
{
}

//
// cpp_mapping_t
//

cpp_mapping_t::~cpp_mapping_t()
{
}

//
// attr_cont_kind_t
//

attr_cont_kind_t::~attr_cont_kind_t()
{
}

//
// attr_type_t
//

attr_type_t::~attr_type_t()
{
}

//
// attr_present_if_t
//

attr_present_if_t::~attr_present_if_t()
{}

//
// attr_default_t
//

attr_default_t::~attr_default_t()
{}

//
// attr_t
//

attr_t::~attr_t()
{
}

//
// type_t
//

type_t::~type_t()
{
}

//
// single_obj_kind_t
//

single_obj_kind_t::~single_obj_kind_t()
{
}

oess_1::int_t
single_obj_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_vector_kind_t
//

stl_vector_kind_t::~stl_vector_kind_t()
{
}

oess_1::int_t
stl_vector_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_list_kind_t
//

stl_list_kind_t::~stl_list_kind_t()
{
}

oess_1::int_t
stl_list_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_deque_kind_t
//

stl_deque_kind_t::~stl_deque_kind_t()
{
}

oess_1::int_t
stl_deque_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_set_kind_t
//

stl_set_kind_t::~stl_set_kind_t()
{
}

oess_1::int_t
stl_set_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_multiset_kind_t
//

stl_multiset_kind_t::~stl_multiset_kind_t()
{
}

oess_1::int_t
stl_multiset_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_map_base_kind_t
//

stl_map_base_kind_t::~stl_map_base_kind_t()
{
}

//
// stl_map_kind_t
//

stl_map_kind_t::~stl_map_kind_t()
{
}

oess_1::int_t
stl_map_kind_t::query_kind_id() const
{
	return e_id;
}

//
// stl_multimap_kind_t
//

stl_multimap_kind_t::~stl_multimap_kind_t()
{
}

oess_1::int_t
stl_multimap_kind_t::query_kind_id() const
{
	return e_id;
}

//
// fixed_vector_kind_t
//

fixed_vector_kind_t::~fixed_vector_kind_t()
{
}

oess_1::int_t
fixed_vector_kind_t::query_kind_id() const
{
	return e_id;
}

//
// type_kind_processor_t
//

type_kind_processor_t::~type_kind_processor_t()
{
}

void
type_kind_processor_t::process_type_kind(
	const attr_type_t & k )
{
	switch( k.query_type_kind() ) {
		case attr_type_t::e_value :
			on_value_kind( k );
		break;

		case attr_type_t::e_ptr :
			on_ptr_kind( k );
		break;

		case attr_type_t::e_extension :
			on_extension_kind( k );
		break;

		default :
			OESS_THROW_LOGIC(
				oess_1::scheme::err::c_invalid_attr_type_kind,
				"type kind id: " << k.query_type_kind() )
	}
}

//
// cont_kind_processor_t
//

cont_kind_processor_t::~cont_kind_processor_t()
{
}

void
cont_kind_processor_t::process_cont_kind(
	const attr_cont_kind_t & k )
{
	switch( k.query_kind_id() ) {
		case single_obj_kind_t::e_id :
			on_single_obj_kind( dynamic_cast<
				const single_obj_kind_t & >( k ) );
		break;

		case stl_vector_kind_t::e_id :
			on_stl_vector_kind( dynamic_cast<
				const stl_vector_kind_t & >( k ) );
		break;

		case stl_list_kind_t::e_id :
			on_stl_list_kind( dynamic_cast<
				const stl_list_kind_t & >( k ) );
		break;

		case stl_deque_kind_t::e_id :
			on_stl_deque_kind( dynamic_cast<
				const stl_deque_kind_t & >( k ) );
		break;

		case stl_set_kind_t::e_id :
			on_stl_set_kind( dynamic_cast<
				const stl_set_kind_t & >( k ) );
		break;

		case stl_multiset_kind_t::e_id :
			on_stl_multiset_kind( dynamic_cast<
				const stl_multiset_kind_t & >( k ) );
		break;

		case stl_map_kind_t::e_id :
			on_stl_map_kind( dynamic_cast<
				const stl_map_kind_t & >( k ) );
		break;

		case stl_multimap_kind_t::e_id :
			on_stl_multimap_kind( dynamic_cast<
				const stl_multimap_kind_t & >( k ) );
		break;

		case fixed_vector_kind_t::e_id :
			on_fixed_vector_kind( dynamic_cast<
				const fixed_vector_kind_t & >( k ) );
		break;

		default :
			OESS_THROW_LOGIC(
				oess_1::scheme::err::c_invalid_attr_cont_kind,
				"cont kind id: " << k.query_kind_id() )
	}
}

} /* scheme */

} /* namespace oess_1 */

