commit 526a4adc3102ba0ec72ca1135cecf669e42d1f76
Author: Peter Soetens <peter@thesourceworks.com>
Date:   Thu Jun 18 12:12:21 2009 +0200

    Fixed up the spurious Failed to create... void CORBA errors.

    void is now an 'officially registred' type for both local and CORBA
    typed communication.

diff --git a/src/DataSource.cpp b/src/DataSource.cpp
index d0bc429..a6677bc 100644
--- a/src/DataSource.cpp
+++ b/src/DataSource.cpp
@@ -190,9 +190,10 @@ namespace RTT
         const std::string& DataSourceTypeInfo<void>::getType() { return tname; }
         const std::string& DataSourceTypeInfo<void>::getQualifier() { return DataSourceTypeInfo<UnknownType>::noqual; }
         const TypeInfo* DataSourceTypeInfo<void>::getTypeInfo() {
-            return DataSourceTypeInfo<UnknownType>::getTypeInfo();
+            if (!TypeInfoObject)
+                return DataSourceTypeInfo<UnknownType>::getTypeInfo();
+            return TypeInfoObject;
         }
-
     }
 }

diff --git a/src/RealTimeToolkit.cpp b/src/RealTimeToolkit.cpp
index fc1ebd5..4ac280d 100644
--- a/src/RealTimeToolkit.cpp
+++ b/src/RealTimeToolkit.cpp
@@ -43,6 +43,7 @@
 #include <Operators.hpp>
 #include <OperatorTypes.hpp>
 #include <TemplateTypeInfo.hpp>
+#include <TypeInfoName.hpp>
 #include <MultiVector.hpp>
 #include <mystd.hpp>

@@ -128,6 +129,7 @@ namespace RTT
         ti->addType( new TemplateTypeInfo<unsigned int, true>("uint") );
         ti->addType( new TemplateTypeInfo<double, true>("double") );
         ti->addType( new BoolTypeInfo() );
+        ti->addType( new TypeInfoName<void>("void"));

 #ifndef ORO_EMBEDDED
         ti->addType( new TemplateTypeInfo<PropertyBag, false>("PropertyBag") );
diff --git a/src/TypeInfoName.hpp b/src/TypeInfoName.hpp
index 264b2f7..a182a42 100644
--- a/src/TypeInfoName.hpp
+++ b/src/TypeInfoName.hpp
@@ -165,7 +165,6 @@ namespace RTT
                 Logger::log() << Logger::Warning << "Overriding TypeInfo for '"
                               << detail::DataSourceTypeInfo<T>::value_type_info::TypeInfoObject->getTypeName()
                               << "'." << Logger::endl;
-                delete detail::DataSourceTypeInfo<T>::value_type_info::TypeInfoObject;
             }
             detail::DataSourceTypeInfo<T>::value_type_info::TypeInfoObject = this;
         }
