return true;
}
+bool YACSEvalPort::IsOutputPortPublishable(const YACS::ENGINE::OutputPort *port)
+{
+ YACS::ENGINE::TypeCode *tc(port->edGetType());
+ if(!tc)
+ throw YACS::Exception("YACSEvalPort::IsOutputPortPublishable : null type code !");
+ return tc->kind()==YACS::ENGINE::Double || tc->kind()==YACS::ENGINE::Int;
+}
+
std::string YACSEvalPort::GetTypeOfData(const YACS::ENGINE::DataPort *port)
{
YACS::ENGINE::TypeCode *tc(port->edGetType());
YACSEVALYFX_EXPORT virtual ~YACSEvalPort() { }
public:
YACSEVALYFX_EXPORT static bool IsInputPortPublishable(const YACS::ENGINE::InputPort *port);
+ YACSEVALYFX_EXPORT static bool IsOutputPortPublishable(const YACS::ENGINE::OutputPort *port);
protected:
YACSEVALYFX_EXPORT static std::string GetTypeOfData(const YACS::ENGINE::DataPort *port);
};
for(std::list< YACS::ENGINE::OutputPort *>::const_iterator it=allOutputPorts.begin();it!=allOutputPorts.end();it++)
{
YACS::ENGINE::OutputPort *elt(*it);
- if(!elt)
- throw YACS::Exception("YACSEvalYFXRunOnlyPattern::buildOutputPorts : presence of null output !");
- std::string outpName(elt->getName());
- if(outpName.empty())
- throw YACS::Exception("YACSEvalYFXRunOnlyPattern::buildOutputPorts : an output has empty name ! Should not !");
- if(std::find(allNames.begin(),allNames.end(),outpName)!=allNames.end())
+ if(YACSEvalPort::IsOutputPortPublishable(elt))
{
- std::ostringstream oss; oss << "YACSEvalYFXRunOnlyPattern::buildOutputPorts : output name \"" << outpName << "\" appears more than once !";
- throw YACS::Exception(oss.str());
+ if(!elt)
+ throw YACS::Exception("YACSEvalYFXRunOnlyPattern::buildOutputPorts : presence of null output !");
+ std::string outpName(elt->getName());
+ if(outpName.empty())
+ throw YACS::Exception("YACSEvalYFXRunOnlyPattern::buildOutputPorts : an output has empty name ! Should not !");
+ if(std::find(allNames.begin(),allNames.end(),outpName)!=allNames.end())
+ {
+ std::ostringstream oss; oss << "YACSEvalYFXRunOnlyPattern::buildOutputPorts : output name \"" << outpName << "\" appears more than once !";
+ throw YACS::Exception(oss.str());
+ }
+ _outputs.push_back(YACSEvalOutputPort(*it));
}
- _outputs.push_back(YACSEvalOutputPort(*it));
}
}