/*
WARNING: This header should never be directly included. Include factory.h instead.

Author:		Chris Kaynor (chris@kaynor.net)
Edited By:	

Description:		Provides the code for the template class factory::Item.
		
Usage:		See factory_item.h for usage information and function and class comments.

Requirements:	See factory_item.h for requirements.
		
Last Edited:	May 20th, 2008
*/
/*
Copyright 2008 Chris Kaynor

This file is part of kLibrary.

kLibrary is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or(at your option) any later version.

kLibrary is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License.
*/

#ifndef KLIBRARY_FACTORY_ITEM_CODE_H
#define KLIBRARY_FACTORY_ITEM_CODE_H

#include "factory_item.h"

namespace kLibrary
{
	namespace factory
	{
		//Returns the name stored by the class.
		template<class paramType, class nameType>
		inline const nameType& Item<paramType, nameType>::getName(void) const
		{
			return _name;
		}
		
		/*
		WARNING: See the note in factory_item.h before using this function.
		
		Changes the name stored by the class.
		*/
		template<class paramType, class nameType>
		inline Item<paramType, nameType>& Item<paramType, nameType>::setName(const nameType& name)
		{
			this->_name = name;
			return *this;
		}
		
		//Constructs the instance of the class by merely storing the name in the object.
		template<class paramType, class nameType>
		inline Item<paramType, nameType>::Item(const nameType& name = "", paramType param = paramType())
		{
			this->_name = name;
		}
	}
}

#endif //KLIBRARY_FACTORY_ITEM_CODE_H