/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>

#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/IFC4/include/IfcDataOriginEnum.h"
#include "ifcpp/IFC4/include/IfcDateTime.h"
#include "ifcpp/IFC4/include/IfcEventTime.h"
#include "ifcpp/IFC4/include/IfcLabel.h"

// ENTITY IfcEventTime 
IfcEventTime::IfcEventTime( int id ) { m_entity_id = id; }
IfcEventTime::~IfcEventTime() {}
shared_ptr<BuildingObject> IfcEventTime::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcEventTime> copy_self( new IfcEventTime() );
	if( m_Name ) { copy_self->m_Name = dynamic_pointer_cast<IfcLabel>( m_Name->getDeepCopy(options) ); }
	if( m_DataOrigin ) { copy_self->m_DataOrigin = dynamic_pointer_cast<IfcDataOriginEnum>( m_DataOrigin->getDeepCopy(options) ); }
	if( m_UserDefinedDataOrigin ) { copy_self->m_UserDefinedDataOrigin = dynamic_pointer_cast<IfcLabel>( m_UserDefinedDataOrigin->getDeepCopy(options) ); }
	if( m_ActualDate ) { copy_self->m_ActualDate = dynamic_pointer_cast<IfcDateTime>( m_ActualDate->getDeepCopy(options) ); }
	if( m_EarlyDate ) { copy_self->m_EarlyDate = dynamic_pointer_cast<IfcDateTime>( m_EarlyDate->getDeepCopy(options) ); }
	if( m_LateDate ) { copy_self->m_LateDate = dynamic_pointer_cast<IfcDateTime>( m_LateDate->getDeepCopy(options) ); }
	if( m_ScheduleDate ) { copy_self->m_ScheduleDate = dynamic_pointer_cast<IfcDateTime>( m_ScheduleDate->getDeepCopy(options) ); }
	return copy_self;
}
void IfcEventTime::getStepLine( std::stringstream& stream ) const
{
	stream << "#" << m_entity_id << "= IFCEVENTTIME" << "(";
	if( m_Name ) { m_Name->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_DataOrigin ) { m_DataOrigin->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_UserDefinedDataOrigin ) { m_UserDefinedDataOrigin->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_ActualDate ) { m_ActualDate->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_EarlyDate ) { m_EarlyDate->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_LateDate ) { m_LateDate->getStepParameter( stream ); } else { stream << "$"; }
	stream << ",";
	if( m_ScheduleDate ) { m_ScheduleDate->getStepParameter( stream ); } else { stream << "$"; }
	stream << ");";
}
void IfcEventTime::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_entity_id; }
const std::wstring IfcEventTime::toString() const { return L"IfcEventTime"; }
void IfcEventTime::readStepArguments( const std::vector<std::wstring>& args, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	const size_t num_args = args.size();
	if( num_args != 7 ){ std::stringstream err; err << "Wrong parameter count for entity IfcEventTime, expecting 7, having " << num_args << ". Entity ID: " << m_entity_id << std::endl; throw BuildingException( err.str().c_str() ); }
	m_Name = IfcLabel::createObjectFromSTEP( args[0], map );
	m_DataOrigin = IfcDataOriginEnum::createObjectFromSTEP( args[1], map );
	m_UserDefinedDataOrigin = IfcLabel::createObjectFromSTEP( args[2], map );
	m_ActualDate = IfcDateTime::createObjectFromSTEP( args[3], map );
	m_EarlyDate = IfcDateTime::createObjectFromSTEP( args[4], map );
	m_LateDate = IfcDateTime::createObjectFromSTEP( args[5], map );
	m_ScheduleDate = IfcDateTime::createObjectFromSTEP( args[6], map );
}
void IfcEventTime::getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const
{
	IfcSchedulingTime::getAttributes( vec_attributes );
	vec_attributes.emplace_back( std::make_pair( "ActualDate", m_ActualDate ) );
	vec_attributes.emplace_back( std::make_pair( "EarlyDate", m_EarlyDate ) );
	vec_attributes.emplace_back( std::make_pair( "LateDate", m_LateDate ) );
	vec_attributes.emplace_back( std::make_pair( "ScheduleDate", m_ScheduleDate ) );
}
void IfcEventTime::getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes_inverse ) const
{
	IfcSchedulingTime::getAttributesInverse( vec_attributes_inverse );
}
void IfcEventTime::setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self_entity )
{
	IfcSchedulingTime::setInverseCounterparts( ptr_self_entity );
}
void IfcEventTime::unlinkFromInverseCounterparts()
{
	IfcSchedulingTime::unlinkFromInverseCounterparts();
}
