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

// TYPE IfcDistributionPortTypeEnum = ENUMERATION OF	(CABLE	,CABLECARRIER	,DUCT	,PIPE	,USERDEFINED	,NOTDEFINED);
IfcDistributionPortTypeEnum::~IfcDistributionPortTypeEnum() {}
shared_ptr<BuildingObject> IfcDistributionPortTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcDistributionPortTypeEnum> copy_self( new IfcDistributionPortTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcDistributionPortTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCDISTRIBUTIONPORTTYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_CABLE:	stream << ".CABLE."; break;
		case ENUM_CABLECARRIER:	stream << ".CABLECARRIER."; break;
		case ENUM_DUCT:	stream << ".DUCT."; break;
		case ENUM_PIPE:	stream << ".PIPE."; break;
		case ENUM_USERDEFINED:	stream << ".USERDEFINED."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcDistributionPortTypeEnum::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_CABLE:	return L"CABLE";
		case ENUM_CABLECARRIER:	return L"CABLECARRIER";
		case ENUM_DUCT:	return L"DUCT";
		case ENUM_PIPE:	return L"PIPE";
		case ENUM_USERDEFINED:	return L"USERDEFINED";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcDistributionPortTypeEnum> IfcDistributionPortTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcDistributionPortTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcDistributionPortTypeEnum>(); }
	shared_ptr<IfcDistributionPortTypeEnum> type_object( new IfcDistributionPortTypeEnum() );
	if( boost::iequals( arg, L".CABLE." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_CABLE;
	}
	else if( boost::iequals( arg, L".CABLECARRIER." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_CABLECARRIER;
	}
	else if( boost::iequals( arg, L".DUCT." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_DUCT;
	}
	else if( boost::iequals( arg, L".PIPE." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_PIPE;
	}
	else if( boost::iequals( arg, L".USERDEFINED." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_USERDEFINED;
	}
	else if( boost::iequals( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcDistributionPortTypeEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}