diff --git a/src/corba/CorbaLib.cpp b/src/corba/CorbaLib.cpp
index d24c2eb..08f4e10 100644
--- a/src/corba/CorbaLib.cpp
+++ b/src/corba/CorbaLib.cpp
@@ -52,10 +52,15 @@ namespace RTT {
         class CorbaFallBackProtocol
             : public TypeTransporter
         {
+            bool warn;
+        public:
+            CorbaFallBackProtocol(bool do_warn = true) : warn(do_warn) {}
             virtual void* createBlob(DataSourceBase::shared_ptr source) const
             {
-                Logger::In in("CorbaFallBackProtocol");
-                log(Error) << "Failing Corba::Any creation of type "<< source->getTypeName()<<"." <<Logger::endl;
+                if (warn) {
+                    Logger::In in("CorbaFallBackProtocol");
+                    log(Error) << "Could not send data of type '"<< source->getTypeName()<<"' : data type not known to CORBA Transport." <<Logger::endl;
+                }
                 return new CORBA::Any();
             }

@@ -64,8 +69,10 @@ namespace RTT {
              */
             virtual bool updateBlob(const void* blob, DataSourceBase::shared_ptr target) const
             {
-                Logger::In in("CorbaFallBackProtocol");
-                log(Debug) << "Failing conversion of type "<<target->getTypeName()<<"." <<Logger::endl;
+                if (warn) {
+                    Logger::In in("CorbaFallBackProtocol");
+                    log(Error) << "Could not update type '"<<target->getTypeName()<<"' with received data : data type not known to CORBA Transport." <<Logger::endl;
+                }
                 return false;
             }

@@ -112,13 +119,17 @@ namespace RTT {
              * Used to setup a Corba Data Flow.
              */
             virtual DataSourceBase* dataProxy( PortInterface* data ) const {
-                log(Warning) << "Can not create a proxy for data connection of remote port "<<data->getName() <<endlog();
+                if (warn) {
+                    log(Warning) << "Can not create a proxy for data connection of remote port "<<data->getName() <<endlog();
+                }
                 Corba::CorbaPort* cp = dynamic_cast<Corba::CorbaPort*>( data );
                 return new Corba::CorbaDataObjectProxy<detail::UnknownType>("CorbaProxy", cp->getDataChannel());
             }

             virtual DataSourceBase* dataProxy( void* data ) const {
-                log(Warning) << "Can not create a proxy for data connection." <<endlog();
+                if (warn) {
+                    log(Warning) << "Can not create a proxy for data connection." <<endlog();
+                }
                 Corba::AssignableExpression_ptr ae = static_cast<Corba::AssignableExpression_ptr>(data);
                 return new Corba::CorbaDataObjectProxy<detail::UnknownType>("CorbaProxy", ae );
             }
@@ -132,24 +143,30 @@ namespace RTT {
              * Used to setup a Corba Data Flow.
              */
             virtual BufferBase* bufferProxy( PortInterface* data ) const {
-                log(Warning) << "Can not create a proxy for buffer connection of remote port "<<data->getName() <<endlog();
+                if (warn) {
+                    log(Warning) << "Can not create a proxy for buffer connection of remote port "<<data->getName() <<endlog();
+                }
                 Corba::CorbaPort* cp = dynamic_cast<Corba::CorbaPort*>( data );
                 return new Corba::CorbaBufferProxy<detail::UnknownType>( cp->getBufferChannel() );
             }

             virtual BufferBase* bufferProxy( void* data ) const {
-                log(Warning) << "Can not create a proxy for buffer connection." <<endlog();
+                if (warn) {
+                    log(Warning) << "Can not create a proxy for buffer connection." <<endlog();
+                }
                 Corba::BufferChannel_ptr buf = static_cast<Corba::BufferChannel_ptr>(data);
                 return new Corba::CorbaBufferProxy<detail::UnknownType>( buf );
             }

             virtual void* bufferServer( BufferBase::shared_ptr source, void* arg) const
             {
-              // arg is POA !
-              log(Warning) << "Can not create a useful server for an unknown data type." << endlog();
-              RTT_Corba_BufferChannel_i<UnknownType>* cbuf = new RTT_Corba_BufferChannel_i<UnknownType>( source );
-              // activate servant:
-              return cbuf->_this();
+                // arg is POA !
+                if (warn) {
+                    log(Warning) << "Can not create a useful server for an unknown data type." << endlog();
+                }
+                RTT_Corba_BufferChannel_i<UnknownType>* cbuf = new RTT_Corba_BufferChannel_i<UnknownType>( source );
+                // activate servant:
+                return cbuf->_this();
             }

             /**
@@ -159,7 +176,9 @@ namespace RTT {
              */
             virtual DataSourceBase* narrowDataSource(DataSourceBase* dsb)
             {
-                log(Warning) << "Corba: Do not know how to narrow to " << dsb->getTypeName() << endlog();
+                if (warn) {
+                    log(Warning) << "Corba: Do not know how to narrow to " << dsb->getTypeName() << endlog();
+                }
                 return 0;
             }

@@ -170,7 +189,9 @@ namespace RTT {
              */
             virtual DataSourceBase* narrowAssignableDataSource(DataSourceBase* dsb)
             {
-                log(Warning) << "Corba: Do not know how to narrow to " << dsb->getTypeName() << endlog();
+                if (warn) {
+                    log(Warning) << "Corba: Do not know how to narrow to " << dsb->getTypeName() << endlog();
+                }
                 return 0;
             }

@@ -200,6 +221,8 @@ namespace RTT {
                     return ti->addProtocol(ORO_CORBA_PROTOCOL_ID, new CorbaTemplateProtocol<bool>() );
                 if ( name == "array" )
                     return ti->addProtocol(ORO_CORBA_PROTOCOL_ID, new CorbaTemplateProtocol< std::vector<double> >() );
+                if ( name == "void" )
+                    return ti->addProtocol(ORO_CORBA_PROTOCOL_ID, new CorbaFallBackProtocol(false)); // warn=false
                 return false;
             }

