⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dataflowi.cpp

📁 机器人开源项目orocos的源代码
💻 CPP
字号:
// -*- C++ -*-//// $Id$// ****  Code generated by the The ACE ORB (TAO) IDL Compiler ****// TAO and the TAO IDL Compiler have been developed by://       Center for Distributed Object Computing//       Washington University//       St. Louis, MO//       USA//       http://www.cs.wustl.edu/~schmidt/doc-center.html// and//       Distributed Object Computing Laboratory//       University of California at Irvine//       Irvine, CA//       USA//       http://doc.ece.uci.edu/// and//       Institute for Software Integrated Systems//       Vanderbilt University//       Nashville, TN//       USA//       http://www.isis.vanderbilt.edu///// Information about TAO is available at://     http://www.cs.wustl.edu/~schmidt/TAO.html// TAO_IDL - Generated from // be/be_codegen.cpp:910#include "DataFlowI.h"#include "PortInterface.hpp"#include "ConnectionInterface.hpp"#include "Logger.hpp"using namespace RTT;// Implementation skeleton constructorRTT_Corba_DataFlowInterface_i::RTT_Corba_DataFlowInterface_i (::RTT::DataFlowInterface* dfi)    : mdf(dfi){}// Implementation skeleton destructorRTT_Corba_DataFlowInterface_i::~RTT_Corba_DataFlowInterface_i (void){}::RTT::Corba::DataFlowInterface::PortNames * RTT_Corba_DataFlowInterface_i::getPorts (      )  ACE_THROW_SPEC ((    CORBA::SystemException  )){  // Add your implementation here    ::RTT::DataFlowInterface::PortNames ports = mdf->getPortNames();    RTT::Corba::DataFlowInterface::PortNames_var pn = new RTT::Corba::DataFlowInterface::PortNames();    pn->length( ports.size() );    for (unsigned int i=0; i != ports.size(); ++i )        pn[i] = CORBA::string_dup( ports[i].c_str() );        return pn._retn();}::RTT::Corba::AssignableExpression_ptr RTT_Corba_DataFlowInterface_i::createDataChannel (    const char * port_name  )  ACE_THROW_SPEC ((    CORBA::SystemException  )){    RTT::Logger::In in("createDataChannel");  // Add your implementation here    PortInterface* p = mdf->getPort(port_name);    if ( p == 0) {        RTT::log() << "No such Port: "<< port_name <<endlog(Error);        return 0;    }    ConnectionInterface::shared_ptr ci;    if ( p->connected() == false) {        ci = p->createConnection();        // A newly created connection starts unconnected.        ci->connect();    } else {        ci = p->connection();    }    if ( !ci ) {        RTT::log() << "Failed to create Data Connection for Port: "<< port_name <<endlog(Error);        return 0;    }    CORBA::Object_var ret = ci->toChannel();    if ( CORBA::is_nil( ret ) ) {        RTT::log() << "Could not create DataChannel for Port: "<< port_name <<endlog(Error);        return 0;    }    ::RTT::Corba::AssignableExpression_var ec = ::RTT::Corba::AssignableExpression::_narrow( ret.in() );    if ( ec.in() )        return ec._retn();    RTT::log() << "Could not create DataChannel for Port (try BufferChannel ?): "<< port_name <<endlog(Error);    return 0;}::RTT::Corba::BufferChannel_ptr RTT_Corba_DataFlowInterface_i::createBufferChannel (    const char * port_name  )  ACE_THROW_SPEC ((    CORBA::SystemException  )){    PortInterface* p = mdf->getPort(port_name);    if ( p == 0)        return 0;    ConnectionInterface::shared_ptr ci;    if ( p->connected() == false) {        ci = p->createConnection();        // A newly created connection starts unconnected.        ci->connect();    } else {        ci = p->connection();    }    if ( !ci ) {        RTT::log() << "Failed to create Buffer Connection for Port: "<< port_name <<endlog(Error);        return 0;    }        CORBA::Object_var ret = ci->toChannel();    if ( CORBA::is_nil( ret ) ) {        RTT::log() << "Could not create BufferChannel for Port: "<< port_name <<endlog(Error);        return 0;    }    ::RTT::Corba::BufferChannel_var ec = ::RTT::Corba::BufferChannel::_narrow( ret.in() );    if ( ec.in() )        return ec._retn();    RTT::log() << "Could not create BufferChannel for Port (try DataChannel?): "<< port_name <<endlog(Error);    return 0;}::RTT::Corba::Expression_ptr RTT_Corba_DataFlowInterface_i::createDataObject (    const char * port_name  )  ACE_THROW_SPEC ((    CORBA::SystemException  )){    RTT::Logger::In in("createDataObject");  // Add your implementation here    PortInterface* p = mdf->getPort(port_name);    if ( p == 0) {        RTT::log() << "No such Port: "<< port_name <<endlog(Error);        return 0;    }    ConnectionInterface::shared_ptr ci;    if ( p->connected() == false) {        RTT::log() << "Can not create DataObject for unconnected Port: "<< port_name <<endlog(Error);        return 0;    } else {        ci = p->connection();    }    ::RTT::Corba::Expression_var ret = ci->getDataSource()->server(0);    if ( CORBA::is_nil( ret ) ) {        RTT::log() << "Could not create DataObject for connected Port: "<< port_name <<endlog(Error);        return 0;    }    return ret._retn();}::RTT::Corba::DataFlowInterface::PortType RTT_Corba_DataFlowInterface_i::getPortType (    const char * port_name  )  ACE_THROW_SPEC ((    CORBA::SystemException  )){  // Add your implementation here    PortInterface* p = mdf->getPort(port_name);    if ( p == 0)        return ::RTT::Corba::DataFlowInterface::PortType();    return ::RTT::Corba::DataFlowInterface::PortType( int(p->getPortType()) );}CORBA::Boolean RTT_Corba_DataFlowInterface_i::isConnected (    const char * port_name  )  ACE_THROW_SPEC ((    CORBA::SystemException  )){  // Add your implementation here  // Add your implementation here    PortInterface* p = mdf->getPort(port_name);    if ( p == 0)        return 0;    return p->connected();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -