Search code examples
c++opendds

tao_idl -Gstl doesn't map std::string


I'm using opendds and tao/ace to generate code from an idl file.

My idl file:

struct SSave
{
    string strr;
};

I generate the code like so:

opendds_idl Class.idl 
tao_idl -Gstl -I/usr/include/ Class.idl 
tao_idl -Gstl -I/usr/include/ ClassTypeSupport.idl
#-Gstl Generate the alternate C++ mapping for IDL strings and sequences

And here's what I got in the file ClassC.h for example:

#include <vector>    
#include <string> //inclusion of string
{...}
struct  SSave
{

    // TAO_IDL - Generated from
    // /build/opendds-3.13/ACE_TAO/TAO/TAO_IDL/be/be_type.cpp:304
    typedef SSave_var _var_type;
    typedef SSave_out _out_type;

    static void _tao_any_destructor (void *); 

    ::TAO::String_Manager strr; //NOT std::string
};
{...}

So is there a way to tell TAO to map std::string instead of ::TAO::String_Manager?

Note: I'm using version 2.5.1 of tao_idl.

Thanks in advance.


Solution

  • OpenDDS follows the IDL to C++ language mapping, there a IDL string is mapped to its own specific type (as tao_idl generates). As part of AXCIOMA we have implemented the IDL to C++11 language mapping for DDS which will support OpenDDS in the next major release.

    Btw, you already asked this on the OpenDDS mailing list and got a response there.