本文整理汇总了C++中OutputData::getPortType方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputData::getPortType方法的具体用法?C++ OutputData::getPortType怎么用?C++ OutputData::getPortType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputData
的用法示例。
在下文中一共展示了OutputData::getPortType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parsXml
//.........这里部分代码省略.........
<<ath->Row()<<".";
logger->addWarning(war);
}
}
/* retrieving data */
if(root->FirstChild("data"))
for(TiXmlElement* data = root->FirstChild("data")->FirstChildElement();
data; data = data->NextSiblingElement())
{
/* output data */
if(compareString(data->Value(), "output"))
{
OutputData output;
if(compareString(data->Attribute("port_type"), "stream") || !data->Attribute("port_type"))
output.setPortType(STREAM_PORT);
else if(compareString(data->Attribute("port_type"), "event"))
output.setPortType(EVENT_PORT);
else if(compareString(data->Attribute("port_type"), "service"))
output.setPortType(SERVICE_PORT);
else
{
OSTRINGSTREAM war;
war<<"Unknown port type \'"<<data->Attribute("port_type")<<"\' from "<<szFile<<" at line "\
<<data->Row()<<". Available types : stream, event, service";
logger->addWarning(war);
}
TiXmlElement* element;
if(output.getPortType() != SERVICE_PORT )
{
if((element = (TiXmlElement*) data->FirstChild("type")))
output.setName(parser->parseText(element->GetText()).c_str());
else
{
OSTRINGSTREAM war;
war<<"Output data from "<<szFile<<" at line "\
<<data->Row()<<" has no type.";
logger->addWarning(war);
}
}
else
output.setName("*");
if((element = (TiXmlElement*) data->FirstChild("port")))
{
output.setPort(parser->parseText(element->GetText()).c_str());
output.setCarrier(element->Attribute("carrier"));
}
else
{
OSTRINGSTREAM war;
war<<"Output data from "<<szFile<<" at line "\
<<data->Row()<<" has no port.";
logger->addWarning(war);
}
if((element = (TiXmlElement*) data->FirstChild("description")))
output.setDescription(parser->parseText(element->GetText()).c_str());
module.addOutput(output);
} // end of output data