void cpPlugins::BaseObjects::MultipleInputsPort::
Add( cpPlugins::BaseObjects::DataObject* o )
{
- /* TODO
- if( o == NULL )
- return;
- auto otype = std::type_index( typeid( *o ) );
- if( this->m_Type == otype )
- this->m_Data.push_back( o );
- else
- throw std::logic_error(
- "cpPlugins::MultipleInputsPort: incompatible types \"" +
- std::string( otype.name( ) ) + std::string( "\" and \"" ) +
- std::string( this->m_Type.name( ) ) + std::string( "\"" )
- );
- */
+ if( this->m_Sample.IsNull( ) )
+ throw std::logic_error(
+ "cpPlugins::SingleDataPort: Port not yet configured"
+ );
+ if( o != NULL )
+ {
+ if( this->m_Sample->IsCompatible( o ) )
+ {
+ this->m_Data.push_back( o );
+ }
+ else
+ throw std::logic_error(
+ "cpPlugins::SingleDataPort: incompatible types \"" +
+ std::string( typeid( *o ).name( ) ) + std::string( "\" and \"" ) +
+ std::string( typeid( *( this->m_Sample.GetPointer( ) ) ).name( ) ) +
+ std::string( "\"" )
+ );
+
+ } // fi
}
// -------------------------------------------------------------------------