/* 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/IfcProtectiveDeviceTypeEnum.h"

// TYPE IfcProtectiveDeviceTypeEnum = ENUMERATION OF	(CIRCUITBREAKER	,EARTHLEAKAGECIRCUITBREAKER	,EARTHINGSWITCH	,FUSEDISCONNECTOR	,RESIDUALCURRENTCIRCUITBREAKER	,RESIDUALCURRENTSWITCH	,VARISTOR	,USERDEFINED	,NOTDEFINED);
IfcProtectiveDeviceTypeEnum::~IfcProtectiveDeviceTypeEnum() {}
shared_ptr<BuildingObject> IfcProtectiveDeviceTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcProtectiveDeviceTypeEnum> copy_self( new IfcProtectiveDeviceTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcProtectiveDeviceTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCPROTECTIVEDEVICETYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_CIRCUITBREAKER:	stream << ".CIRCUITBREAKER."; break;
		case ENUM_EARTHLEAKAGECIRCUITBREAKER:	stream << ".EARTHLEAKAGECIRCUITBREAKER."; break;
		case ENUM_EARTHINGSWITCH:	stream << ".EARTHINGSWITCH."; break;
		case ENUM_FUSEDISCONNECTOR:	stream << ".FUSEDISCONNECTOR."; break;
		case ENUM_RESIDUALCURRENTCIRCUITBREAKER:	stream << ".RESIDUALCURRENTCIRCUITBREAKER."; break;
		case ENUM_RESIDUALCURRENTSWITCH:	stream << ".RESIDUALCURRENTSWITCH."; break;
		case ENUM_VARISTOR:	stream << ".VARISTOR."; break;
		case ENUM_USERDEFINED:	stream << ".USERDEFINED."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcProtectiveDeviceTypeEnum::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_CIRCUITBREAKER:	return L"CIRCUITBREAKER";
		case ENUM_EARTHLEAKAGECIRCUITBREAKER:	return L"EARTHLEAKAGECIRCUITBREAKER";
		case ENUM_EARTHINGSWITCH:	return L"EARTHINGSWITCH";
		case ENUM_FUSEDISCONNECTOR:	return L"FUSEDISCONNECTOR";
		case ENUM_RESIDUALCURRENTCIRCUITBREAKER:	return L"RESIDUALCURRENTCIRCUITBREAKER";
		case ENUM_RESIDUALCURRENTSWITCH:	return L"RESIDUALCURRENTSWITCH";
		case ENUM_VARISTOR:	return L"VARISTOR";
		case ENUM_USERDEFINED:	return L"USERDEFINED";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcProtectiveDeviceTypeEnum> IfcProtectiveDeviceTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcProtectiveDeviceTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcProtectiveDeviceTypeEnum>(); }
	shared_ptr<IfcProtectiveDeviceTypeEnum> type_object( new IfcProtectiveDeviceTypeEnum() );
	if( boost::iequals( arg, L".CIRCUITBREAKER." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_CIRCUITBREAKER;
	}
	else if( boost::iequals( arg, L".EARTHLEAKAGECIRCUITBREAKER." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_EARTHLEAKAGECIRCUITBREAKER;
	}
	else if( boost::iequals( arg, L".EARTHINGSWITCH." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_EARTHINGSWITCH;
	}
	else if( boost::iequals( arg, L".FUSEDISCONNECTOR." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_FUSEDISCONNECTOR;
	}
	else if( boost::iequals( arg, L".RESIDUALCURRENTCIRCUITBREAKER." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_RESIDUALCURRENTCIRCUITBREAKER;
	}
	else if( boost::iequals( arg, L".RESIDUALCURRENTSWITCH." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_RESIDUALCURRENTSWITCH;
	}
	else if( boost::iequals( arg, L".VARISTOR." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_VARISTOR;
	}
	else if( boost::iequals( arg, L".USERDEFINED." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_USERDEFINED;
	}
	else if( boost::iequals( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcProtectiveDeviceTypeEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}
