/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */

#include <sstream>
#include <limits>
#include <map>
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/IFC4/include/IfcRecurrenceTypeEnum.h"

// TYPE IfcRecurrenceTypeEnum = ENUMERATION OF	(DAILY	,WEEKLY	,MONTHLY_BY_DAY_OF_MONTH	,MONTHLY_BY_POSITION	,BY_DAY_COUNT	,BY_WEEKDAY_COUNT	,YEARLY_BY_DAY_OF_MONTH	,YEARLY_BY_POSITION);
IfcRecurrenceTypeEnum::~IfcRecurrenceTypeEnum() {}
shared_ptr<BuildingObject> IfcRecurrenceTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcRecurrenceTypeEnum> copy_self( new IfcRecurrenceTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcRecurrenceTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCRECURRENCETYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_DAILY:	stream << ".DAILY."; break;
		case ENUM_WEEKLY:	stream << ".WEEKLY."; break;
		case ENUM_MONTHLY_BY_DAY_OF_MONTH:	stream << ".MONTHLY_BY_DAY_OF_MONTH."; break;
		case ENUM_MONTHLY_BY_POSITION:	stream << ".MONTHLY_BY_POSITION."; break;
		case ENUM_BY_DAY_COUNT:	stream << ".BY_DAY_COUNT."; break;
		case ENUM_BY_WEEKDAY_COUNT:	stream << ".BY_WEEKDAY_COUNT."; break;
		case ENUM_YEARLY_BY_DAY_OF_MONTH:	stream << ".YEARLY_BY_DAY_OF_MONTH."; break;
		case ENUM_YEARLY_BY_POSITION:	stream << ".YEARLY_BY_POSITION."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcRecurrenceTypeEnum::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_DAILY:	return L"DAILY";
		case ENUM_WEEKLY:	return L"WEEKLY";
		case ENUM_MONTHLY_BY_DAY_OF_MONTH:	return L"MONTHLY_BY_DAY_OF_MONTH";
		case ENUM_MONTHLY_BY_POSITION:	return L"MONTHLY_BY_POSITION";
		case ENUM_BY_DAY_COUNT:	return L"BY_DAY_COUNT";
		case ENUM_BY_WEEKDAY_COUNT:	return L"BY_WEEKDAY_COUNT";
		case ENUM_YEARLY_BY_DAY_OF_MONTH:	return L"YEARLY_BY_DAY_OF_MONTH";
		case ENUM_YEARLY_BY_POSITION:	return L"YEARLY_BY_POSITION";
	}
	return L"";
}
shared_ptr<IfcRecurrenceTypeEnum> IfcRecurrenceTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcRecurrenceTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcRecurrenceTypeEnum>(); }
	shared_ptr<IfcRecurrenceTypeEnum> type_object( new IfcRecurrenceTypeEnum() );
	if( boost::iequals( arg, L".DAILY." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_DAILY;
	}
	else if( boost::iequals( arg, L".WEEKLY." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_WEEKLY;
	}
	else if( boost::iequals( arg, L".MONTHLY_BY_DAY_OF_MONTH." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_MONTHLY_BY_DAY_OF_MONTH;
	}
	else if( boost::iequals( arg, L".MONTHLY_BY_POSITION." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_MONTHLY_BY_POSITION;
	}
	else if( boost::iequals( arg, L".BY_DAY_COUNT." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_BY_DAY_COUNT;
	}
	else if( boost::iequals( arg, L".BY_WEEKDAY_COUNT." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_BY_WEEKDAY_COUNT;
	}
	else if( boost::iequals( arg, L".YEARLY_BY_DAY_OF_MONTH." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_YEARLY_BY_DAY_OF_MONTH;
	}
	else if( boost::iequals( arg, L".YEARLY_BY_POSITION." ) )
	{
		type_object->m_enum = IfcRecurrenceTypeEnum::ENUM_YEARLY_BY_POSITION;
	}
	return type_object;
}
