Index: src/Types.cpp =================================================================== --- src/Types.cpp (revision 29785) +++ src/Types.cpp (working copy) @@ -38,6 +38,7 @@ #include "rtt-config.h" +#include #include #include #include "Attribute.hpp" @@ -185,6 +186,22 @@ return transporters[protocol_id]; } + std::string TypeInfo::dump() const + { + std::stringstream s; + for (size_t i=0; i typerepos; } @@ -249,4 +266,24 @@ if ( tr->registerTransport( i->first , i->second ) ) log(Info) << "Registered new '"<< tr->getTransportName()<<"' transport for " << i->first <first + << " (" << (*it).second->getTypeName() << ") protocols [" + << it->second->dump() << "]" << Logger::endl; + } + // dump the names of all known transports + Logger::log() << Logger::Debug << "Transports known to the Orocos Type System."<getTransportName() << Logger::endl; + } + } + + } Index: src/Types.hpp =================================================================== --- src/Types.hpp (revision 29785) +++ src/Types.hpp (working copy) @@ -229,6 +229,9 @@ detail::TypeTransporter* getProtocol(int protocol_id) const; + // return a space separated list of protocols that have transporters + std::string dump() const; + /** * @} */ @@ -271,6 +274,11 @@ * for Orocos types. */ void registerTransport( detail::TransportRegistrator* tr ); + + /** + * Dump all known types, and transport and their types, to the log + */ + void dumpToLog() const; }; } Index: src/DataPort.hpp =================================================================== --- src/DataPort.hpp (revision 29785) +++ src/DataPort.hpp (working copy) @@ -441,7 +441,22 @@ template ConnectionInterface::shared_ptr DataPortBase::createConnection(DataSourceBase::shared_ptr data) { +// std::cout << "Name='" << typeid(data.get()).name() << "', '" +// << data->getType() << "', '" +// << data->getTypeName() << "'" << std::endl; DataObjectInterface* doi = dynamic_cast< DataObjectInterface* >( data.get() ); + if (!doi) + { + // use this to figure out what is actually registered. + TypeInfoRepository::Instance()->dumpToLog(); + } + /* If the doi doesn't cast and the following assert fires, + then you may have misnamed your types when registering. Both the + types registered with the RTT toolkit as well as the types registered + with any transport (eg CORBA), must all have the _exact same name_. + If not, then the above cast fails. FYI ... + */ + assert(doi && "Dynanmic cast failed! Do your typenames not match?"); ConnectionInterface::shared_ptr ci( new DataConnection( doi ) ); ci->addPort(this); return ci;